63 Commits

Author SHA1 Message Date
Josh
c9f777c873
Fix type annotations to adhere to latest pyright release 2022-06-12 15:30:45 -04:00
xCirno
6901907b69
[commands] Add seealso directive in functions referencing checks 2022-05-05 06:21:52 -04:00
Michael H
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
Rapptz
737ff5beaf Update Pyright to 1.1.237 2022-04-13 02:30:00 -04:00
James Hilton-Balfe
55c5be78cf
[commands] Implement commands.parameter 2022-04-04 18:01:21 -04:00
Rapptz
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
Bryan Forbes
06c257760b
Update types to use Awaitable where possible 2022-03-30 22:00:24 -04:00
jack1142
5ffa3e85de
Update comments after # type: ignore to be compatible with PEP 484 2022-03-27 22:26:34 -04:00
Bryan Forbes
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
Stocker
eca4727593
[commands] Add missing and fix existing type annotations 2022-03-22 06:04:46 -04:00
Josh
46b3e036e2
[commands] Fix help error/invoke hooks not running 2022-03-22 06:02:52 -04:00
Josh
1b70fad5ec
[commands] Fix exceptions in HelpCommand 2022-03-19 13:14:17 -04:00
Josh
fafc5b13f6
[commands] Rework help command to avoid a deepcopy on invoke 2022-03-19 06:34:19 -04:00
Stocker
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
Neon Jonn
adb69e7157
Fix some spelling mistakes 2022-03-10 20:45:16 -05:00
Stocker
13355f3712
Fix HelpCommand.invoked_with raising an error
This would happen if the context hasn't been set yet.
2022-03-06 23:02:01 -05:00
Rapptz
625c416f18 [commands] Fix command parameter handling in HelpCommand 2022-03-06 01:39:43 -05:00
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.
2022-02-20 08:04:58 -05:00
jack1142
dc19c6c7d5
Add positional-only arguments in more places 2022-02-19 20:28:01 -05:00
Rapptz
2d8f299b6b Use MISSING instead of None for HelpCommand.context
It's basically just late-init
2021-08-25 09:53:55 -04:00
Josh
f3cb197429
[commands][types] Type hint commands-ext 2021-08-19 19:51:26 -04:00
Josh
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
Stella
91c473db57
[commands] Fix _HelpCommandImpl.clean_params popitem 2021-04-23 02:24:09 -04:00
Kino
0c1c9284f6
Fix typo within HelpCommand.verify_checks documentation 2021-04-21 00:18:32 -04:00
pikaninja
ffea48f218
[commands] Remove HelpCommand.clean_prefix (#6736) 2021-04-15 21:28:08 -04:00
Kreusada
af5964358d
[commands] Strip text to remove spaces before ellipsis 2021-04-11 15:19:45 -04:00
Rapptz
99fc950510 Use f-strings in more places that were missed. 2021-04-08 06:02:47 -04:00
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`.
2021-04-04 07:03:53 -04:00
Rapptz
c4c2cbf6d2 [commands] Remove nullability from help command implementation
Fixes #5154
2021-03-28 18:51:58 -04:00
jack1142
caa3b4e8f4
[commands] Include group args in command signature 2021-03-24 08:16:23 -04:00
sudosnok
01d8502c83
[commands] Added tribool behaviour to HelpCommand.verify_checks 2021-02-24 05:40:35 -05:00
PikalaxALT
b7c7200f4d
[commands] Add linesep kwarg to Paginator 2021-01-17 00:15:36 -05:00
Alex Nørgaard
c72dbf28ba
[commands] Fix Command duplicates in HelpCommand.get_bot_mapping 2021-01-16 05:36:08 -05:00
Nihaal Sangha
69bdc3a184
Change copyright year to present 2021-01-15 05:28:11 -05:00
Michael
93fa46713a
Fix and add documentation 2020-09-23 03:19:35 -04:00
Riley S
ad22fb295e
[commands] implement HelpCommand.add/remove_check 2020-08-05 21:38:58 -04:00
Sebastian Law
b4b953bfc6
Fix various inconsistencies within the documentation (#5067) 2020-06-28 03:45:58 -04:00
jack1142
79276da17e Escape backslashes in display name in clean_prefix 2020-05-07 02:30:24 -04:00
Rapptz
6071607176 Bump copyright year to 2020
Closes #2510
2020-01-19 20:03:00 -05:00
Michael H
6cdda4a320 Patch clean_prefix for new text editor
The new editor seems to force mentions to have ! even without a nick.
2020-01-14 19:39:34 -05:00
StarrFox
e79ccf3f4c [commands] check if prefix is None in .pages 2019-12-17 00:12:42 -05:00
Nelluk
dc86670d7f Fix typo in help.py docs
Changed "intend" to "indent"
2019-11-26 05:16:53 -05:00
Rapptz
d4b13bd32b [commands] Fix up Paginator documentation.
These aren't optional.
2019-06-29 20:29:13 -04:00
Matt (IPv4) Cowley
391ff7a486 [commands] Calculate suffix length at each add_line 2019-06-29 20:28:32 -04:00
Harmon
94c0cb0d5c [commands] Add missing word in HelpCommand documentation 2019-06-20 22:52:47 -04:00
NCPlayz
3c9bcc2851 Improve documentation 2019-06-07 19:27:46 -04:00
Benjamin Mintz
0a0c43321b [commands] MinimalHelpCommand: add cog description 2019-05-09 06:11:21 -04:00
Rapptz
ad5beed8dd [commands] Copy HelpCommand instances to prevent race conditions.
Fixes #2123

Slight breaking change if someone had an expectation that no copies
were made behind the scene (which is sensible), however writing code
that relies on this expectation is probably buggy anyway.
2019-04-29 00:05:46 -04:00
Rapptz
919dbcafb3 Consistent use of __all__ to prevent merge conflicts. 2019-04-20 17:20:58 -04:00
Rapptz
4ca934eb22 [commands] Missing an extra ] in the documented return type. 2019-04-19 18:29:12 -04:00