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):
embeds = [discord.Embed(title="First embed"),
discord.Embed(title="Second embed"),
discord.Embed(title="Third embed")]
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
InitialPage = 0
timeout = 0
ephemeral = bool
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!