An extension for discord.py that allows your bot to use buttons
Project description
Usage
ButtonPaginator
from discord.ext import commands
from dpy_button_utils import ButtonPaginator
bot = commands.Bot(command_prefix="!", help_command=None)
@bot.command()
async def page_plain_text(ctx: commands.Context):
paginator = ButtonPaginator(bot, messages=[f"Option {x}" for x in range(10)], timeout=10)
await paginator.run(ctx)
@bot.command()
async def page_embeds(ctx: commands.Context):
paginator = ButtonPaginator(bot, embeds=[
discord.Embed(title="bonk", description=f"Option {x}") for x in range(10)
])
await paginator.run(ctx)
bot.run("TOKEN")
After the paginator is done, you can access the page it left off on with paginator.counter
.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
dpy_button_utils-0.1.tar.gz
(4.2 kB
view hashes)
Built Distribution
Close
Hashes for dpy_button_utils-0.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | f2353b69c4d109ee8e89444423e4e1c230b7d89c7f02b8c28a2d44b7abbb8189 |
|
MD5 | 96e6589e4dfcfd269320c16e318813fd |
|
BLAKE2b-256 | 925fc2294743f57f992ed93d892e5ecd944faf8c5754ca29cd441b5f56913d8e |