public async Task Announce([Remainder] string content) { var config = GlobalUserAccounts.GetAllAccounts(); foreach (var userAcc in config) { SocketUser user = Global.Client.GetUser(userAcc.Id); await CreateMessage.CreateAndSendMessageAsync("Nayu Announcement!", content, DateTime.Now, user); GlobalUserAccounts.SaveAccounts(userAcc.Id); } await ReplyAsync($"Sent \n`{content}`\n to everyone"); }
public static async Task CheckDuelLootboxes(SocketUser user) { var config = GlobalUserAccounts.GetUserAccount(user); var channel = await user.GetOrCreateDMChannelAsync(); var wins = config.Wins; string msg = ""; var c = wins % 3; var uc = wins % 10; var rare = wins % 20; var epic = wins % 35; var legendary = wins % 50; if (legendary == 0) { config.LootBoxLegendary += 1; msg = $"**{user.Username}**, you have received a **LEGENDARY** lootbox for reaching {config.Wins} wins!"; } else if (epic == 0) { config.LootBoxEpic += 1; msg = $"**{user.Username}**, you have received a **EPIC** lootbox for reaching {config.Wins} wins!"; } else if (rare == 0) { config.LootBoxRare += 1; msg = $"**{user.Username}**, you have received a **RARE** lootbox for reaching {config.Wins} wins!"; } else if (uc == 0) { config.LootBoxUncommon += 1; msg = $"**{user.Username}**, you have received a **UNCOMMON** lootbox for reaching {config.Wins} wins!"; } else if (c == 0) { config.LootBoxCommon += 1; msg = $"**{user.Username}**, you have received a **COMMON** lootbox for reaching {config.Wins} wins!"; } GlobalUserAccounts.SaveAccounts(user.Id); await CreateMessage.CreateAndSendMessageAsync("Lootbox Reward", msg, DateTime.UtcNow, user); }
public static async Task CheckLootBoxRewards(SocketUser user) { var config = GlobalUserAccounts.GetUserAccount(user); var channel = await user.GetOrCreateDMChannelAsync(); int level = (int)config.LevelNumber; string msg; int uc = level % 5; int rare = level % 10; int epic = level % 15; int legendary = level % 20; if (legendary == 0) { config.LootBoxLegendary += 1; msg = lootBoxMessage(user, "LEGENDARY"); } else if (epic == 0) { config.LootBoxEpic += 1; msg = lootBoxMessage(user, "EPIC"); } else if (rare == 0) { config.LootBoxRare += 1; msg = lootBoxMessage(user, "RARE"); } else if (uc == 0) { config.LootBoxUncommon += 1; msg = lootBoxMessage(user, "UNCOMMON"); } else { config.LootBoxCommon += 1; msg = lootBoxMessage(user, "COMMON"); } GlobalUserAccounts.SaveAccounts(user.Id); await CreateMessage.CreateAndSendMessageAsync("Lootbox Reward", msg, DateTime.UtcNow, user); }
//try to get something so that all pets will experience soemthing public async void OnTimerTicked(object sender, ElapsedEventArgs e) { var config = GlobalUserAccounts.GetAllAccounts(); foreach (var userAcc in config) { Core.Entities.Chomusuke activeChomusuke = Global.NewChomusuke; if (userAcc.ActiveChomusuke == 1) { activeChomusuke = userAcc.Chomusuke1; } if (userAcc.ActiveChomusuke == 2) { activeChomusuke = userAcc.Chomusuke2; } if (userAcc.ActiveChomusuke == 3) { activeChomusuke = userAcc.Chomusuke3; } if (userAcc.Chomusuke1.Have) { if (activeChomusuke.Hunger > 0) { activeChomusuke.Hunger -= 1; } else { activeChomusuke.Hunger = 0; } if (activeChomusuke.Waste < 20) { activeChomusuke.Waste += 1; } else { activeChomusuke.Waste = 20; } var user = Global.Client.GetUser(userAcc.Id); if (activeChomusuke.Waste >= 15) { activeChomusuke.Sick = true; await CreateMessage.CreateAndSendMessageAsync("Chomusuke Alert", $":exclamation: | {user.Mention}, **{activeChomusuke.Name}** is sick! Treat it right with medicine with n!buy!", DateTime.Now, user); } if ((activeChomusuke.Waste == 20) && (activeChomusuke.Hunger <= 5)) { activeChomusuke.Trust -= 1; await CreateMessage.CreateAndSendMessageAsync("Chomusuke Alert", $":exclamation: | {user.Mention}, **{activeChomusuke.Name}** is losing trust in you! The living conditions you provided were too low... Maybe try to pay more attention to your Chomusuke!", DateTime.Now, user); } if (userAcc.ActiveChomusuke == 1) { userAcc.Chomusuke1 = activeChomusuke; } if (userAcc.ActiveChomusuke == 2) { userAcc.Chomusuke2 = activeChomusuke; } if (userAcc.ActiveChomusuke == 3) { userAcc.Chomusuke3 = activeChomusuke; } GlobalUserAccounts.SaveAccounts(userAcc.Id); } else { return; } } Console.WriteLine("Successfully executed pet crippling effects."); }