PaginatedShopMessage() public static method

public static PaginatedShopMessage ( IEnumerable waifus, int pageSize, string prefix, ulong guildId, ShopType type = ShopType.Waifu ) : Namiko.CustomPaginatedMessage
waifus IEnumerable
pageSize int
prefix string
guildId ulong
type ShopType
return Namiko.CustomPaginatedMessage
示例#1
0
        public async Task ModShop([Remainder] string str = "")
        {
            WaifuShop shop = await WaifuUtil.GetShop(Context.Guild.Id, ShopType.Mod);

            int              count  = Constants.shoplimitedamount + Constants.shopt1amount + Constants.shopt2amount + Constants.shopt3amount;
            string           prefix = Program.GetPrefix(Context);
            List <ShopWaifu> waifus = new List <ShopWaifu>();

            if (shop != null)
            {
                waifus = shop.ShopWaifus;
            }

            waifus = waifus.OrderBy(x => x.Waifu.Tier).ThenBy(x => x.Waifu.Source).ThenBy(x => x.Waifu.Name).ToList();

            if (waifus.Count <= count)
            {
                var eb = WaifuUtil.NewShopEmbed(waifus, prefix, Context.Guild.Id, ShopType.Mod);
                await Context.Channel.SendMessageAsync("", false, eb.Build());

                return;
            }

            await PagedReplyAsync(WaifuUtil.PaginatedShopMessage(waifus, count, prefix, Context.Guild.Id, ShopType.Mod));
        }