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.2.tar.gz (16.9 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

dis.patch-0.2.2-py3-none-any.whl (17.7 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for dis.patch-0.2.2.tar.gz
Algorithm Hash digest
SHA256 d9b7595b4992423208c2c51e1af4d13765d88d1d328d02b87b3c6b2442854fa8
MD5 1ae6dd5edfccaad08c9df4e7f88dd1c3
BLAKE2b-256 3f325562abacefca750db91a413be98bf0e53c4cfa7df6c9085571de23b6448c

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for dis.patch-0.2.2-py3-none-any.whl
Algorithm Hash digest
SHA256 8c96a1bdf39cde63a2ab65457a30715e03448b634781bd4b96954d41dcb86fc1
MD5 960378eabf0b3f1601a4e8c6410091fd
BLAKE2b-256 3530c75d3d1070012e5060d7139abd6714752b4ceaa9b9762169c44f1d66a86a

See more details on using hashes here.

Supported by

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