Skip to main content

Some utilities for discord.py. Making Discord bot development easier.

Project description

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

Note

A compatible version of discord.py will be installed automatically when downloading with pip. However, you should still require discord.py in your own setup.py or requirements.txt file.

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

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

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for disputils, version 0.2.0
Filename, size File type Python version Upload date Hashes
Filename, size disputils-0.2.0.tar.gz (8.7 kB) File type Source Python version None Upload date Hashes View
Filename, size disputils-0.2.0-py3-none-any.whl (10.6 kB) File type Wheel Python version py3 Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page