Make memes paginated, Fixes #14

pull/21/head
Stijn De Clercq 2020-12-24 00:13:25 +01:00
parent 6a946559e2
commit cb4e67be69
1 changed files with 4 additions and 4 deletions

View File

@ -1,3 +1,4 @@
from data import paginatedLeaderboard
from decorators import help from decorators import help
import discord import discord
from discord.ext import commands from discord.ext import commands
@ -162,10 +163,9 @@ class Fun(commands.Cog):
memeList = [": ".join([stringFormatters.titleCase(meme[1]), memeList = [": ".join([stringFormatters.titleCase(meme[1]),
str(meme[2])]) for meme in sorted(memeList, key=lambda x: x[1])] str(meme[2])]) for meme in sorted(memeList, key=lambda x: x[1])]
# Add the fields into the embed pages = paginatedLeaderboard.Pages(source=paginatedLeaderboard.Source(memeList, "Memes", discord.Colour.blue()),
embed = discord.Embed(colour=discord.Colour.blue()) clear_reactions_after=True)
embed.add_field(name="Meme: aantal velden", value="\n".join(memeList), inline=False) await pages.start(ctx)
await ctx.send(embed=embed)
@commands.command(name="Pjoke") @commands.command(name="Pjoke")
@help.Category(category=Category.Fun) @help.Category(category=Category.Fun)