Skip to main content

A discord.py utility library.

Project description

dis.patch

A discord.py utility library.

Warning

This is a very early alpha version. There might be some unknown issues.

Features

  • custom Context with additional features like ctx.ask

  • patched Bot and AutoShardedBot classes:

    • use custom Context
    • automatically loads token and prefix from .env file
    • automatically loads cogs/extensions if cogs_path is passed (e.g. cogs_path="bot/cogs")
  • monkey_patch() to overwrite discord.py classes with dispatch

Installation

pip install dis.patch

Usage

.env

TOKEN=token
PREFIX=?

bot.py

import dispatch
from discord.ext import commands

dispatch.monkey_patch()

bot: dispatch.Bot = commands.Bot(cogs_path="bot/cogs")


@bot.command()
async def test(ctx: dispatch.Context):
    answer = await ctx.ask("Do you like dispatch?")
    print(answer)


bot.run()

Requirements

Contributing and Issues

If you want to contribute or want to suggest additional features please use github issues.

ko-fi

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

dis.patch-0.2.5.tar.gz (17.0 kB view details)

Uploaded Source

Built Distribution

dis.patch-0.2.5-py3-none-any.whl (17.8 kB view details)

Uploaded Python 3

File details

Details for the file dis.patch-0.2.5.tar.gz.

File metadata

  • Download URL: dis.patch-0.2.5.tar.gz
  • Upload date:
  • Size: 17.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.1 Linux/5.4.0-1032-azure

File hashes

Hashes for dis.patch-0.2.5.tar.gz
Algorithm Hash digest
SHA256 9e954d657bee21af990f17864508677cbb925cb9dccb4dc3f903c8a237f13f4f
MD5 6bfa85ee51fa17b4afa4fbf9d387a7cb
BLAKE2b-256 31fa71e5d6a727af6461b4879f07b7fc872e1f0ad375a3ea3671e0a10868ea19

See more details on using hashes here.

File details

Details for the file dis.patch-0.2.5-py3-none-any.whl.

File metadata

  • Download URL: dis.patch-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 17.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.1 Linux/5.4.0-1032-azure

File hashes

Hashes for dis.patch-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 973acb965dd64bd40aecbdc01d0281b676edb0dbcd34c192a28259a5c30eae83
MD5 82c86e09367459b9ded665e08d543107
BLAKE2b-256 90a4227691c7c66cabdeecc14c1c396f9907cd2df6406cf22d771d8ad8f60fb1

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page