Skip to main content

discord is discord.py bot debug tools

Project description

This module is built on top of Jishaku.

  1. Download jishaku
pip install -U "jishaku @ git+https://github.com/Gorialis/jishaku@master"

udo is an extension for bot developers that enables rapid prototyping, experimentation, and debugging of features for bots.

One of udo's core philosophies is to be dynamic and easy-to-use. Here's the two step install:

  1. Download udo on the command line using pip:
pip install -U udo
  1. Load the extension in your bot code before it runs:
bot.load_extension('udo')
# or
await bot.load_extension('udo')

That's it!

You can also import the module to use the command development utilities.

Command reference

> udo [py|python] <argument>

The Python commands execute or evaluate Python code passed into them. It supports simple expressions:

> udo py 3+4

Beep Bot

7

It also supports async expressions:

> udo py await _ctx.pins()

Beep Bot

[<Message id=123456789012345678 ...>, ...]

You can pass in codeblocks for longer blocks of code to execute, and you can use yield to return intermediate results within your processing.

The inspect variant of the command will return a codeblock with detailed inspection information on all objects returned.

The variables available by default in all execution contexts are:

_ctx The Context that invoked the command.
_bot The running Bot instance.
_author
_channel
_guild
_me
_message
_msg
Shortcuts for attributes on _ctx.
_find
_get
Shortcuts for discord.utils functions.

The underscore prefix on the provided variables is intended to help prevent shadowing when writing large blocks of code within the command.
If you decide that you don't want the prefix, you can disable it by setting the udo_NO_UNDERSCORE environment variable to true.

Each Python command is individually scoped. That means variables you create won't be retained in later invocations.

> udo [sh|shell] <argument>

The shell command executes commands within your system shell.

If you're on Linux and are using a custom shell, udo will obey the SHELL environment variable, otherwise, it will use /bin/bash.
On Windows, udo will use PowerShell if it's detected, otherwise, it will use Command Prompt.

> udo [load|reload] [extensions...]

> udo unload [extensions...]

These commands load, reload, or unload extensions on your bot.

You can reload udo itself with jsk reload udo.
jsk reload ~ will reload all extensions on your bot.

You can load, reload, or unload multiple extensions at once: jsk reload cogs.one cogs.two

> udo shutdown

This command gracefully shuts down your bot.

> udo rtt

This command calculates Round-Trip Time for your bot to the API. It does this by calculating response time samples, so you can tell if your bot is being slow or not.

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

udo_py-1.0.1.tar.gz (36.4 kB view details)

Uploaded Source

Built Distribution

udo.py-1.0.1-py3-none-any.whl (42.5 kB view details)

Uploaded Python 3

File details

Details for the file udo_py-1.0.1.tar.gz.

File metadata

  • Download URL: udo_py-1.0.1.tar.gz
  • Upload date:
  • Size: 36.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for udo_py-1.0.1.tar.gz
Algorithm Hash digest
SHA256 dd3b419055eecbb8d5b1ab6e570080608c89d3b8c233f413d6cc4b1af328ce53
MD5 f670765ef15f85f9811d981795ff83dd
BLAKE2b-256 e8174d22daa817225860491f92bed0d7b05cebf600771b86e1609b76bbd5b1cd

See more details on using hashes here.

File details

Details for the file udo.py-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: udo.py-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 42.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.12.4

File hashes

Hashes for udo.py-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 b8c4556fba5fec64001c28b1f126605182cb2ef43fb95314840a2196e9fbfec4
MD5 54eea82e4d8c475440d3f9b9b960f4cb
BLAKE2b-256 1522790346147e009c08ba8cb2c641cb82473120c8ae0a508995e294dddb4038

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