Skip to main content
PyPI License Documentation https://img.shields.io/badge/code%20style-black-000000.svg

Disputils

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 examples 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()
https://raw.githubusercontent.com/LiBa001/disputils/master/docs/img/paginate.png

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)
https://raw.githubusercontent.com/LiBa001/disputils/master/docs/img/choice.png

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)
https://raw.githubusercontent.com/LiBa001/disputils/master/docs/img/confirm.png

Requirements

Metadata

Release files for disputils 0.2.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for disputils 0.2.0
File Size Uploaded
disputils-0.2.0.tar.gz 8.7 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for disputils 0.2.0
File Interpreter ABI Platform
disputils-0.2.0-py3-none-any.whl Python 3 none any Details

Total release size: 19.3 kB

Release files / disputils-0.2.0.tar.gz

Download URL disputils-0.2.0.tar.gz
Size 8.7 kB
Tags Source
SHA-256 checksum
How to use checksums
d0a2671a16a6bf3cfffd962421fe8e6f196d199a7112ee6e8c78b57f4c85a021
BLAKE2b-256 checksum
How to use checksums
edeedc657ab2df9cf77c50fb155f83c769cb92e217a8f8ff65a9fa3c716f23ef
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.3.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.5

Release files / disputils-0.2.0-py3-none-any.whl

Download URL disputils-0.2.0-py3-none-any.whl
Size 10.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
750b55b97b1d27b045b5f9675c43ec6c0042cac857de95fa4dd916ded34d47e1
BLAKE2b-256 checksum
How to use checksums
bb19532e8eb832fa9fc55a5c6a9e863dfb181abe30dc789ac218a583bb5a84c3
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/4.3.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.0 CPython/3.7.5

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page