Commit Graph

195 Commits

Author SHA1 Message Date
44a44e938f Reformat entire project with ruff instead of black 2025-08-18 20:16:10 -04:00
983a9b8f94 Use Unpack where it's possible 2025-08-15 05:36:36 -04:00
8953938a53 Update Pyright to v1.1.394 2025-02-18 03:29:09 -05:00
2e2f51fd5c First pass at supporting user apps
Co-authored-by: red <red@kalab.sk>
Co-authored-by: Vioshim <63890837+Vioshim@users.noreply.github.com>
2024-05-04 23:25:01 -04:00
e414d0fe04 [commands] Change default Bot.owner_ids to consider team roles 2023-08-30 20:49:06 -04:00
50078087e5 [commands] Fix variance issues in Bot.add_cog with List[Snowflake] 2022-11-21 01:15:18 -05:00
95b6bd8782 Add coro tag to docstrings that were missing it 2022-10-02 17:52:18 -04:00
6981eb69c4 Normalize type formatting in TypeError
Normalize most mixed usages of `__class__`, `__class__!r`, 
`__class__.__name__!r` to the standard form of 
`__class__.__name__`
2022-09-12 15:25:55 -04:00
54ee383585 [commands] Add warning if Intent.message_content is not enabled 2022-08-17 03:52:29 -04:00
2d586ae805 Add initial support for app command localisation 2022-08-05 22:35:30 -04:00
d0a52f4276 Fix typo and capitalizations in docs 2022-06-19 23:02:53 -04:00
53685b9b86 Change stderr prints to use the logging module instead 2022-06-13 01:06:15 -04:00
5d1b63bfee [docs] Add async with documentation for Client
Co-authored-by: Rapptz <1695103+Rapptz@users.noreply.github.com>
2022-06-12 16:06:44 -04:00
c9f777c873 Fix type annotations to adhere to latest pyright release 2022-06-12 15:30:45 -04:00
6901907b69 [commands] Add seealso directive in functions referencing checks 2022-05-05 06:21:52 -04:00
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
2022-05-05 01:46:19 -04:00
d0667d08e3 [commands] Fix typing of check/check_any
This changes the type information of check decorators to return a
protocol representing that the decorator leaves the underlying object
unchanged while having a .predicate attribute.

resolves #7949
2022-05-02 18:54:49 -04:00
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.
2022-05-01 14:01:21 -04:00
242d3f7ab7 [commands] Add Bot.hybrid_group and Bot.hybrid_command decorators 2022-04-12 21:17:00 -04:00
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.
2022-04-12 20:15:10 -04:00
76cc2c2272 Require passing intents to Client and its subclasses 2022-04-05 22:32:14 -04:00
994660faad [commands] Fix unknown generic type in tree_cls 2022-04-02 05:53:33 -04:00
29668c51ae [commands] Revert back to older help command implementation
The newer implementation did not play nicely with spawned tasks and
accessing HelpCommand.context, which was a frequent pain point when
writing paginated help commands.
2022-03-31 02:46:42 -04:00
06c257760b Update types to use Awaitable where possible 2022-03-30 22:00:24 -04:00
caac97c0d1 Allow empty iterables as a command_prefix 2022-03-30 20:07:44 -04:00
ae1979d17a [commands] Add note for command tree in Bot's docstring 2022-03-28 09:19:27 -04:00
2d1cbacc58 [commands] Add tree_cls to Bot constructor 2022-03-24 22:32:31 -04:00
062f4d6f87 Change some methods to use positional-only marker
Co-authored-by: Danny <Rapptz@users.noreply.github.com>
2022-03-22 18:52:25 -04:00
eca4727593 [commands] Add missing and fix existing type annotations 2022-03-22 06:04:46 -04:00
6dc314628e Make guild and guilds args in Bot.remove_cog() keyword-only 2022-03-20 19:01:37 -04:00
47cb7d03ec [commands] Type BotBase.help_command as Optional 2022-03-14 21:02:36 -04:00
3e70a4e798 Fix typo in add_cog doc 2022-03-14 01:33:34 -04:00
5aa696ccfa Fix typing issues and improve typing completeness across the library
Co-authored-by: Danny <Rapptz@users.noreply.github.com>
Co-authored-by: Josh <josh.ja.butt@gmail.com>
2022-03-13 23:52:10 -04:00
a1c618215e [commads] Change cog/extension load/unload methods to be async 2022-03-13 21:03:45 -04:00
0ef369c0fa [commands] Automatically unload top level app commands in extensions 2022-03-12 09:24:26 -05:00
d68f2db7cb [commands] Always respect guild IDs passed to cog adding and removal
Fixes #7657
2022-03-12 06:58:55 -05:00
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.
2022-03-09 20:26:54 -05:00
bfaee44b1f [commands] Fix types for Bot.is_owner 2022-03-05 22:06:21 -05:00
147948af9b Use typing.Self throughout library 2022-03-01 07:53:24 -05:00
39c5a4fdc3 Fix type-errors in commands extension 2022-02-23 08:04:49 -05:00
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.
2022-02-20 08:04:58 -05:00
4dbe1af32f Update sphinx and fix documentation issues 2022-02-19 22:35:32 -05:00
dc19c6c7d5 Add positional-only arguments in more places 2022-02-19 20:28:01 -05:00
fa5a2188bb Copy docs from Client.close() to Bot.close() 2021-08-20 20:06:51 -04:00
f3cb197429 [commands][types] Type hint commands-ext 2021-08-19 19:51:26 -04:00
c4ee9dcafa [commands] Return removed cog in Bot.remove_cog
The method now returns the removed cog, if it exists.
2021-08-18 00:39:54 -04:00
f56543df15 [commands] Remove function call indirection when checking author 2021-05-25 20:53:44 -04:00
36cf3c94b4 [commands] Remove Bot.self_bot 2021-05-25 20:46:26 -04:00
3864fb37a0 Fix various reference issues in documentation
Co-Authored-By: Riley Shaw <30989490+ShineyDev@users.noreply.github.com>
2021-05-06 07:51:07 -04:00
4134a17a29 [commands] Raise error when a cog name is already registered 2021-04-08 22:04:10 -04:00