286 Commits

Author SHA1 Message Date
Nadir Chowdhury
63974ec46d
Add discovery_splash and community field to Guild.edit 2021-05-05 07:30:54 -04:00
Nadir Chowdhury
e762f55847
Add fetch_invite with with_expiration 2021-05-01 07:46:16 -04:00
Joey van Langen
4fcbe75d3b
Fix guild application command endpoints 2021-05-01 07:44:23 -04:00
Nadir Chowdhury
b705173676
Add types for ApplicationCommandPermissions & co 2021-05-01 06:46:26 -04:00
z03h
304229071f
Add VoiceChannel.video_quality_mode 2021-04-17 08:10:41 -04:00
Nadir Chowdhury
57dbb37a52
Add fetch_message for webhooks 2021-04-16 11:27:15 -04:00
Rapptz
a30ec197c2 Some initial response typings 2021-04-16 08:02:19 -04:00
Rapptz
1f74b051a8 Fix rate limit handling with retry_after precision change 2021-04-15 08:34:58 -04:00
Rapptz
a6f7213c89 Rewrite webhooks to play better with typings and rate limits
This unfortunately required splitting the types into two. This led to
a lot of unfortunate code duplication that I didn't really enjoy
writing.

The new design allows users to pass an authentication token to make
webhook requests without the webhook token and allows to finally
edit the webhook channel.

The new design also uses a contextvar to store rate limiting
information so multiple instances or recreating instances no longer
clears the ratelimiting state since it's now essentially a "global"
object.

Closes #6525, closes #6662, closes #2509, closes #1761
2021-04-15 08:04:32 -04:00
Rapptz
d85805ab6d First pass at supporting v8 API 2021-04-11 00:39:13 -04:00
Rapptz
99fc950510 Use f-strings in more places that were missed. 2021-04-08 06:02:47 -04:00
Rapptz
1d5805ebcb Revert "Remove unused group functionality"
This reverts commit d69b2f0af563993bdae425f4bb92fb555a238933.
2021-04-07 00:01:57 -04:00
Steve C
3c9aed9102
Fix AttributeError on HTTPClient.send_file to be send_files 2021-04-07 00:01:48 -04:00
Nadir Chowdhury
7f0a398c1e
Use format_map instead of format for Route.url 2021-04-06 23:44:44 -04:00
Rapptz
d69b2f0af5 Remove unused group functionality 2021-04-06 07:12:15 -04:00
Rapptz
84e2ff0bc7 Reformat HTTPClient and add interaction endpoints 2021-04-06 05:25:50 -04:00
Rapptz
54288879e2 Remove userbot functionality
This has a lot of legacy and cruft so there may be some stuff I've
missed but this first pass is enough to get a clear separation.
2021-04-04 10:15:30 -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
Nadir Chowdhury
1b2688518e
Implement StageChannel and related methods 2021-04-03 22:43:41 -04:00
Tarek
6524869ddd
Implement voice region changing for voice channels 2021-04-01 03:49:45 -04:00
Rapptz
1c8d1b0289 Recreate aiohttp.FormData objects during request retries
Fixes #6531
2021-03-24 08:50:34 -04:00
z03h
fbb7ac6be1
Add roles to guild.estimate_pruned_members 2021-03-24 08:17:34 -04:00
Nadir Chowdhury
7d345e8e4e
remove trailing whitespace 2021-03-13 00:42:25 -05:00
Nadir Chowdhury
fb773dc1dd
Add remaining template endpoints 2021-02-23 03:58:03 -05:00
Nihaal Sangha
69bdc3a184
Change copyright year to present 2021-01-15 05:28:11 -05:00
Rapptz
3a75816ba1 Support setting the preferred locale via Guild.edit
Fix #6267
2021-01-05 22:43:22 -05:00
PikalaxALT
d1cb30cccf
Implement discord.Message.reply 2020-11-26 23:19:00 -05:00
Harmon
351a1a1865 Raise DiscordServerError for 503 Service Unavailable errors 2020-11-21 22:16:40 -05:00
Rapptz
7126f5a78c Use delete_message_days instead of delete-message-days 2020-09-23 08:03:06 -04:00
Rapptz
e8eb19b2b4 Use /invites/ instead of /invite/ 2020-09-23 07:58:57 -04:00
Rapptz
450e71f086 Add a more concrete exception for 500 status codes.
Fixes #5797
2020-09-09 21:24:14 -04:00
jack1142
bd9821320e Use a subclass rather than monkey-patching for the websocket 2020-07-25 09:59:40 -04:00
Rapptz
137ff34f3a If we're out of retries just raise the OSError 2020-07-25 09:59:40 -04:00
Rapptz
e2f42597a5 Handle Connection Reset by Peer connection errors.
This should work both on Windows and on Linux.

Apparently these types of blips are considered normal for Discord. So
rather than letting the reconnect logic handler expect these to be
catastrophic, it should handle it specially so it doesn't waste an
IDENTIFY for what ultimately should just be a small networking blip.

This also makes it less noisy for the end-user as these complaints
happen from time to time.
2020-07-25 09:59:40 -04:00
Rapptz
058a1e608b Fix voice websocket connections 2020-07-25 09:59:38 -04:00
Rapptz
b8154e365f Rewrite gateway to use aiohttp instead of websockets 2020-07-25 09:59:38 -04:00
Tarek
a92e3e7b6b Fix TypeError when not specifying roles. 2020-07-08 23:12:10 -04:00
Nadir Chowdhury
e971e2f16c
Allow more methods to set an audit log reason 2020-06-30 23:35:42 -04:00
Nadir Chowdhury
a64006ee9b
Add support for integrations 2020-06-28 14:50:43 -04:00
Nadir Chowdhury
2b3c6e0d47
Add support for Discord templates 2020-06-28 14:48:04 -04:00
Tarek
4bdebcd339
Fix error raised when using the roles parameter. 2020-06-26 22:54:02 -04:00
NCPlayz
bd1420b5f0 Allow editing of channel types for news and text channels 2020-05-29 23:21:59 -04:00
NCPlayz
ed80ba6a5e Implement some missing attributes of Guild (and Guild.edit) 2020-05-23 22:04:02 -04:00
Rapptz
66c6be50d8 Prepare for the discord.com domain rename 2020-05-23 21:44:30 -04:00
unknown
b7c7c86a6b Add roles parameter for pruning members. 2020-05-03 15:39:52 -04:00
Rapptz
d853a57e86 Rename allowed mention parameters to allowed_mentions 2020-04-04 13:22:51 -04:00
Rapptz
041785937e Add support for configuring allowed mentions per message or bot wide. 2020-04-04 07:40:51 -04:00
Rapptz
00f6562728 Suppress missing Content-Type headers when fetching content
Fixes #2572
2020-02-22 19:07:17 -05:00
Rapptz
25a04ed135 Better detection for Cloudflare related 429s.
At some point Cloudflare started returning some JSON. I don't know how
this JSON looks like.

See #2544
2020-02-01 23:46:28 -05:00
Rapptz
6071607176 Bump copyright year to 2020
Closes #2510
2020-01-19 20:03:00 -05:00