Commit Graph
3174 Commits
Author SHA1 Message Date
JoshandGitHub 8457f70477 [commands] Set constructible FlagConverter flags to not be required 2021-04-21 23:21:02 -04:00
Nadir ChowdhuryandGitHub 1d7f387122 [docs] stage_channels doc typo 2021-04-21 23:18:49 -04:00
JoshandGitHub cfe93f19b1 [commands] Allow FlagCommand subclasses to inherit options 2021-04-21 07:16:23 -04:00
JoshandGitHub 42463bae67 [commands] Add support for aliasing to FlagConverter 2021-04-21 00:31:01 -04:00
KinoandGitHub 0c1c9284f6 Fix typo within HelpCommand.verify_checks documentation 2021-04-21 00:18:32 -04:00
Rapptz 6065329c0e [commands] Avoid creating unnecessary flag mapping copies 2021-04-20 08:02:40 -04:00
Rapptz 15bfdf66b2 [commands] Default construct flags if they're not passed as parameters
This only applies if and only if the flag can be default constructible.
Ergo, all the flags are optional or not required.
2021-04-20 08:00:47 -04:00
Rapptz ac7588f735 Fix some typings in utils 2021-04-20 04:35:53 -04:00
Rapptz 212d308835 [commands] Some minor clean up of the flag converter documentation
Fix #6761
2021-04-19 22:52:29 -04:00
Nadir ChowdhuryandGitHub 7bfb0f8133 [docs] fix docstring of AppInfo 2021-04-19 22:32:07 -04:00
Arnav JindalandGitHub 2e6c28bd60 Bump Python version in Quickstart documentation 2021-04-19 22:26:56 -04:00
Rapptz 18bf3d3a7d [commands] Actually expose the FlagError base error 2021-04-19 10:27:24 -04:00
Rapptz ddb71e2aed [commands] Initial support for FlagConverter
The name is currently pending and there's no command.signature hook
for it yet since this requires bikeshedding.
2021-04-19 10:25:08 -04:00
Rapptz 1c64689807 Remove lingering User.avatar documentation 2021-04-19 05:35:33 -04:00
Rapptz c54e43360b [commands] Add run_converters helper to call converters 2021-04-19 04:46:02 -04:00
Rapptz 09f3f2111c [commands] Add Context.current_parameter 2021-04-19 04:41:32 -04:00
Rapptz 3c8d3ab078 Add a third overload to parse_time
Apparently this behaviour is intended in Pyright
https://github.com/microsoft/pyright/issues/1772

Despite mypy behaving as intended.
2021-04-19 02:12:41 -04:00
Rapptz bee6402d84 Fix utils.find predicate typing to accept Any 2021-04-19 02:11:38 -04:00
CryptexandGitHub 8d74fad474 Update lavalink's repo url 2021-04-18 23:12:05 -04:00
Nadir ChowdhuryandGitHub 95777230b0 Add MessageType.guild_invite_reminder 2021-04-18 20:33:56 -04:00
Nadir ChowdhuryandGitHub 631a0b1e13 Add support for ApplicationFlags 2021-04-18 20:32:52 -04:00
Rapptz 417353da4d Fix up _unique and valid_icon_size implementations 2021-04-18 09:07:26 -04:00
Rapptz b35596f7c8 Add typings for discord.utils 2021-04-18 08:43:09 -04:00
Rapptz cc4dced7c0 Cleanup some of the prior typings for cached_slot_property 2021-04-18 08:07:11 -04:00
Nadir ChowdhuryandGitHub 18badbc60f Add typing for utils.cached(_slot)_property 2021-04-18 07:56:38 -04:00
Rapptz 7fb746e6e5 [commands] Refactor evaluation functions to allow passing in localns 2021-04-18 04:10:19 -04:00
ZomatreeandGitHub aac0374baf Add privacy policy and tos fields to AppInfo 2021-04-17 23:52:46 -04:00
Nadir ChowdhuryandGitHub 821b6c61cb [docs] document inherited members on Asset 2021-04-17 23:40:13 -04:00
Rapptz c2afa984ff Use f-strings for attributetable 2021-04-17 19:40:40 -04:00
Rapptz fdf81089b5 Add inherited members to (Partial)Emoji docs 2021-04-17 19:40:40 -04:00
Nadir ChowdhuryandGitHub e4513f70ad activities is no longer nullable 2021-04-17 18:56:51 -04:00
Steve CandGitHub 86f10f6dd6 Add missing reprs to some objects
These are WidgetMember, BaseUser, and DeletedReferencedMessage
2021-04-17 18:56:08 -04:00
z03handGitHub 304229071f Add VoiceChannel.video_quality_mode 2021-04-17 08:10:41 -04:00
Rapptz fed259a83b Refactor save() and read() into AssetMixin 2021-04-17 00:56:38 -04:00
Rapptz f6fcffbab5 Use default allowed_mentions in Message.edit
Fix #6745
2021-04-16 23:00:18 -04:00
Steve CandGitHub 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
Rapptz 6ba3d89076 Revert Attachment.save code to prior implementation 2021-04-16 11:38:56 -04:00
Rapptz 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
Nadir ChowdhuryandGitHub 57dbb37a52 Add fetch_message for webhooks 2021-04-16 11:27:15 -04:00
Nadir ChowdhuryandGitHub b610998491 Remove Sticker.preview_image 2021-04-16 08:19:39 -04:00
Nadir ChowdhuryandGitHub 5dec62f4c0 [commands] Add a converter for discord.Object 2021-04-16 08:18:57 -04:00
Rapptz a30ec197c2 Some initial response typings 2021-04-16 08:02:19 -04:00
NoNameandGitHub 74f92387ac Add periods to sticker docs 2021-04-16 07:51:02 -04:00
Nadir ChowdhuryandGitHub d3ac191a67 Restrict snowflake regexes to 15-20 digits 2021-04-16 07:33:44 -04:00
Nadir ChowdhuryandGitHub 8f9819eb4c [docs] Fix various unresolved references 2021-04-15 22:41:41 -04:00
pikaninjaandGitHub ffea48f218 [commands] Remove HelpCommand.clean_prefix (#6736) 2021-04-15 21:28:08 -04:00
Rapptz 90d59bb06c Fix overloads on Webhook.send to not require wait kwarg 2021-04-15 19:36:36 -04:00
Rapptz 0542b129c2 Fix WebhookMessage.edit documentation 2021-04-15 09:03:46 -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