public static void BetCommand(string speaker, int betAmount) { if (UserHandler.GetPointsFromUser(speaker) < betAmount) { ChatLink.SendTwitchMessage("Can't bet with points you don't have 4Head"); return; } ChatLink.SendTwitchMessage($"{speaker} bets with {betAmount}"); var bet = r.Next(0, 100) + 1; if (bet > 50) { ChatLink.SendTwitchMessage($"{speaker} rolled a {bet} and wins! {betAmount} added to points. " + $"Current amount: {UserHandler.GetPointsFromUser(speaker) + betAmount}"); UserHandler.AddPointsToUser(speaker, betAmount); } else { ChatLink.SendTwitchMessage($"{speaker} rolled a {bet} and loses! {betAmount} removed from points. " + $"Current amount: {UserHandler.GetPointsFromUser(speaker) - betAmount}"); UserHandler.RemovePointsFromUser(speaker, betAmount); } }
private void resetPointsButton_Click(object sender, EventArgs e) { UserHandler.ClearPoints(); MessageBox.Show("Points Cleared!", "Clear Points", MessageBoxButtons.OK); }
private void pointsTimer_Tick(object sender, EventArgs e) { UserHandler.AddPointsToAll(); }