Sebastian Law
9c109ae59b
[commands] Unload cog when command registration fails in _inject
3 years ago
Stocker
0546343bcb
[commands] Add cog-level app command error special method
3 years ago
Rapptz
06c43d6772
[commands] Add support for NSFW commands for hybrid commands
3 years ago
Rapptz
bd3ce597e1
[commands] Fix app command children not being copied in HybridGroup
This degenerate case is only triggered inside cogs when using the
app_command property to define commands, such as this:
class X(commands.Cog):
@commands.hybrid_group()
async def foo(self, ctx):
...
@foo.app_command.command()
async def bar(self, interaction):
...
3 years ago
Rapptz
ccc737eb07
[commands] Add support for with_app_command in hybrid commands
This allows the user to make a text-only command without it registering
as an application command
3 years ago
Rapptz
e8a2eeea06
[commands] Rename Cog.app_command_group to Cog.app_command
This allows it to be consistent with hybrid commands
3 years ago
Rapptz
0551214be1
[commands] Properly set default guilds for group to None instead of []
3 years ago
Rapptz
e873b8294a
[commands] Properly set group parent for hybrid commands in cogs
3 years ago
Rapptz
f4c5d37c8f
[commands] Rework Cog + Group inheritance to requite GroupCog
This is an attempt to fix the MRO issues present in the current
implementation. The previous implementation of using both Cog and
app_commands.Group in the inheritance chain caused issues with things
such as walk_commands due to it potentially shadowing the app_commands
version of the call.
In this particular case it's better to use composition instead of
inheritance to avoid these bugs entirely. Especially as more things are
added that could conflict with each other.
3 years ago
Rapptz
5536ef1eea
Update to pyright 1.1.242
3 years ago
Rapptz
840eb577d4
[commands] Add initial implementation of hybrid commands
Hybrid commands allow a regular command to also double as a slash
command, assuming it meets the subset required to function.
3 years ago
Rapptz
f15f601779
[commands] Check if an application command starts with bot_ or cog_
3 years ago
Bryan Forbes
0a8065606a
Update parent reference of Group children
3 years ago
Rapptz
1192d842e1
Fix some type checker errors and remove some type ignores
Caught from an upgraded Pyright
3 years ago
z03h
e5461c73b6
[commands] Check if any base in a Cog is a subclass of Group
3 years ago
Rapptz
5bc085ebab
Properly set root parent before copying a command's binding
3 years ago
Stocker
5aa696ccfa
Fix typing issues and improve typing completeness across the library
Co-authored-by: Danny <[email protected] >
Co-authored-by: Josh <[email protected] >
3 years ago
Josh
a1c618215e
[commads] Change cog/extension load/unload methods to be async
3 years ago
Rapptz
0ef369c0fa
[commands] Automatically unload top level app commands in extensions
3 years ago
Rapptz
d68f2db7cb
[commands] Always respect guild IDs passed to cog adding and removal
Fixes #7657
3 years ago
Rapptz
9dea6caf20
Ensure cog app commands is a list rather than a dict
There was a remnant of it being a dict in the metaclass.
3 years ago
Rapptz
d210f799ee
[commands] Fix cog eject behaviour with application commands
This was using the old attribute I forgot to change.
3 years ago
Rapptz
446bfa78b0
[commands] Allow Cog and app_commands interopability
This changeset allows app commands defined inside Cog to work as
expected. Likewise, by deriving app_commands.Group and Cog you can
make the cog function as a top level command on Discord.
3 years ago
Josh
eaf94e84bc
Fix unbound ParamSpec to use ... over Any
3 years ago
Josh
147948af9b
Use typing.Self throughout library
3 years ago
mniip
cd1dd7d670
[commands] Properly eject listeners with custom names
3 years ago
Rapptz
88b520b5ab
Reformat code using black
Segments where readability was hampered were fixed by appropriate
format skipping directives. New code should hopefully be black
compatible. The moment they remove the -S option is probably the moment
I stop using black though.
3 years ago
Josh
f3cb197429
[commands][types] Type hint commands-ext
4 years ago
thetimtoy
8675a18185
[commands] Remove unused copy import in Cog
4 years ago
Josh
3864fb37a0
Fix various reference issues in documentation
Co-Authored-By: Riley Shaw <[email protected] >
4 years ago
Rapptz
6d74514729
[commands] Fix logic in Cog.has_error_handler()
4 years ago
Rapptz
9d39b135f4
Modernize code to use f-strings
This also removes the encoding on the top, since Python 3 does it by
default. It also changes some methods to use `yield from`.
4 years ago
Rapptz
4aee7fed5d
[commands] Only remove top level commands on cog load failure
4 years ago
Nadir Chowdhury
63ec23bac2
Code optimisations and refactoring via Sourcery
4 years ago
Rapptz
b9a99238e8
[commands] Add Command/Cog.has_error_handler
This allows querying the state without relying on internal undocumented
attributes.
4 years ago
Nihaal Sangha
69bdc3a184
Change copyright year to present
4 years ago
Rapptz
6ea7fce828
[commands] Cog unload failures are swallowed.
Fix #6113
4 years ago
SebbyLaw
4adbe03d7c
[commands] Allow setting description of cogs
5 years ago
Michael
93fa46713a
Fix and add documentation
5 years ago
Dan Hess
7acec502a6
[commands] Correct command removing during cog injecting
5 years ago
Jaime Garcia Jr
1c3b0c02f8
Add revisions to check_once docs
5 years ago
Jaime Garcia Jr
5813593d6e
Add documentation on bot_check_once
5 years ago
Sebastian Law
b4b953bfc6
Fix various inconsistencies within the documentation ( #5067 )
5 years ago
Xua
4e6942194f
[commands] Document that cog_command_error must be async
5 years ago
Rapptz
6071607176
Bump copyright year to 2020
Closes #2510
5 years ago
NCPlayz
3c9bcc2851
Improve documentation
6 years ago
Rapptz
919dbcafb3
Consistent use of __all__ to prevent merge conflicts.
6 years ago
Rapptz
743a5a218f
[commands] Disallow bot_ or cog_ commands or listeners in cogs.
6 years ago
NCPlayz
fb02191b80
Organise documentation
6 years ago
Rapptz
f43690bde8
[commands] Walk through MRO for Cog derived classes.
This should support cog subclasses in a relatively consistent way in
terms of expectations. Hopefully nothing is broken.
Fixes #1950
6 years ago