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
andAutoShardedBot
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 overwritediscord.py
classes withdispatch
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
- Python >= 3.6
- pydantic
- python-dotenv
- discord.py
Contributing and Issues
If you want to contribute or want to suggest additional features please use github issues.
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)
Built Distribution
dis.patch-0.2.5-py3-none-any.whl
(17.8 kB
view details)
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e954d657bee21af990f17864508677cbb925cb9dccb4dc3f903c8a237f13f4f |
|
MD5 | 6bfa85ee51fa17b4afa4fbf9d387a7cb |
|
BLAKE2b-256 | 31fa71e5d6a727af6461b4879f07b7fc872e1f0ad375a3ea3671e0a10868ea19 |
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
Algorithm | Hash digest | |
---|---|---|
SHA256 | 973acb965dd64bd40aecbdc01d0281b676edb0dbcd34c192a28259a5c30eae83 |
|
MD5 | 82c86e09367459b9ded665e08d543107 |
|
BLAKE2b-256 | 90a4227691c7c66cabdeecc14c1c396f9907cd2df6406cf22d771d8ad8f60fb1 |