public Bot(ITwitchNETDALService twitchNETService, IBotDTO bot, int intervalReconnectMS) { _twitchNetService = twitchNETService; _bot = bot; _intervalReconnectMS = intervalReconnectMS; }
public async Task <IBot> AddBotAsync(BotCredentials credentials, IBotDTO botDTO, int reconnectIntervalMS) { IBot bot = new Bot(_twitchNETService, botDTO, reconnectIntervalMS); bot.ConnectionBotEvent += OnConnectionBotEvent; bot.ConnectionServerBotEvent += OnConnectionServerBotEvent; bot.ConnectionServerUserEvent += OnConnectionServerUserEvent; bot.MessageServerChatEvent += OnMessageServerChatEvent; bot.MessageServerCommandEvent += OnMessageServerCommandEvent; bot.MessageWhisperEvent += OnMessageWhisperEvent; bot.ColorChangeEvent += OnColorChangeEvent; bot.ErrorEvent += OnErrorEvent; await bot.ConnectAsync(credentials); _bots.TryAdd(botDTO.Id, bot); return(bot); }