Skip to main content

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

Requirements

Metadata

Release files for disputils 0.1.3

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.1.3
File Size Uploaded Provenance Actions
disputils-0.1.3.tar.gz 6.1 kB Without provenance Details for disputils-0.1.3.tar.gz

Built distribution (wheel)

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

Total release size: 14.7 kB

Release files / disputils-0.1.3.tar.gz

Download URL disputils-0.1.3.tar.gz
Size 6.1 kB
Tags Source
SHA-256 checksum
How to use checksums
ea05bac8239e3b8dabfa10db9378c3ccd3b26522d659ec9f386e39edd55be372
BLAKE2b-256 checksum
How to use checksums
17cad0fee53dd4d8b5b8a6c8437604a95a89eb3de4c57926d53eb82d76e495d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.31.0 CPython/3.7.1

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

Download URL disputils-0.1.3-py3-none-any.whl
Size 8.6 kB
Tags Python 3
SHA-256 checksum
How to use checksums
d80c29b68a58cd45660388edd3031dbf92072d1d2e163e2810935687b7547217
BLAKE2b-256 checksum
How to use checksums
423d1e97def00be2cb55898775af220414b6238574cab2c3d4063c2ee7891a10
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/2.0.0 pkginfo/1.5.0.1 requests/2.21.0 setuptools/41.4.0 requests-toolbelt/0.9.1 tqdm/4.31.0 CPython/3.7.1

Security for disputils 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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