コード例 #1
0
ファイル: ReactionHandler.cs プロジェクト: ItsKaa/Ditto
 public void Uninstall()
 {
     _discordClient?.Do((client) =>
     {
         if (client != null)
         {
             client.ReactionAdded    -= DiscordClient_ReactionAdded;
             client.ReactionRemoved  -= DiscordClient_ReactionRemoved;
             client.ReactionsCleared -= DiscordClient_ReactionsCleared;
         }
     });
     _messageData.Clear();
 }
コード例 #2
0
 public void Dispose()
 {
     try
     {
         _discordClient?.Do((client) =>
         {
             if (client != null)
             {
                 client.MessageReceived -= MessageReceivedHandler;
                 client.JoinedGuild     -= JoinedGuildHandler;
                 client.LeftGuild       -= LeftGuildHandler;
             }
         });
     }
     catch { }
     try { Modules?.Clear(); } catch { }
 }