Some utilities for discord.py. Making Discord bot development easier.
Project description
Disputils provides some neat features to make your life as a bot developer easier.
Install
Install latest release from PyPI via pip:
python3.6 -m pip install disputils
Or the freshest bleeding-edge code directly from GitHub using pip and git:
python3.6 -m pip install -U git+https://github.com/LiBa001/disputils
Features
Quick overview of the available features.
For all features there are two ways to use them.
just discord.py and a basic discord.Client
discord.py commands extension (discord.ext.commands) and a Bot
In the following we’re going to use the second way since it’s a bit easier.
from disputils import BotEmbedPaginator, BotConfirmation, BotMultipleChoice
Pagination
Split your content into multiple pages and use reactions to paginate through.
@bot.command()
async def paginate(ctx):
embeds = [
Embed(title="test page 1", description="This is just some test content!", color=0x115599),
Embed(title="test page 2", description="Nothing interesting here.", color=0x5599ff),
Embed(title="test page 3", description="Why are you still here?", color=0x191638)
]
paginator = BotEmbedPaginator(ctx, embeds)
await paginator.run()
Multiple Choice
Let the user decide. Provide multiple choice!
@bot.command()
async def choice(ctx):
multiple_choice = BotMultipleChoice(ctx, ['one', 'two', 'three', 'four', 'five', 'six'], "Testing stuff")
await multiple_choice.run()
await multiple_choice.quit(multiple_choice.choice)
Confirmation
Is the user going to do something irreversible? Let him confirm first!
@bot.command()
async def confirm(ctx):
confirmation = BotConfirmation(ctx, 0x012345)
await confirmation.confirm("Are you sure?")
if confirmation.confirmed:
await confirmation.update("Confirmed", color=0x55ff55)
else:
await confirmation.update("Not confirmed", hide_author=True, color=0xff5555)
Requirements
Python 3.6
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
Built Distribution
Hashes for disputils-0.1.3-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d80c29b68a58cd45660388edd3031dbf92072d1d2e163e2810935687b7547217 |
|
MD5 | 84d73c8750eacd0f50a64a224cbf7bcc |
|
BLAKE2b-256 | 423d1e97def00be2cb55898775af220414b6238574cab2c3d4063c2ee7891a10 |