Skip to main content

This is a module that contains paginators for disnake

Project description

disnake-paginator

A module containing paginators for disnake

Installation

pip install disnake-paginator

Examples

Interaction example

async def ping_command(inter):
	paginator = disnake_paginator.ButtonPaginator(title="Pong", segments=["Hello", "World"], color=0x00ff00)
	await paginator.start(inter)

on_message example

async def on_message(message):
	if message.content == "!ping":
		paginator = disnake_paginator.ButtonPaginator(title="Pong", segments=["This is", "a message"], button_style=disnake.ButtonStyle.red)
		await paginator.start(disnake_paginator.wrappers.MessageInteractionWrapper(message)) #sends a message in the channel
		await paginator.start(disnake_paginator.wrappers.UserInteractionWrapper(message.author)) #sends a DM to the author

split function

async def aaa_command(inter):
	paginator = disnake_paginator.ButtonPaginator(title="aaa", segments=disnake_paginator.split("a"*6969, 1000), target_page=4)
	await paginator.start(inter)

Arguments

title = The title of the embed
segments = The contents (pages) of the paginator (supports str and disnake.Embed)
color = The color of all the embeds
prefix = The prefix of every page in the embed
suffix = The suffix of every page in the embed
target_page = The page that the paginator will display when sent
timeout = The amount of seconds before the paginator stops working
button_style = The style of the buttons on the paginator (red, gray, green, etc)
invalid_user_text = The function that will be called when another user tries to use the paginator (x)_button_emoji = The emoji displayed on the (x) button (for example first_button_emoji) (x)_button_label = The label (text) displayed on the (x) button (for example next_button_label)

If you would like to modify this repository (including its code) in your own project, please be sure to credit!

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

disnake_paginator-1.0.8.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

disnake_paginator-1.0.8-py3-none-any.whl (5.4 kB view details)

Uploaded Python 3

File details

Details for the file disnake_paginator-1.0.8.tar.gz.

File metadata

  • Download URL: disnake_paginator-1.0.8.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.10.9

File hashes

Hashes for disnake_paginator-1.0.8.tar.gz
Algorithm Hash digest
SHA256 4a7d2a6ca364248757f060914513f1c16bad06d1bd73566dec99d002c979238b
MD5 b59d947c067bca11d8593990f568f581
BLAKE2b-256 8cdb3a86b247c7653a3f1676d16a316daf400edcf76295098ab60544f2a8f8b7

See more details on using hashes here.

File details

Details for the file disnake_paginator-1.0.8-py3-none-any.whl.

File metadata

File hashes

Hashes for disnake_paginator-1.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 5e01f0c48afdfc7b3eb17b9a9b7fcb4e51d6d36a2c2aa78e9266a0ac736c804d
MD5 4b2218ffabf78191fe8cc73e84e21987
BLAKE2b-256 78e383529ac0306ffd5be69d6c3ac3930fe3cfc83eaaf41de5a4d25de2fc3331

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page