Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="EventHandler"/> class.
 /// </summary>
 /// <param name="bot">The discord bot events should be logged for.</param>
 /// <param name="logger">The log handler, used for handling generic logging.</param>
 public EventHandler(DiscordBotBase bot, Logger logger, InteractivityExtension ext, CachingMechanism.EntityCache cache)
 {
     _cache             = cache;
     Bot                = bot;
     Logger             = logger;
     Ext                = ext;
     Bot.Logger.Logged += Logger_MessageLogged;
     if (bot is DiscordBotSharder sharder)
     {
         sharder.ShardReady += Bot_ShardReady;
     }
     Bot.Ready                  += ReadyAsync;
     Bot.CommandExecuted        += CommandExecutedAsync;
     Bot.CommandExecutionFailed += CommandExecutionFailedAsync;
     Bot.ReactionAdded          += Bot_ReactionAdded;
     Bot.ReactionRemoved        += Bot_ReactionRemoved;
 }
 public RoleAssigner(CachingMechanism.EntityCache cache)
 {
     _cache = cache;
 }