public async Task WaifuGift(WaifuItem.ItemName item, [Remainder] IUser waifu)
            {
                if (waifu.Id == Context.User.Id)
                {
                    return;
                }

                var itemObj = WaifuItem.GetItemObject(item, Bc.BotConfig.WaifuGiftMultiplier);

                bool sucess = await _service.GiftWaifuAsync(Context.User.Id, waifu, itemObj);

                if (sucess)
                {
                    await ReplyConfirmLocalized("waifu_gift", Format.Bold(item.ToString() + " " + itemObj.ItemEmoji), Format.Bold(waifu.ToString()));
                }
                else
                {
                    await ReplyErrorLocalized("not_enough", Bc.BotConfig.CurrencySign);
                }
            }
示例#2
0
            public async Task WaifuGift(int page = 1)
            {
                if (--page < 0 || page > 3)
                {
                    return;
                }

                await ctx.SendPaginatedConfirmAsync(page, (cur) =>
                {
                    var embed = new EmbedBuilder()
                                .WithTitle(GetText("waifu_gift_shop"))
                                .WithOkColor();

                    Enum.GetValues(typeof(WaifuItem.ItemName))
                    .Cast <WaifuItem.ItemName>()
                    .Select(x => WaifuItem.GetItemObject(x, Bc.BotConfig.WaifuGiftMultiplier))
                    .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);
            }