4209 Commits

Author SHA1 Message Date
Rapptz
d39f9851a7 Add qualified_name for app_commands 2022-05-01 14:01:21 -04:00
Rapptz
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
PythonCoderAS
fedfe5bec2
Add PartialChannel to list of implementing classes for Messageable 2022-05-01 13:05:07 -04:00
Varun J
0c613148af
[commands] fix signature when displayed_default is missing
This makes it so that passing an empty string (or MISSING) to the 
displayed_default of commands.Parameter not show up as [name=] or [name=...]
2022-05-01 02:48:11 -04:00
Arya
5dd828cdac
Add error decorator to app_commands.Group
Co-authored-by: Danny <Rapptz@users.noreply.github.com>
2022-05-01 02:40:11 -04:00
Rapptz
5e98626d41 Run parent command checks before calling autocomplete callback
Fixes #7969
2022-04-30 19:53:27 -04:00
Rapptz
6ee56fe964 Fix remaining --verifytypes related errors 2022-04-30 19:43:53 -04:00
Rapptz
5536ef1eea Update to pyright 1.1.242 2022-04-30 19:37:01 -04:00
Rapptz
8be103d6bb Install requests in CI 2022-04-30 18:55:45 -04:00
Mikey
165e14063f
[commands] fix BucketType.default bypassing dynamic_cooldown 2022-04-30 18:46:37 -04:00
Narmy
8e9e25246e
Add an example for app_commands.rename()
Co-authored-by: Danny <Rapptz@users.noreply.github.com>
2022-04-30 18:45:17 -04:00
GoogleGenius
61105ce925
Fix minor convention mistakes in basic examples
Co-authored-by: Narmy <67862800+NarmyOnDiscord@users.noreply.github.com>
2022-04-30 18:40:42 -04:00
Narmy
14e83dff0e
Adds two basic context menus for members and messages
Co-authored-by: Danny <Rapptz@users.noreply.github.com>
2022-04-30 09:37:37 -04:00
z03h
58036ceeb8
Fix attribute error for role overwrite auditlog and add threads 2022-04-30 07:54:01 -04:00
Rapptz
0851e03f00 Allow creating a news channel in create_text_channel 2022-04-30 07:12:16 -04:00
invalid-user
20a7961e19
Rename use_slash_commands to use_application_commands
Co-authored-by: Danny <Rapptz@users.noreply.github.com>
2022-04-30 06:53:29 -04:00
gx1285
141c31e50f
Update images used in discord.rst, etc 2022-04-30 06:13:14 -04:00
NextChai
e7ce8b6b77
Add container operations documentation to TextInput 2022-04-30 03:58:11 -04:00
Narmy
d437f494db
Add basic slash command example
Co-authored-by: Danny <Rapptz@users.noreply.github.com>
2022-04-30 03:55:29 -04:00
Rapptz
06df0d7931 Address latest breaking change in creating forum posts 2022-04-29 12:39:12 -04:00
Rapptz
ef20264b1c Allow creating an Intent through a passed integer value 2022-04-29 10:50:22 -04:00
Rapptz
9e3375f3fc Fix infinite recursion in TextChannel.type 2022-04-29 10:00:33 -04:00
Lilly Rose Berner
7ee15e1d68
Use typing.Literal for channel and component type annotation 2022-04-29 06:07:22 -04:00
Bryan Forbes
7fca030107
Add Group class arguments for permissions v2 2022-04-28 20:47:54 -04:00
Shap
71212872d8
Add build folder to .gitignore 2022-04-28 20:47:10 -04:00
zephyrkul
10af1ea255
Document behavior for empty default permissions 2022-04-28 12:54:55 -04:00
Rapptz
a0dfdb9b1d Fix multiple view instances not dispatching in app commands responses
Due to a quirk in InteractionResponse.send_message not returning a
message, all messages sent with an associated View would end up having
no message_id set. When multiple instances of a View are responded to
in a slash command context, this meant that the newest one would
override the storage of the older one. Ultimately leading to the first
view instance causing interaction failures.

Since fetching the original message is an unacceptable solution to the
problem due to incurred requests, the next best thing is to store an
intermediate interaction_id as a stop gap to differentiate between
the multiple instances. This change however, came with its own set of
complications.

Due to the interaction_id being an intermediate stop gap, the
underlying storage of the view store had to be changed to accommodate
the different way of accessing the data. Mainly, the interaction_id
key had to be quick to swap and remove to another key. This solution
attempts to change the interaction_id interim key with
a full fledged message_id key when it receives one if it's possible.

Note that the only way to obtain the interaction_id back from the
component interaction is to retrieve it from the MessageInteraction
data structure. This is because using the interaction_id of the button
press would be a different interaction ID than the one set as an
interim key. As a consequence, this stop gap only works for application
command based interactions. I am not aware of this bug manifesting in
component based interactions.

This patch also fixes a bug with ViewStore.remove_view not working due
to a bug being suppressed by a type: ignore comment. It also removes
the older __verify_integrity helper method since clean-up is already
done through View.stop() or View timeout.

Hopefully in the near future, the `/callback` endpoint will return
actual message data and this stop gap fix will no longer be necessary.
2022-04-28 12:24:57 -04:00
Rapptz
e53daaba35 Properly namespace MISSING in the documentation 2022-04-28 10:56:31 -04:00
Rapptz
204f941e96 Display permissions v2 decorators in the documentation 2022-04-28 10:50:00 -04:00
Rapptz
ab64a2eae9 Fix typing of guilds kwargs to take Sequence instead of List 2022-04-28 10:48:57 -04:00
Rapptz
acd4a0856e Add Interaction.extras for extraneous data 2022-04-28 07:59:43 -04:00
Rapptz
500bf77103 Document and export MISSING sentinel 2022-04-28 07:52:23 -04:00
Rapptz
a14b43f2fd Fix documentation links being broken 2022-04-28 00:53:51 -04:00
Rapptz
3b3d4d3880 Add support for setting and receiving permissions v2
Closes #7592

This does not include audit log changes or the remaining endpoints.
That will come in a different commit.
2022-04-28 00:23:36 -04:00
Adwaith
b678effb76
Add intents parameter to basic example 2022-04-27 22:13:05 -04:00
Lilly Rose Berner
6e2cfff2ac
Add raw member remove event 2022-04-27 22:08:04 -04:00
Rapptz
e198a0e7e6 Avoid re-creating View children on edit
The older code attempted to be clever and sync component additions and
removals with what the message edit is doing. In some cases, this led
to the re-creation of those components causing lost attributes to be
dropped such as `_rendered_row` which would mess up handling of view
weights.

Instead of recreating the children list every time and keeping track
of additions and removals, this change just updates the old state with
the new state while ignoring any new or removed additions. This should
work fine in theory due to additions or removals already being present
before editing the View instance in the first place.

Closes #7231 #7511
2022-04-27 01:24:10 -04:00
Mikey
da9abca74d
Remove text about intents being optional 2022-04-27 00:47:44 -04:00
killakej
5c2431d543
Update api.rst documentation to add timeout to on_member_update
Co-authored-by: Danny <Rapptz@users.noreply.github.com>
2022-04-26 08:50:40 -04:00
Lilly Rose Berner
5a06fa5f3e
Give large guilds more time to chunk before timing out 2022-04-25 13:00:14 -04:00
Alex Nørgaard
6d95ed19b0
Add interited members to WebhookMessage docs 2022-04-25 02:02:07 -04:00
Lilly Rose Berner
2dbf14bb72
Separately delay ready event for each shard 2022-04-25 02:01:46 -04:00
Harshal Laheri
89eb86ecdc
Add return type for __init__ 2022-04-25 02:00:27 -04:00
Lilly Rose Berner
277d35c9b2
Add raw typing event and fix typing event not working for DMs 2022-04-23 22:25:07 -04:00
will
e5f3706c02
Fix typo and commas consistency in Activity doc 2022-04-23 22:24:35 -04:00
Rapptz
69b12b97c0 Sync abc.User protocol with more shared methods
This isn't *all* of them but it's a sizeable portion
2022-04-23 03:00:46 -04:00
Rapptz
f045b7d63c Fix BanEntry not being exported despite being documented 2022-04-23 01:53:21 -04:00
Lilly Rose Berner
08844985cc
Fix Client.fetch_guilds not working correctly, increase default limit 2022-04-22 22:31:33 -04:00
Lilly Rose Berner
efe24c3927
Support dynamic rich presence asset URLs 2022-04-22 20:28:45 -04:00
Lilly Rose Berner
69595b5826
Fix activity button type 2022-04-22 20:22:00 -04:00