This repository was archived by the owner on Feb 3, 2025. It is now read-only.
Commit b584101
committed
Implement command groups
+ Debug logger, gettable with logging.getLogger(discord.ext.status)
* Context now actually has an awaitable constructor by means of _AsyncInit
so no more split between __init__ and _ainit
+ Context.options replaces options parameter in invoke
* Minor fix: Some ext.commands things need Command.cog
* Fix: Fetching member also fails when guild is Object
* Fix: allowed_mentions was ignored if client.allowed_mentions is None
+ Implemented subcommands
* Context updates self.command and self.options down to the command
that is actually executed
* Since groups cannot be executed on their own,
group coros function as checks instead
+ Command.qualname includes group names
+ Command.parent references parent group
+ class Group
+ .slash: MAPPING (not set!) of names to subcommands/subgroups
+ .slash_cmd()(coro), .add_slash, .slash_group, .add_slash_group
* Since the structure of a command actually matches that of
an option almost perfectly, take advantage of that in to_dict
+ slash.group()(coro), SlashBot.slash_group, SlashBot.add_slash_group
* SlashBot.add_slash_cog allows Groups in cogs too
+ Command.check is a decorator that adds a cmd-specific check
+ check can also be passed in init
* Renamed Command.method to coro because method implies a class
+ Option.clone
* Fix: reusing the same Option instance used to set the name for all of them
* Fix: Option.to_dict didn't call Choice.to_dict
+ Choice now supports creating from string or dict too
* Only start listening to slash commands on_ready
- Don't support other interaction data versions
* Directly raise an error, not just dispatch it
* Completely rework register_commands
1. Check with the API what commands are already registered
2. Create commands found in the bot but not in the API
3. Do not re-register commands in the bot that are identical to the API
4. Update commands that differ between both
5. De-register commands found in the API but not in the bot
+demo_bot.py:
+ Example of how to use the library.1 parent 0d776e6 commit b584101
3 files changed
+385
-59
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
3 | 3 | | |
4 | 4 | | |
5 | 5 | | |
| 6 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
0 commit comments