/// <summary> /// Constructor for EventSystem. /// </summary> /// <param name="botInfo">Optional information for the event system about the bot.</param> public EventSystem(Action <BotInformation> botInfo) { if (bot != null) { Log.Warning("EventSystem already defined, terminating..."); return; } bot = new BotInformation(botInfo); events = new EventContainer(); sql = new Sql(bot.SqlInformation, bot.Identifier); Sql.TryCreateTable("identifier(id BIGINT, i varchar(255))"); OverrideIdentifier = bot.Name.ToLower() + "."; DefaultIdentifier = bot.Identifier; }
public EventSystem(Bot bot) { if (this.bot != null) { Log.Warning("EventSystem already defined, terminating..."); return; } this.bot = bot; bot.Events = this; Events = new EventContainer(); CommandHandler = new CommandHandler(this); RegisterAttributeCommands(); bot.MessageReceived += InternalMessageReceived; bot.GuildJoin += InternalJoinedGuild; bot.GuildLeave += InternalLeftGuild; }