Unofficial discord-interactions multi page embed handler
Project description
dinteractions-Paginator
Unofficial discord-interactions multi-page embed handler
Installation
pip install dinteractions-Paginator
Dependencies
Example
This simple example shows how to easily create interactive, multiple page embeds that annyone can interact with.
import discord
from discord.ext import commands
from discord_slash import SlashCommand, SlashContext
from dinteractions_Paginator import Paginator
bot = commands.Bot(command_prefix="/")
slash = SlashCommand(bot, sync_commands=True)
@slash.slash(name="command")
async def command(ctx: SlashContext):
embed1 = discord.Embed(title="Title")
embed2 = discord.Embed(title="Another Title")
embed3 = discord.Embed(title="Yet Another Title")
pages = [embed1, embed2, embed3]
await Paginator(bot=bot, ctx=ctx, pages=pages, content="Hello there")
bot.run("token")
Arguments
bot
- The bot variable,commands.Bot()
is requiredctx
- The context of a command;SlashContext
pages
- A list of embeds (discord.Embed()
) to be paginatedcontent
- Optional: the content (str
) of the message to send, defaults toNone
prevLabel
- The label of the button (str
) used to go to the previous page, defaults to"Previous"
nextLabel
- The label of the button (str
) used to go to the next page, defaults to"Next"
prevEmoji
- Optional: emoji of the button (discord.emoji.Emoji
,discord.partial_emoji.PartialEmoji
, ordict
) used to go to the previous page, defaults toNone
nextEmoji
- Optional: emoji of the button (discord.emoji.Emoji
,discord.partial_emoji.PartialEmoji
, ordict
) used to go to the next page, defaults toNone
indexStyle
- Optional: the type of button (ButtonStyle
orint
) for the index button, defaults to1
(ButtonStyle.blue
orButtonStyle.blurple
)prevStyle
- Optional: the type of button (ButtonStyle
orint
) for the previous button, defaults to3
(ButtonStyle.green
)nextStyle
- Optional: the type of button (ButtonStyle
orint
) for the next button, defaults to3
(ButtonStyle.green
)timeout
- Optional: if you want the paginator to work for a limited number of seconds, you can specify it here (int
), defaults toNone
(meaning no timeout)authorOnly
- Optional: if you want the paginator to work for the author only, default isFalse
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Close
Hashes for dinteractions_Paginator-1.0.4.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 85a31132ffe8f4d20f5ff967fb23aeeb7d294271bba31a7c24124ced1a2dc763 |
|
MD5 | abcb917ebabeac2e839013d69f82bc46 |
|
BLAKE2b-256 | 675fe6f354fd8c374c679bbb948f3bebf2eb11e79af6c75e36817173cf5747b1 |
Close
Hashes for dinteractions_Paginator-1.0.4-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 7c3ca99ca582d039d5e1c7bc981d27cb272951a6c280173c8ec6c4e739488818 |
|
MD5 | 3042e0d90f99bcda226e4bb336283b3b |
|
BLAKE2b-256 | 4005bf77d6947234605d067e67b964d9dac6a6ffa6d2de8caca482f7e745b7b8 |