Commit Graph

3007 Commits

Author SHA1 Message Date
bee6402d84 Fix utils.find predicate typing to accept Any 2021-04-19 02:11:38 -04:00
8d74fad474 Update lavalink's repo url 2021-04-18 23:12:05 -04:00
95777230b0 Add MessageType.guild_invite_reminder 2021-04-18 20:33:56 -04:00
631a0b1e13 Add support for ApplicationFlags 2021-04-18 20:32:52 -04:00
417353da4d Fix up _unique and valid_icon_size implementations 2021-04-18 09:07:26 -04:00
b35596f7c8 Add typings for discord.utils 2021-04-18 08:43:09 -04:00
cc4dced7c0 Cleanup some of the prior typings for cached_slot_property 2021-04-18 08:07:11 -04:00
18badbc60f Add typing for utils.cached(_slot)_property 2021-04-18 07:56:38 -04:00
7fb746e6e5 [commands] Refactor evaluation functions to allow passing in localns 2021-04-18 04:10:19 -04:00
aac0374baf Add privacy policy and tos fields to AppInfo 2021-04-17 23:52:46 -04:00
821b6c61cb [docs] document inherited members on Asset 2021-04-17 23:40:13 -04:00
c2afa984ff Use f-strings for attributetable 2021-04-17 19:40:40 -04:00
fdf81089b5 Add inherited members to (Partial)Emoji docs 2021-04-17 19:40:40 -04:00
e4513f70ad activities is no longer nullable 2021-04-17 18:56:51 -04:00
86f10f6dd6 Add missing reprs to some objects
These are WidgetMember, BaseUser, and DeletedReferencedMessage
2021-04-17 18:56:08 -04:00
304229071f Add VoiceChannel.video_quality_mode 2021-04-17 08:10:41 -04:00
fed259a83b Refactor save() and read() into AssetMixin 2021-04-17 00:56:38 -04:00
f6fcffbab5 Use default allowed_mentions in Message.edit
Fix #6745
2021-04-16 23:00:18 -04:00
ef9bb79e91 [tasks] Move the Loop's sleep to be before exit conditions
This change makes it more so that `Loop.stop()` gracefully makes the
current iteration the final one, by waiting AND THEN returning.
The current implementation is closer to `cancel`, while also not.

I encountered this because I was trying to run a
`@tasks.loop(count=1)`, and inside it I print some text and change the
interval, and in an `after_loop`, I restart the loop.

Without this change, it immediately floods my console, due to
not waiting before executing `after_loop`.
2021-04-16 22:35:18 -04:00
6ba3d89076 Revert Attachment.save code to prior implementation 2021-04-16 11:38:56 -04:00
9eaf1e85e4 Rewrite Asset design
This is a breaking change.

This does the following transformations, assuming `asset` represents
an asset type.

Object.is_asset_animated() => Object.asset.is_animated()
Object.asset => Object.asset.key
Object.asset_url => Object.asset_url
Object.asset_url_as => Object.asset.replace(...)

Since the asset type now requires a key (or hash, if you will),
Emoji had to be flattened similar to how Attachment was done since
these assets are keyed solely ID.

Emoji.url (Asset) => Emoji.url (str)
Emoji.url_as => removed
Emoji.url.read => Emoji.read
Emoji.url.save => Emoji.save

This transformation was also done to PartialEmoji.
2021-04-16 11:27:23 -04:00
57dbb37a52 Add fetch_message for webhooks 2021-04-16 11:27:15 -04:00
b610998491 Remove Sticker.preview_image 2021-04-16 08:19:39 -04:00
5dec62f4c0 [commands] Add a converter for discord.Object 2021-04-16 08:18:57 -04:00
a30ec197c2 Some initial response typings 2021-04-16 08:02:19 -04:00
74f92387ac Add periods to sticker docs 2021-04-16 07:51:02 -04:00
d3ac191a67 Restrict snowflake regexes to 15-20 digits 2021-04-16 07:33:44 -04:00
8f9819eb4c [docs] Fix various unresolved references 2021-04-15 22:41:41 -04:00
ffea48f218 [commands] Remove HelpCommand.clean_prefix (#6736) 2021-04-15 21:28:08 -04:00
90d59bb06c Fix overloads on Webhook.send to not require wait kwarg 2021-04-15 19:36:36 -04:00
0542b129c2 Fix WebhookMessage.edit documentation 2021-04-15 09:03:46 -04:00
1f74b051a8 Fix rate limit handling with retry_after precision change 2021-04-15 08:34:58 -04:00
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
5ea5f32479 [commands] Fix missing re import in Context 2021-04-15 08:04:24 -04:00
d21e65ce47 Add SystemChannelFlags.guild_reminder_notifications 2021-04-15 08:03:56 -04:00
65d48302ad Fix guild.chunk() not working on evicted guilds
If you're trying to chunk a guild that the bot is not in, 
it'll just hang on the chunk coro forever. It's weird, I know.
2021-04-14 22:10:47 -04:00
ed3c141f5e [commands] Add clean_prefix attribute to commands.Context 2021-04-14 22:09:40 -04:00
208b16ed1b Add note to member docs about Spotify limitation 2021-04-14 22:02:49 -04:00
9f1a96ea9b Remove fetch_offline_members param for Client 2021-04-14 20:58:49 -04:00
930c416ea7 Fix exception for invalid channel types 2021-04-14 01:14:00 -04:00
da6119e04c Fix fail_if_not_exists not being set when constructed with state 2021-04-14 00:50:37 -04:00
30310b9ab6 Add NSFW for Guilds 2021-04-14 00:48:51 -04:00
dea92a69dc Remove support for guild subscriptions 2021-04-14 00:47:46 -04:00
23aaa75802 Add StageChannel to abc.GuildChannel docs 2021-04-13 01:19:29 -04:00
496fcf8005 [docs] Fix reference to Guild.id 2021-04-13 01:01:04 -04:00
a8da7d03b9 Remove AutoShardedClient.request_offline_members 2021-04-12 05:28:18 -04:00
ef4394f87d Add support for role objects in GuildChannel.permissions_for 2021-04-11 22:45:49 -04:00
1209585de5 Remove User.permissions_in
This seemed to only cause confusion.
2021-04-11 22:21:36 -04:00
a8b3cfa592 Remove comment that doesn't apply anymore 2021-04-11 22:20:31 -04:00
9b94fe1ce0 Remove superfluous unused payload parameter 2021-04-11 22:13:48 -04:00