a debugging and utility extension for discord.py bots
Read the documentation online.
As of the 27th of August 2021, discord.py has ceased development.
Jishaku will continue to be maintained targeting both the PyPI version and the latest git revision as of the archive, until at least the date of the slash command mandate (currently speculated to be around April 2022).
As all trusted contributors have rejected continuing the library, I do not have enough trust in any forks to target those instead. The existing forks are handled by inexperienced developers, and I figure this will continue to be the case in the future, as all of the developers experienced enough to carry the torch do not want to maintain the library for similar reasons to Danny himself.
However, if you personally decide that you wish to use a fork, I will allow Jishaku to honor your decision by removing the
discord.py
package requirement. This means, from now on, installing jishaku will not automatically handle installingdiscord.py
, you must choose a version to use yourself. Any fork that you use must be compatible with the original (in that it supplies thediscord
module and its namespaces).When April 2022 comes, I will make a decision at the time as to whether I want to continue maintaining Jishaku. I still enjoy making and maintaining bots, but implementing Jishaku under the philosophies I have defined so far will likely be impossible under the new slash commands, and I don't really want to compromise my work for the sake of appeasing a company that doesn't care for its developers.
I hope you've found Jishaku useful, and hopefully it will get to live on in one way or another.
jishaku is an extension for bot developers that enables rapid prototyping, experimentation, and debugging of features for bots.
One of jishaku's core philosophies is to be dynamic and easy-to-use. Here's the two step install:
- Download jishaku on the command line using pip:
pip install -U jishaku
- Load the extension in your bot code before it runs:
bot.load_extension('jishaku')That's it!
You can also import the module to use the command development utilities.
The Python commands execute or evaluate Python code passed into them.
It supports simple expressions:
It also supports async expressions:
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:
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 JISHAKU_NO_UNDERSCORE environment variable to true .
Each Python command is individually scoped. That means variables you create won't be retained in later invocations. You can use jishaku retain on to change this behavior and retain variables, and jishaku retain off if you change your mind later.
This command compiles Python code in an asynchronous context, and then disassembles the resulting function into Python bytecode in the style of dis.dis .
This allows you to quickly and easily determine the bytecode that results from a given expression or piece of code. The code itself is not actually executed. |
These commands load, reload, or unload extensions on your bot.
You can reload jishaku itself with jsk reload jishaku .
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
This command gracefully shuts down your bot. 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. |
If you'd like to test the latest versions of jishaku, you can do so by downloading from the git hosts instead of from PyPI.
From GitHub:
pip install -U "jishaku @ git+https://github.com/Gorialis/jishaku@master"
From GitLab:
pip install -U "jishaku @ git+https://gitlab.com/Gorialis/jishaku@master"
Please note that the new 2020 dependency resolver now no longer discounts git package sources from reinstall prevention, which means that if you are installing the jishaku development version multiple times within the same version target you may run into pip just discarding the update.
If you run into such a problem, you can force jishaku to be reinstalled like this:
From GitHub:
pip install -U --force-reinstall "jishaku @ git+https://github.com/Gorialis/jishaku@master"
From GitLab:
pip install -U --force-reinstall "jishaku @ git+https://gitlab.com/Gorialis/jishaku@master"
You must have installed jishaku with one of the commands above before doing this else you will probably end up with a broken installation.
The documentation and this README uses icons from the Material Design Icon library, which is licensed under the Apache License Version 2.0.