public void ConfigureGamble(GambleConfiguration newSettings)
        {
            lock (this.commands)
            {
                this.channelDetails.gambleConfiguration = newSettings;

                // complete reset:
                this.commands.RemoveAll(x => x.commandType == Constants.CommandType.Gamble);

                if (this.channelDetails.gambleConfiguration != null && this.channelDetails.gambleConfiguration.gambleEnabled)
                {
                    this.commands.Add(new Command(
                                          Constants.CommandType.Gamble,
                                          new Action <ChatMessage, Command>((message, command) =>
                    {
                        this.Gamble(message);
                    }),
                                          Constants.AccessLevel.Public,
                                          false,
                                          false,
                                          this.channelDetails.gambleConfiguration.gambleCommand,
                                          true, // has parameters
                                          null,
                                          3     // timeout is managed in the command, so use a really low one here to prevent spamming
                                          ));
                }

                updateHelpString();
            }
        }
Exemple #2
0
 public void UpdateConnection(string channelName, GambleConfiguration gambleSettings)
 {
     lock (chatBots)
     {
         ChatBotConnection bot;
         if (chatBots.TryGetValue(channelName, out bot))
         {
             bot.ConfigureGamble(gambleSettings);
         }
     }
 }