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 hashes)

Uploaded Source

Built Distribution

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

Uploaded Python 3

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