scarletcafe / jishaku

A debugging and testing cog for discord.py rewrite bots.
https://jishaku.readthedocs.io/en/latest/
MIT License
541 stars 181 forks source link

Add support for multiple scope prefixes #176

Open Soheab opened 2 years ago

Soheab commented 2 years ago

The Problem

Currently you can enable, disable or set the scope prefix to one character but I have seen people want both the _ prefix and without that. Currently to do this you need override the python subcommand in a special cog etc. I think this can all be solved with a couple of lines in the package.

The Ideal Solution

Setting the Flags.SCOPE_PREFIX to a Union[str, Sequence[str], Callable[[Message], str]] essentially the same type as ext.commands.Bot.command_prefix.

Something like this:

import jishaku
jishaku.Flags.SCOPE_PREFIX = ["", "_"]

That will allow users to do: jsk py _author and jsk py author.

The Current Solution

Overriding the python in a cog.

Summary

Allow multiple scope prefixes.