Rapptz
ab33551553
Fix type hints on GuildChannel.set_permissions
2022-04-22 04:50:10 -04:00
Rapptz
832d2c0542
[commands] Fix certain annotations being allowed in hybrid commands
...
Union types were not properly constrained and callable types were
too eagerly being converted
2022-04-21 04:13:32 -04:00
Rapptz
405c445093
[commands] Unwrap transformers when considering them as converters
2022-04-21 03:19:11 -04:00
Rapptz
5357b9319b
[commands] Ignore delete_after for ephemeral interaction sends
2022-04-21 02:07:37 -04:00
Rapptz
de941ababe
Add Colour.from_str factory method
...
This moves the command extension parsing code over to the main library
since it can be potentially useful for others.
2022-04-20 06:49:28 -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
1d97a35385
[commands] Fix hybrid commands not respecting default annotations
2022-04-19 12:08:22 -04:00
Rapptz
987235d564
Only call async setup if the loop sentinel hasn't been changed
2022-04-19 04:27:52 -04:00
Rapptz
6113f856b6
[commands] Dispatch command events for hybrid commands
2022-04-19 01:40:16 -04:00
Rapptz
2e02f618f0
Add support for enum values that aren't int, str, or float
...
This coerces them into string options to allow them to be transformed
in the actual code.
2022-04-18 20:15:45 -04:00
Rapptz
2b3cc8fe10
Add Member.display_icon to get the rendered member icon
2022-04-18 17:26:30 -04:00
Rapptz
80aa45ed31
[commands] Skip ws before processing arguments in Greedy transformer
2022-04-15 03:21:36 -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
9ff90d7863
Copy internal attributes for command decorator state
...
This allows for copies to not clear the state the decorators had
set prior.
2022-04-14 17:45:27 -04:00
Rapptz
e541be0427
Fix tests from failing
2022-04-14 06:46:33 -04:00
Rapptz
bc07a02f68
[commands] Fix type hints for hybrid command decorators
2022-04-14 05:14:48 -04:00
Rapptz
4951231a7c
Remove command parameter from Group.on_error callback
...
Similar to the CommandTree.on_error removal, this one can be retrieved
using Interaction.command
2022-04-13 22:45:06 -04:00
Rapptz
ce15df4275
[commands] Allow commands.Range inside typing.Union or typing.Optional
2022-04-13 22:43:11 -04:00
Rapptz
cdf442bc32
Fix signature detection in CommandTree.error decorator
2022-04-13 22:30:39 -04:00
Rapptz
3f4fb91328
Change CommandTree.on_error to only take two parameters
...
The command that failed can be retrieved using Interaction.command
so having it as a parameter doesn't make much sense.
2022-04-13 22:29:27 -04:00
Rapptz
83fae4f0fa
Add CommandTree.clear_commands
2022-04-13 22:20:05 -04:00
Rapptz
8a1800bd12
[commands] Add support for setting a fallback slash subcommand
...
This allows the group callback to be invoked as a slash subcommand
2022-04-13 20:30:11 -04:00
Rapptz
e9ff6b4be8
[commands] Fix broken documentation references
2022-04-13 18:49:39 -04:00
Rapptz
5c61f2af48
[commands] Add ForumChannelConverter to the converter mapping
2022-04-13 17:45:54 -04:00
Rapptz
141d9f4c71
[commands] Add ForumChannelConverter converter
2022-04-13 17:44:03 -04:00
Rapptz
d98ee567d4
Add Guild.forums property
...
Ran an informal poll in the official server and this name won over the
alternative Guild.forum_channels property name
2022-04-13 17:40:16 -04:00
Rapptz
7a52aa3764
[commands] Force HybridGroup to always have invoke_without_command
2022-04-13 17:14:21 -04:00
Rapptz
49f330b4a3
Fix Thread.jump_url docstring
2022-04-13 17:12:44 -04:00
Rapptz
b476757720
[commands] Fix type hints for checks, hooks, and error handlers
2022-04-13 03:07:58 -04:00
Rapptz
737ff5beaf
Update Pyright to 1.1.237
2022-04-13 02:30:00 -04:00
Rapptz
242d3f7ab7
[commands] Add Bot.hybrid_group and Bot.hybrid_command decorators
2022-04-12 21:17:00 -04:00
Rapptz
daa32e3463
Use pyright CI action and remove --verbose from black
2022-04-12 20:51:02 -04:00
Rapptz
1931b0eb75
[commands] Ensure hybrid app command receives copied wrapper command
2022-04-12 20:15:11 -04:00
Rapptz
393fdde037
[commands] Add support for Greedy for hybrid commands
2022-04-12 20:15:11 -04:00
Rapptz
1004cf2059
[commands] Unconditionally replace default if it's set
...
Handles degenerate `x: int = commands.param(default=10)` case
2022-04-12 20:15:11 -04:00
Rapptz
70d2522e7e
[commands] Unwrap CommandInvokeError if the cause is CommandError
2022-04-12 20:15:11 -04:00
Rapptz
3bb4d3bd6d
Allow internal library enums to be used as an annotation
2022-04-12 20:15:11 -04:00
Rapptz
65418414ea
[commands] Refactor parameter replacement to be less brittle
...
If a parameter works as-is as a transformer or a built-in then it
will always be taken rather. This way, the custom behaviour is done
as a fallback in case it doesn't work natively with app commands.
This also allows things that are hybrid transformers and converters
to work transparently.
2022-04-12 20:15:11 -04:00
Rapptz
896932faf1
[commands] Add Range converter
...
This allows hybrid commands to also have a range annotation
2022-04-12 20:15:11 -04:00
Rapptz
3c4b22b623
[commands] Fix transformers no longer working as annotation
2022-04-12 20:15:10 -04:00
Rapptz
9d05f55ddb
[commands] Fix Optional handling when the inner type is a converter
2022-04-12 20:15:10 -04:00
Rapptz
f072edfdfc
[commands] Properly support commands.param in hybrid commands
2022-04-12 20:15:10 -04:00
Rapptz
fa3a4c109b
[commands] Fix Context.reply not working for hybrid commands
2022-04-12 20:15:10 -04:00
Rapptz
d61561f2e8
[commands] Add support for autocomplete for hybrid commands
2022-04-12 20:15:10 -04:00
Rapptz
52fcaed79b
[commands] Reassign app_command attribute on copy
...
Prior to this change it would re-create the HybridAppCommand on copy
which had the consequence of clearing parameter related changes.
2022-04-12 20:15:10 -04:00
Rapptz
1232a1d2fd
[commands] Properly call after_hooks in 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
Rapptz
c568ed8cdc
Pin Pyright to 1.1.235
2022-04-10 22:49:30 -04:00
Rapptz
29d4c26466
Upgrade WebhookMessage.channel to Thread if available
2022-04-10 18:15:02 -04:00
Rapptz
538ba0d076
Update Webhook.channel typing to include VoiceChannel as well
2022-04-10 18:11:44 -04:00
Rapptz
c284145f18
Add and remove some versionadded directives
2022-04-10 17:12:56 -04:00
Rapptz
6a49dfcc0f
Fix crash with WEBHOOKS_UPDATE channel_id being nullable
2022-04-10 03:47:03 -04:00
Rapptz
30cc00c9a4
Explicitly specify public threads when creating them in forums
...
The endpoint seems to fail otherwise
2022-04-06 23:27:27 -04:00
Rapptz
a8b26b9257
Allow pinning a thread using Thread.edit
2022-04-06 23:21:17 -04:00
Rapptz
92eb9d7d8e
Fix documentation for ChannelFlags.pinned
2022-04-06 23:06:58 -04:00
Rapptz
67a58d10ae
Change Fetch -> Retrieve for last_message documentation
2022-04-06 23:02:58 -04:00
Rapptz
23f6876492
Add initial support for forum channels
...
Closes #7652
2022-04-06 23:02:58 -04:00
Rapptz
f07885973f
Provide callback name where applicable in validation
...
Fix #7850
2022-04-06 08:57:04 -04:00
Rapptz
abeea73734
Fix remaining things not explicitly passing the intents kwarg
2022-04-05 23:15:40 -04:00
Rapptz
b32b78de45
[commands] Fix missing or inferred type hints in parameters.py
2022-04-05 22:47:21 -04:00
Rapptz
76cc2c2272
Require passing intents to Client and its subclasses
2022-04-05 22:32:14 -04:00
Rapptz
c68ea67213
Properly handle inheritance overriding in View subclasses
2022-04-05 09:41:48 -04:00
Rapptz
629f36e7d7
[commands] Add fallback behaviour to the default parameter instances
...
This allows users to explicitly override the default annotation for
CurrentAuthor and CurrentChannel since they're wider than what most
users would expect
2022-04-05 06:40:31 -04:00
Rapptz
f15f601779
[commands] Check if an application command starts with bot_ or cog_
2022-04-05 06:06:35 -04:00
Rapptz
b823a4bab1
[commands] Only update annotation if an explicit override is given
2022-04-05 06:02:28 -04:00
Rapptz
c582940401
Remove ancient IDENTIFY key that is no longer used
2022-04-05 05:22:00 -04:00
Rapptz
dbcdf69eb1
[commands] Raise appropriate exception for no guild found
2022-04-04 21:49:11 -04:00
Rapptz
8b50ac8a31
[commands] Don't set a converter for the defaults provided
2022-04-04 21:47:03 -04:00
Rapptz
66155faf00
[commands] Fix documentation not being properly formatted
2022-04-04 18:10:43 -04:00
Rapptz
b561024163
Fix WebhookState not handling reaction emoji
...
Fix #7842
2022-04-04 00:49:36 -04:00
Rapptz
907d5e0ee7
Document Forbidden exception in CommandTree.sync
2022-04-03 22:57:54 -04:00
Rapptz
1458251736
Change View.children to be a property
...
This allows users to call remove_item in a loop. Likewise, it prevents
the footgun of doing children.append(...) which does not uphold the
invariants with the weight system.
2022-04-03 20:13:42 -04:00
Rapptz
58db635229
Fix parameter validation in Guild.query_members
2022-04-03 08:07:01 -04:00
Rapptz
3ef8f77e81
Add proper nsfw support for vocal guild channels
2022-04-03 07:50:10 -04:00
Rapptz
298bd7492c
Run pyright as part of the CI process
...
This doesn't do verifytypes yet due to a bug in Pyright
2022-04-02 11:47:34 -04:00
Rapptz
52e16573f5
Remove unused imports and make exports explicit
...
This allows Pyright to actually catch these errors, which would be
useful for CI purposes in the future.
2022-04-02 11:38:39 -04:00
Rapptz
f7a79ff8d7
Avoid calling PartialMessage.__init__ in Message.__init__
...
This prevents Message creation from crashing due to the public
interface's type checks potentially breaking future compatibility.
2022-04-02 11:15:54 -04:00
Rapptz
2aca705b95
Add support for sending messages and managing webhooks in VoiceChannel
2022-04-02 11:14:03 -04:00
Rapptz
b049cf77f2
Add reason to Thread.delete_messages and Thread.purge
2022-04-02 10:36:39 -04:00
Rapptz
994660faad
[commands] Fix unknown generic type in tree_cls
2022-04-02 05:53:33 -04:00
Rapptz
7696342d76
Add missing __slots__ to MessageInteraction
2022-04-02 01:24:56 -04:00
Rapptz
5c14149873
Fix filename spoiler stripping method
...
lstrip does not work as expected
2022-04-01 15:25:03 -04:00
Rapptz
f47568ee71
Document Guild.bans breaking change in the migrating guide
2022-04-01 11:47:27 -04:00
Rapptz
e79895d824
Add Message.interaction and MessageInteraction type
...
Fix #7819
2022-04-01 11:15:15 -04:00
Rapptz
a5f1c2f592
Take into consideration member timeouts in permission calculations
2022-04-01 09:32:54 -04:00
Rapptz
25ad5b675c
Ensure explicitly set parents on nested groups are respected
...
This had a multiple layer bug that needed to be squashed. The first
issue was that setting `parent=...` inside a `Group` wouldn't actually
add the `Group` into the `parent` children mapping. This meant that
it didn't actually end up copying the children when it came time to
within e.g. a Cog.
The second issue was that even if it was added into the children
listing, it wouldn't properly set the attribute.
This commit fixes both of these issues.
Fix #7818
2022-04-01 09:13:27 -04:00
Rapptz
c671308211
Validate app command parameter renames
2022-04-01 07:02:37 -04:00
Rapptz
6986733833
Revert "Validate Option names similar to slash command names"
...
This reverts commit 6ef2043b10 .
2022-04-01 06:58:11 -04:00
Rapptz
ca9fd355e8
Fix typo in Guild.bans docstring
2022-04-01 00:26:33 -04:00
Rapptz
9acf1db076
Support ban endpoint pagination
2022-04-01 00:09:02 -04:00
Rapptz
6ef2043b10
Validate Option names similar to slash command names
2022-04-01 00:09:02 -04:00
Rapptz
5096846c4e
Allow None to be passed for Member.timeout
2022-04-01 00:09:02 -04:00
Rapptz
24f8f8d4a7
Rename MaxCommandsReached to CommandLimitReached
2022-03-31 23:10:13 -04:00
Rapptz
a0618ef791
Clarify documentation certain tree methods
2022-03-31 10:31:48 -04:00
Rapptz
34b2ff40b6
Change ValueError on max commands reached to a more specific exception
2022-03-31 09:34:48 -04:00
Rapptz
705c79df59
Remove second mapping used for parameter rename lookup
...
Just keying into param.display_name should be enough
2022-03-31 08:58:53 -04:00
Rapptz
dfc92c223c
Fix application commands not always sending the proper parameter name
2022-03-31 08:55:20 -04:00
Rapptz
170ab7b2bb
Improve error when an invalid slash command name is given
2022-03-31 04:12:09 -04:00