86 Commits

Author SHA1 Message Date
Rapptz
6ab6b2cb96 [commands] Fix Context.from_interaction ignoring command_failed 2022-08-30 05:08:11 -04:00
Rapptz
9ce1541775 Rename Interaction.original_message to original_response 2022-08-08 08:11:19 -04:00
zephyrkul
9fe19dcc69
[commands] Add Context.permissions and Context.bot_permissions 2022-07-04 21:48:36 -04:00
Josh
c9f777c873
Fix type annotations to adhere to latest pyright release 2022-06-12 15:30:45 -04:00
Rapptz
36f039a1bf [commands] Fix interaction baton not being set during Context creation 2022-05-30 08:50:19 -04:00
Rapptz
3dddddc8f9 [commands] Change Context.typing to defer for interaction contexts 2022-05-22 21:49:27 -04:00
Var
7b65be9d25
[commands] Fix broken None reference
Co-authored-by: Danny <Rapptz@users.noreply.github.com>
2022-05-04 23:34:49 -04:00
Rapptz
8699d2139a Improve generic duck type programming with PartialMessageable
This adds jump_url, permissions_for, and created_at. Luckily, most
cases of this type being constructed already have the guild_id at
creation time.
2022-05-03 10:49:52 -04:00
Rapptz
5357b9319b [commands] Ignore delete_after for ephemeral interaction sends 2022-04-21 02:07:37 -04:00
Rapptz
84e6b9283d [commands] Fix delete_after not working with interaction Context.send 2022-04-19 22:14:11 -04:00
Rapptz
cd0d6749ea [commands] Fix Context.reply not working with expired interactions 2022-04-19 22:09:53 -04:00
Rapptz
4fb1309e2a [commands] Mock interaction context prefix
Most user-level code probably expects the prefix to be valid and not
None, so mocking it to ensure it's at least a string is probably for
the best.
2022-04-14 19:12:16 -04:00
Rapptz
fa3a4c109b [commands] Fix Context.reply not working for hybrid commands 2022-04-12 20:15:10 -04:00
Rapptz
c1892131a6 [commands] Fix Context docstring missing Interaction ref 2022-04-12 20:15:10 -04:00
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.
2022-04-12 20:15:10 -04:00
James Hilton-Balfe
55c5be78cf
[commands] Implement commands.parameter 2022-04-04 18:01:21 -04:00
Kellen
0f18d93e47
Remove unused imports 2022-04-02 04:58:39 -04:00
jack1142
3d914e08e0
[commands] Add Context.current_argument 2022-04-01 16:24:14 -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
Josh
fafc5b13f6
[commands] Rework help command to avoid a deepcopy on invoke 2022-03-19 06:34:19 -04:00
Rapptz
1192d842e1 Fix some type checker errors and remove some type ignores
Caught from an upgraded Pyright
2022-03-16 01:46:58 -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
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
ShashankKumarSaxena
b2ac327bd8
[commands] Fix a small typo in Context.invoke docs 2021-08-27 16:02:10 -04:00
Josh
f3cb197429
[commands][types] Type hint commands-ext 2021-08-19 19:51:26 -04:00
Nadir Chowdhury
757cfad38f
Type up **kwargs of various methods 2021-05-10 20:24:48 -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
Rapptz
09f3f2111c [commands] Add Context.current_parameter 2021-04-19 04:41:32 -04:00
Nadir Chowdhury
5ea5f32479
[commands] Fix missing re import in Context 2021-04-15 08:04:24 -04:00
MrKomodoDragon
ed3c141f5e
[commands] Add clean_prefix attribute to commands.Context 2021-04-14 22:09:40 -04:00
Nadir Chowdhury
89456022cf
Add __all__ to remaining modules 2021-04-07 02:30:32 -04:00
Rapptz
adaf7c6192 [commands] Use positional only parameter for Context.invoke 2021-04-04 07:04:01 -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
Sebastian Law
d6501159e7
[docs] copy signature from overridden and inherited methods 2021-03-29 23:52:14 -04:00
Sebastian Law
a30a694e36
[commands] fix Context.channel property documented type 2021-03-13 01:46:31 -05:00
Nadir Chowdhury
63ec23bac2
Code optimisations and refactoring via Sourcery 2021-02-24 21:26:51 -05:00
Nadir Chowdhury
e090ee4308
Fix NameError with invoked_parents 2021-02-24 21:15:10 -05:00
Sebastian Law
48b748e340 [commands] properly assign ctx.invoked_with with ctx.
resolves #6461
2021-02-23 03:39:08 -05:00
Sebastian Law
1afc127458 [commands] Add Context.invoked_parents 2021-02-23 03:39:08 -05:00
Jonas Bohmann
0d8ac41551 [commands] Fix documented type of Context.cog 2021-01-24 05:17:47 -05:00
Nihaal Sangha
69bdc3a184
Change copyright year to present 2021-01-15 05:28:11 -05:00
PikalaxALT
d1cb30cccf
Implement discord.Message.reply 2020-11-26 23:19:00 -05:00
Rapptz
0b93fa3a82 Implement VoiceProtocol lower level hooks.
This allows changing the connect flow and taking control of it without
relying on internal events or tricks.
2020-09-23 03:20:35 -04:00
SebbyLaw
b43658f6ff [commands] Add documentation for exceptions in Context.(re)invoke 2020-07-22 23:18:30 -04:00
Sebastian Law
b4b953bfc6
Fix various inconsistencies within the documentation (#5067) 2020-06-28 03:45:58 -04:00
Rapptz
6071607176 Bump copyright year to 2020
Closes #2510
2020-01-19 20:03:00 -05:00
Rapptz
97d1c970bf [commands] Context.send_help properly sends to on_help_command_error 2020-01-18 19:43:20 -05:00
NCPlayz
3c9bcc2851 Improve documentation 2019-06-07 19:27:46 -04:00
Rapptz
bdea50e1db [commands] Better note for Command.invoke 2019-05-05 03:15:38 -04:00