示例#1
0
        void OnReady()
        {
            api       = new DiscordApiClient();
            api.Token = Config.BotToken;

            api.RunAsync();
            RegisterEvents();
        }
示例#2
0
 void HandleResumedEvent(JsonObject data)
 {
     // May not be null when reconnecting
     if (api == null)
     {
         api       = new DiscordApiClient();
         api.Token = Config.BotToken;
         api.RunAsync();
     }
     OnReady();
 }
示例#3
0
        void HandleReadyEvent(JsonObject data)
        {
            JsonObject user = (JsonObject)data["user"];

            botUserID = (string)user["id"];

            api       = new DiscordApiClient();
            api.Token = Config.BotToken;

            api.RunAsync();
            RegisterEvents();
        }
示例#4
0
        void HandleReadyEvent(JsonObject data)
        {
            JsonObject user = (JsonObject)data["user"];

            botUserID = (string)user["id"];

            // May not be null when reconnecting
            if (api == null)
            {
                api       = new DiscordApiClient();
                api.Token = Config.BotToken;
                api.RunAsync();
            }
            OnReady();
        }