mirror of
https://github.com/stijndcl/didier.git
synced 2026-04-07 15:48:29 +02:00
Show list of custom commands
This commit is contained in:
parent
a310d1696c
commit
7847cc1d29
11 changed files with 57 additions and 7 deletions
0
data/menus/__init__.py
Normal file
0
data/menus/__init__.py
Normal file
21
data/menus/custom_commands.py
Normal file
21
data/menus/custom_commands.py
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
import discord
|
||||
from discord.ext import menus
|
||||
|
||||
|
||||
class CommandsList(menus.ListPageSource):
|
||||
def __init__(self, data, colour=discord.Colour.blue()):
|
||||
super().__init__(data, per_page=15)
|
||||
self.colour = colour
|
||||
|
||||
async def format_page(self, menu: menus.MenuPages, entries):
|
||||
embed = discord.Embed(colour=self.colour)
|
||||
embed.set_author(name="Custom Commands")
|
||||
embed.description = "\n".join(entries)
|
||||
embed.set_footer(text="{}/{}".format(menu.current_page + 1, self.get_max_pages()))
|
||||
|
||||
return embed
|
||||
|
||||
|
||||
class Pages(menus.MenuPages):
|
||||
def __init__(self, source, clear_reactions_after, timeout=30.0):
|
||||
super().__init__(source, timeout=timeout, delete_message_after=True, clear_reactions_after=clear_reactions_after)
|
||||
Loading…
Add table
Add a link
Reference in a new issue