Exemple #1
0
        public async Task StartBot(string botToken)
        {
            CVTS.WriteLineDiscord("Building command service...");
            await commandService.AddModulesAsync(Assembly.GetEntryAssembly(), null);

            CVTS.WriteLineDiscord("Attempting to login to discord with the specified bot token...");
            await botUser.LoginAsync(TokenType.Bot, botToken);

            CVTS.WriteLineDiscord("Login succesful, starting bot service...");
            await botUser.StartAsync();

            CVTS.WriteLineOk("Discord bot started successfully!");
#if DEBUG
            await botUser.SetStatusAsync(UserStatus.Idle);

            await botUser.SetGameAsync("Testing Mode");
#endif
            await Task.Delay(-1);
        }
Exemple #2
0
 public void Init()
 {
     CVTS.WriteLineDiscord("Initialising the Discord bot...");
     botUser.MessageReceived += MessageReceived;
     CVTS.WriteLineDiscord("Initialization of the Discord bot has completed!");
 }