A discord paginator.
Project description
Markination
Markination is a versatile Python package that provides an easy-to-use Discord message paginator using the discord.py library.
Features
- Discord Button Paginator
- Discord Dropdown Paginator
- Built-in support for navigation buttons (Next, Previous, First, Last).
- Designed for ease of use in your Discord bot projects.
- Extensible and open-source.
Installation
You can install Markination using Poetry and PyPi
poetry add markination
pip install markination
Usage
Simple Button Setup:
from markination import ButtonPaginator
from discord.ext import commands
import discord
@bot.command()
async def paginator(ctx: commands.Context):
# A list of embeds to paginate
embeds = [discord.Embed(title="First embed"),
discord.Embed(title="Second embed"),
discord.Embed(title="Third embed")]
# Start the paginator
await ButtonPaginator.Simple().start(ctx, pages=embeds)
Custom Buttons:
from markination import ButtonPaginator
from discord.ext import commands
import discord
from discord import ui
@bot.command()
async def paginator(ctx: commands.Context):
embeds = [discord.Embed(title="First embed"),
discord.Embed(title="Second embed"),
discord.Embed(title="Third embed")]
PreviousButton = discord.ui.Button(label=f"Previous")
NextButton = discord.ui.Button(label=f"Next")
FirstPageButton = discord.ui.Button(label=f"First Page")
LastPageButton = discord.ui.Button(label=f"Last page")
PageCounterStyle = discord.ButtonStyle.danger # Only accepts ButtonStyle instead of Button
InitialPage = 0 # Page to start the paginator on.
timeout = 0 # Seconds to timeout. Default is 60
ephemeral = bool # Defaults to false if not passed in.
await ButtonPaginator.Simple(
PreviousButton=PreviousButton,
NextButton=NextButton,
FirstEmbedButton=FirstPageButton,
LastEmbedButton=LastPageButton,
PageCounterStyle=PageCounterStyle,
InitialPage=InitialPage,
timeout=timeout, ephemeral=ephemeral).start(ctx, pages=embeds)
Simple Dropdown Setup
from markination import DropdownPaginator
from discord.ext import commands
import discord
from discord import ui
@bot.command()
async def dropdown(ctx):
pages = [
discord.Embed(title="Page 1", description="This is the first page."),
discord.Embed(title="Page 2", description="This is the second page."),
discord.Embed(title="Page 3", description="This is the third page.")
]
await DropdownPaginator.Simple(ctx, pages, timeout=60).start(ctx)
Pull Requests are always open!
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
markination-0.2.3.tar.gz
(3.8 kB
view details)
Built Distribution
File details
Details for the file markination-0.2.3.tar.gz
.
File metadata
- Download URL: markination-0.2.3.tar.gz
- Upload date:
- Size: 3.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.5 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 534594593a33c6d4aedd4afb431da1b9935642f0221729076ded5484ea72a9ae |
|
MD5 | 6c7a0b83ec1be4984f688882afddd2a2 |
|
BLAKE2b-256 | 1e2eacc3e05df56dd715feb4bbc9963dcc7d7824bad01b25a65076343e2b5541 |
File details
Details for the file markination-0.2.3-py3-none-any.whl
.
File metadata
- Download URL: markination-0.2.3-py3-none-any.whl
- Upload date:
- Size: 4.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.6.1 CPython/3.11.5 Windows/10
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8beee71787012cbc1ba089324b254e0e9ff7bcaf4c71d600be551c77d95265c7 |
|
MD5 | 4c31dc07e651e741653eef628ec6f71f |
|
BLAKE2b-256 | a24573a071a7c23dfd9e104088b84e8e33b43f2ac65bcabe8e6372d7a7ba1229 |