Commit Graph

3469 Commits

Author SHA1 Message Date
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
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
2aca705b95 Add support for sending messages and managing webhooks in VoiceChannel 2022-04-02 11:14:03 -04:00
b049cf77f2 Add reason to Thread.delete_messages and Thread.purge 2022-04-02 10:36:39 -04:00
994660faad [commands] Fix unknown generic type in tree_cls 2022-04-02 05:53:33 -04:00
0f18d93e47 Remove unused imports 2022-04-02 04:58:39 -04:00
d600436378 [types] Use PEP-655 style Required/NotRequired types 2022-04-02 01:46:10 -04:00
7696342d76 Add missing __slots__ to MessageInteraction 2022-04-02 01:24:56 -04:00
3d914e08e0 [commands] Add Context.current_argument 2022-04-01 16:24:14 -04:00
5c14149873 Fix filename spoiler stripping method
lstrip does not work as expected
2022-04-01 15:25:03 -04:00
e79895d824 Add Message.interaction and MessageInteraction type
Fix #7819
2022-04-01 11:15:15 -04:00
a5f1c2f592 Take into consideration member timeouts in permission calculations 2022-04-01 09:32:54 -04:00
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
c671308211 Validate app command parameter renames 2022-04-01 07:02:37 -04:00
6986733833 Revert "Validate Option names similar to slash command names"
This reverts commit 6ef2043b10.
2022-04-01 06:58:11 -04:00
ca9fd355e8 Fix typo in Guild.bans docstring 2022-04-01 00:26:33 -04:00
9acf1db076 Support ban endpoint pagination 2022-04-01 00:09:02 -04:00
6ef2043b10 Validate Option names similar to slash command names 2022-04-01 00:09:02 -04:00
5096846c4e Allow None to be passed for Member.timeout 2022-04-01 00:09:02 -04:00
24f8f8d4a7 Rename MaxCommandsReached to CommandLimitReached 2022-03-31 23:10:13 -04:00
a0618ef791 Clarify documentation certain tree methods 2022-03-31 10:31:48 -04:00
2010b42f6a [docs] Fix capitalization typo in spoiler parameter documentation 2022-03-31 10:21:08 -04:00
34b2ff40b6 Change ValueError on max commands reached to a more specific exception 2022-03-31 09:34:48 -04:00
c11363f037 Rework File.spoiler to synchronise with the filename
Co-authored-by: Danny <Rapptz@users.noreply.github.com>
2022-03-31 09:18:36 -04:00
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
dfc92c223c Fix application commands not always sending the proper parameter name 2022-03-31 08:55:20 -04:00
170ab7b2bb Improve error when an invalid slash command name is given 2022-03-31 04:12:09 -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
b4fbb08818 Allow runtime modification of timeout expiry at runtime
This is done through setting View.timeout while it's running
2022-03-31 01:54:13 -04:00
e80be19c4d Add to_file for assets and emojis 2022-03-31 01:34:02 -04:00
1372ef407c Keep description in Attachment.to_file 2022-03-31 00:29:34 -04:00
06c257760b Update types to use Awaitable where possible 2022-03-30 22:00:24 -04:00
ff24c5229e Add iterator special method for Namespace
Fix #7812
2022-03-30 21:45:30 -04:00
caac97c0d1 Allow empty iterables as a command_prefix 2022-03-30 20:07:44 -04:00
b1fb5ed3d7 Fix autocomplete not working with renamed parameters
Fix #7810
2022-03-30 19:46:27 -04:00
37bbfdce95 Add context_menu_command Message type 2022-03-30 19:13:00 -04:00
0a8065606a Update parent reference of Group children 2022-03-30 19:12:39 -04:00
e515378076 Remove annotation on row property in subclasses 2022-03-29 23:04:34 -04:00
3215cb65e2 Raise if custom_id is not a str 2022-03-29 23:04:34 -04:00
b7b992375d Add examples for new cooldown checks 2022-03-29 06:02:41 -04:00
55695dab3c [commands] Check for None max_concurrency 2022-03-29 04:49:37 -04:00
4fd2d5fdfd Remove redundant imports and variables 2022-03-29 02:50:34 -04:00
f5acd9e8b6 [commands] Add Command.cooldown property 2022-03-29 02:50:04 -04:00
9f83eb6032 Add application command cooldown decorators
Fix #7790
2022-03-29 00:46:42 -04:00
74b5e0ceb1 Implement some built in checks for app_commands
A lot of these implementations are adapted from the equivalent
ext.commands checks. These only implement the common ones that could
not solely be done by Discord in the future.
2022-03-28 16:36:29 -04:00
8524bfb54d Fix caching of UnionType instead of resolved typing.Union 2022-03-28 16:24:03 -04:00
9012c424bf Replace - with # in # type: ignore comments in rename decorator 2022-03-28 09:28:01 -04:00
ae1979d17a [commands] Add note for command tree in Bot's docstring 2022-03-28 09:19:27 -04:00
c6d0c82d66 Implement app_commands.rename decorator 2022-03-28 05:52:33 -04:00
def035bf9a Remove StoreChannel and any references to it 2022-03-28 00:09:19 -04:00