Paginator for Dis-Snek Python Discord API wrapper
Project description
snek-paginator
Paginator for Dis-Snek Python Discord API wrapper
Installation:
pip install -U snek-paginator
Basic Example:
from dis_snek.client import Snake
from dis_snek.models.application_commands import slash_command
from dis_snek.models import Embed
from snek_paginator import Paginator
bot = Snake()
@slash_command('paginator')
async def paginator(ctx):
embeds = [
Embed(title='Page 1', description='This is page 1'),
Embed(title='Page 2', description='This is page 2'),
Embed(title='Page 3', description='This is page 3'),
Embed(title='Page 4', description='This is page 4'),
Embed(title='Page 5', description='This is page 5'),
]
await Paginator(bot, ctx, embeds).run()
class Paginator
method run(*args, **kwargs)
Required:
bot: Snake
- The bot instancectx: InteractionContext
- The context of the command or componentpages: list[Embed]
- A list of Embed objects to paginate
Optional:
timeout: int = None
- How long in seconds the paginator should runauthor_only: bool = False
- Whether the paginator should only be used by the authoronly_for: Union[User, Member, Role, List[Union[User, Member, Role]]] = None
- Who should use the paginatoruse_select: bool = True
- Whether the paginator should use the selectuse_buttons: bool = True
- Whether the paginator should use the buttonsdisable_after_timeout: bool = True
- Whether the components should disable after timeoutdelete_after_timeout: bool = False
- Whether the components should delete after timeoutextend_buttons: bool = True
- Whether the first and last page buttons should be usedfirst_button: Button = Button(ButtonStyles.BLUE, emoji="⏮")
- The first page buttonprevious_button: Button = Button(ButtonStyles.BLUE, emoji="◀")
- The previous page buttonnext_button: Button = Button(ButtonStyles.BLUE, emoji="▶")
- The next page buttonlast_button: Button = Button(ButtonStyles.BLUE, emoji="⏭")
- The last page button
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
snek_paginator-1.0.0.tar.gz
(16.0 kB
view hashes)
Built Distribution
Close
Hashes for snek_paginator-1.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | c7efe8662e54903b4994907c4b8370aaf5c0122b3a4d6b2c0fc5c8e5643453a1 |
|
MD5 | 276742dfea6fbe3b4fcc336204b55cab |
|
BLAKE2b-256 | 5a7bec3eee21117d320bc8a4572c331dcfe784fd6e7ae1c58ec3f75c0cbf435b |