Commit Graph

2535 Commits

Author SHA1 Message Date
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
7bdaa793f6 Create temporary DMChannels from message create events
This allows for DMChannels to work without falling back to the
Object error case since there is enough information to build a pseudo
DMChannel object.

This is a breaking change since it changes the type of
DMChannel.recipient to Optional[User] for when this faux object is
created.
2021-04-11 22:09:10 -04:00
0f3f2cbeea Fix spelling error in utils.__all__ 2021-04-11 20:18:56 -04:00
74b07a3218 [commands] Fix Command.clean_params to return a regular dict 2021-04-11 16:30:28 -04:00
af5964358d [commands] Strip text to remove spaces before ellipsis 2021-04-11 15:19:45 -04:00
7cbe942a64 Use v8 overwrite type when creating a channel 2021-04-11 15:16:52 -04:00
f1fac96e33 Remove private_channel_(delete/create) events 2021-04-11 15:13:23 -04:00
74d8ad2013 [commands] Add support for Python 3.10 Union typing 2021-04-11 02:11:24 -04:00
1ecadf057e [commands] Fix errors with cooldown mappings 2021-04-11 01:00:04 -04:00
7d79b4ba55 Remove Member related handling in PRESENCE_UPDATE 2021-04-11 00:57:59 -04:00
217c2a1cc5 Fix stray AttributeError in Guild._from_data with member cache 2021-04-11 00:44:27 -04:00
40cf397ce6 Permission related fixes for v8 2021-04-11 00:39:13 -04:00
4c565e5299 add reply and application_command types 2021-04-11 00:39:13 -04:00
7afcacc9a1 Remove MemberCacheFlags.online
v8 no longer gives enough data for this to be possible
2021-04-11 00:39:13 -04:00