diff --git a/NadekoBot.Core/Modules/Administration/DangerousCommands.cs b/NadekoBot.Core/Modules/Administration/DangerousCommands.cs index e1649495..7c38a801 100644 --- a/NadekoBot.Core/Modules/Administration/DangerousCommands.cs +++ b/NadekoBot.Core/Modules/Administration/DangerousCommands.cs @@ -10,7 +10,6 @@ using Discord; #if !GLOBAL_NADEKO namespace NadekoBot.Modules.Administration { - //todo make users confirm their decision public partial class Administration { [Group] diff --git a/NadekoBot.Core/Modules/Gambling/DiceRollCommands.cs b/NadekoBot.Core/Modules/Gambling/DiceRollCommands.cs index 5458768b..c18d78bf 100644 --- a/NadekoBot.Core/Modules/Gambling/DiceRollCommands.cs +++ b/NadekoBot.Core/Modules/Gambling/DiceRollCommands.cs @@ -31,7 +31,6 @@ namespace NadekoBot.Modules.Gambling _images = data.LocalImages; } - [NadekoCommand, Usage, Description, Aliases] public async Task Roll() { diff --git a/NadekoBot.Core/Modules/Gambling/WaifuClaimCommands.cs b/NadekoBot.Core/Modules/Gambling/WaifuClaimCommands.cs index 272719f0..619c6248 100644 --- a/NadekoBot.Core/Modules/Gambling/WaifuClaimCommands.cs +++ b/NadekoBot.Core/Modules/Gambling/WaifuClaimCommands.cs @@ -10,6 +10,7 @@ using System.Threading.Tasks; using NadekoBot.Common; using NadekoBot.Common.Attributes; using NadekoBot.Modules.Gambling.Services; +using Discord.WebSocket; namespace NadekoBot.Modules.Gambling { @@ -58,13 +59,16 @@ namespace NadekoBot.Modules.Gambling private readonly CurrencyService _cs; private readonly DbService _db; private readonly IDataCache _cache; + private readonly DiscordSocketClient _client; - public WaifuClaimCommands(IDataCache cache, IBotConfigProvider bc, CurrencyService cs, DbService db) + public WaifuClaimCommands(IDataCache cache, IBotConfigProvider bc, + CurrencyService cs, DbService db, DiscordSocketClient client) { _bc = bc; _cs = cs; _db = db; _cache = cache; + _client = client; } [NadekoCommand, Usage, Description, Aliases] @@ -310,7 +314,7 @@ namespace NadekoBot.Modules.Gambling var now = DateTime.UtcNow; if (w?.Affinity?.UserId == u?.Id) { - //todo don't let people change affinity on different shards + } else if (!_cache.TryAddAffinityCooldown(Context.User.Id, out remaining)) { @@ -473,18 +477,27 @@ namespace NadekoBot.Modules.Gambling [NadekoCommand, Usage, Description, Aliases] [RequireContext(ContextType.Guild)] [Priority(1)] - public async Task WaifuGift() + public async Task WaifuGift(int page = 1) { - var embed = new EmbedBuilder() - .WithTitle(GetText("waifu_gift_shop")) - .WithOkColor(); + if (--page < 0 || page > 2) + return; - Enum.GetValues(typeof(WaifuItem.ItemName)) - .Cast() - .Select(x => WaifuItem.GetItem(x)) - .ForEach(x => embed.AddField(f => f.WithName(x.ItemEmoji + " " + x.Item).WithValue(x.Price).WithIsInline(true))); + await Context.Channel.SendPaginatedConfirmAsync(_client, page, (cur) => + { + var embed = new EmbedBuilder() + .WithTitle(GetText("waifu_gift_shop")) + .WithOkColor(); - await Context.Channel.EmbedAsync(embed).ConfigureAwait(false); + Enum.GetValues(typeof(WaifuItem.ItemName)) + .Cast() + .Select(x => WaifuItem.GetItem(x)) + .OrderBy(x => x.Price) + .Skip(9 * cur) + .Take(9) + .ForEach(x => embed.AddField(f => f.WithName(x.ItemEmoji + " " + x.Item).WithValue(x.Price).WithIsInline(true))); + + return embed; + }, Enum.GetValues(typeof(WaifuItem.ItemName)).Length, 9); } [NadekoCommand, Usage, Description, Aliases] diff --git a/NadekoBot.Core/Services/Database/Models/WaifuItem.cs b/NadekoBot.Core/Services/Database/Models/WaifuItem.cs index b203f5fb..6a9a0832 100644 --- a/NadekoBot.Core/Services/Database/Models/WaifuItem.cs +++ b/NadekoBot.Core/Services/Database/Models/WaifuItem.cs @@ -22,6 +22,21 @@ namespace NadekoBot.Core.Services.Database.Models Violin, Ring, Helicopter, + Iphone, //4000 + Cat, //2000 + Dog, //2001 + Lollipop, //30 + Purse, //3500 + Sushi, //300 + Icecream, //200 + Piano, //8000 + Yacht, //12000 + Car, //9000 + House, //15000 + Spaceship, //30000 + Beer, //75 + Pizza, //150 + Milk, //125 } public WaifuItem() @@ -64,6 +79,36 @@ namespace NadekoBot.Core.Services.Database.Models return new WaifuItem("💍", 10000, itemName); case ItemName.Helicopter: return new WaifuItem("🚁", 20000, itemName); + case ItemName.Iphone: + return new WaifuItem("📱", 4000, itemName); + case ItemName.Cat: + return new WaifuItem("🐱", 2000, itemName); + case ItemName.Dog: + return new WaifuItem("🐶", 2001, itemName); + case ItemName.Lollipop: + return new WaifuItem("🍭", 30, itemName); + case ItemName.Purse: + return new WaifuItem("👛", 3500, itemName); + case ItemName.Sushi: + return new WaifuItem("🍣", 300, itemName); + case ItemName.Icecream: + return new WaifuItem("🍦", 200, itemName); + case ItemName.Piano: + return new WaifuItem("🎹", 8000, itemName); + case ItemName.Yacht: + return new WaifuItem("🛳", 12000, itemName); + case ItemName.Car: + return new WaifuItem("🚗", 9000, itemName); + case ItemName.House: + return new WaifuItem("🏠", 15000, itemName); + case ItemName.Spaceship: + return new WaifuItem("🚀", 30000, itemName); + case ItemName.Beer: + return new WaifuItem("🍺", 75, itemName); + case ItemName.Pizza: + return new WaifuItem("🍕", 150, itemName); + case ItemName.Milk: + return new WaifuItem("🥛", 125, itemName); default: throw new ArgumentException(nameof(itemName)); }