public Task Execute(IChatClient chatClient, ChatCommandEventArgs e) { lock (_mutex) { if (chatClient.GetType().ToString() == e.ClientType) { if (_adventureGame is null) { _adventureGame = new AdventureGame(); } _adventureGame.HandleCommand(chatClient, e); } } return(null); }
private void DoTheThing(CommandReceivedEventArgs e, IChatClient chatClient, IBotCommand botCommand) { CommandUsage commandUsage = AttemptToRunCommand(e, botCommand, chatClient); var commandUsageEntity = new CommandUsageEntity(e.CommandWord, botCommand.GetType().FullName, e.ChatUser.UserId, e.ChatUser.DisplayName, chatClient.GetType().Name); _repository.Create(commandUsageEntity); _usageTracker.RecordUsage(commandUsage); }