Esempio n. 1
0
 internal void NewSession()
 {
     extraCoins = missedCoins = 0;
     bits       = subs = 0;
     extraCoinsText.WriteLine("0.00");
     if (DateTime.Now.DayOfWeek == DayOfWeek.Friday)
     {
         kraken = true;
         krakenText.WriteAllLines(new List <string>
         {
             "Next kraken: 0.00/11",
             "Krakens released: 0"
         });
         nextKraken   = 11;
         totalKrakens = 0;
     }
     else
     {
         kraken = false;
     }
     bot.Log("Automatically starting new session");
 }
Esempio n. 2
0
 private void ChatCommandHandler(object sender, TwitchLib.Client.Events.OnChatCommandReceivedArgs e)
 {
     try
     {
         if (chatCommands.TryGetValue(e.Command.CommandText, out Command c))
         {
             c.Invoke(e).GetAwaiter().GetResult();
             if (e.Command.ChatMessage.IsModerator || e.Command.ChatMessage.IsBroadcaster || e.Command.ChatMessage.Username.ToLower() == "iggnaccy")
             {
                 bot.Log($"{e.Command.ChatMessage.Username} used {e.Command.CommandText} command with arguments {e.Command.ArgumentsAsString}");
             }
         }
     }
     catch (Exception ex)
     {
         bot.LogError("Command - ChatCommandHandler", $"Error occured during {e.Command.CommandText} command: {ex.Message}");
     }
 }