コード例 #1
0
        private static async Task Main()
        {
            {
                string ReadFile(string filename) => File.ReadAllText(filename).Replace("\r\n", "\n");

                // Token retrieved from static TokenRetriever class to prevent token theft (TokenRetriever will not be available on GitHub)
                Steed bot = new Steed(TokenRetriever.RetrieveToken(), ReadFile(@"Commands\Commands.txt"), ReadFile(@"Commands\Admin\AdminCommands.txt"));

#if !DEBUG
                bot.RegisterCommandClass <CommandActions>();
                bot.RegisterCommandClass <AdminCommandActions>();
#else
                bot.RegisterDebugCommandClass <CommandActions>();
                bot.RegisterDebugCommandClass <AdminCommandActions>();
#endif // !DEBUG

                await bot.StartAsync();
            }

            await Task.Delay(-1);
        }
コード例 #2
0
ファイル: CommandContext.cs プロジェクト: Aleksbgbg/Steed-Bot
 internal CommandContext(Steed bot, DiscordMessage message, Match match)
 {
     Bot     = bot;
     Message = message;
     Match   = match;
 }
コード例 #3
0
 void Awake()
 {
     steed  = (Steed)(new DJ());
     knight = (Knight)(new SirLance());
 }