Utils

Useful utilities and tools for Discord bot development.

apply_monkey_patches()[source]

Applies all common monkey patches for our bots.

Return type:

None

Patches discord.ext.commands.Command and discord.ext.commands.Group to support root aliases.

A root_aliases keyword argument is added to these two objects, which is a sequence of alias names that will act as top-level groups rather than being aliases of the command’s group.

It’s stored as an attribute also named root_aliases

Patches discord’s internal send_typing method so that it ignores 403 errors from Discord.

When under heavy load Discord has added a CloudFlare worker to this route, which causes 403 errors to be thrown.

unqualify(name)[source]

Return an unqualified name given a qualified module/package name.

Parameters:

name (str) – The module name to unqualify.

Return type:

str

Returns:

The unqualified module name.

Submodules