public static async Task Maindo(SocketMessage arg) { if (Economy.CountProductForUser(Product.flower, arg.Author.Id) > 0) { var User = arg.MentionedUsers.Count >= 1 ? arg.MentionedUsers.First() : null; if (User == null) { await arg.Channel.SendMessageAsync("Please mention a user to give the flower to!"); var WFR = new WaitForResponse() { TimeLimitS = 15, ChannelId = arg.Channel.Id, UserId = arg.Author.Id }; var Msg = await WFR.Start(); User = Msg.MentionedUsers.Count > 0 ? Msg.MentionedUsers.First() : null; } await arg.Channel.SendMessageAsync($"You gave {User.Mention} a flower! <3"); Economy.ChangeProductCountForUser(Product.flower, -1, arg.Author.Id); Economy.ChangeProductCountForUser(Product.flower, 1, User.Id); } else { await arg.Channel.SendMessageAsync($"You need to buy flowers first! `{Program.Prefix}buy flower`"); } }
public static async Task Maindo(SocketMessage arg) { try { long Count = 1; long CountOfProductsForUser = Economy.CountProductForUser(Product.pills, arg.Author.Id); if (arg.Content.ToLower().Split(' ').Length >= 2) { if (!long.TryParse(arg.Content.ToLower().Split(' ')[1], out Count)) { Count = 1; } } if (CountOfProductsForUser >= Count) { var Prompt = new Prompt() { ChannelForPrompt = arg.Channel, MaxTime = 10, Options = new Emoji[] { new Emoji("\uD83D\uDC4D"), new Emoji("\uD83D\uDC4E") }, Target = arg.Author, Title = $"Are you sure you want to take pills? (x{Count})" }; var Response = await Prompt.ShowPrompt(); if (Response != null && Response.Name == "👍") { Economy.ChangeProductCountForUser(Product.pills, -Count, arg.Author.Id); await TakePills(arg, Count); } else { await arg.Channel.SendMessageAsync("kk."); } } else { await arg.Channel.SendMessageAsync($"You need to buy {Count} pill(s) first."); } } catch (Exception e) { Console.WriteLine(e); } }
public static async Task Maindo(SocketMessage arg) { string Key = $"PADLOCK-ACTIVE"; if (StoreHandler.LoadData(arg.Author.Id, Key) != null) { await arg.Channel.SendMessageAsync("You already have a padlock active!"); } else if (Economy.CountProductForUser(Product.padlock, arg.Author.Id) > 0) { Economy.ChangeProductCountForUser(Product.padlock, -1, arg.Author.Id); StoreHandler.SaveData(arg.Author.Id, Key, true); await arg.Channel.SendMessageAsync("Padlock is now active on your balance! This is one-time use, when someone tries to steal from you they will fail immediately."); } else { await arg.Channel.SendMessageAsync("You need to buy a padlock to use this!"); } }