Commit Graph
100 Commits
Author SHA1 Message Date
Rapptz 27b19ed582 Change error message for unbound callbacks in ContextMenu 2022-09-04 00:34:17 -04:00
Rapptz fdebe069a6 Change ForumTag.emoji to be optional 2022-09-03 00:23:07 -04:00
Rapptz aa0acf1d56 Add more options to Guild.create_forum 2022-09-01 05:10:41 -04:00
Rapptz 40b91f0e2a Remove TextChannel.default_thread_slowmode_delay
This doesn't have meaning on text channels apparently
2022-09-01 04:52:44 -04:00
Rapptz ab265dcb7c Add support for newest ForumChannel changes
This adds the following:

- Forum tag support
- Default reaction support
- Default slowmode for newly created threads
2022-08-31 11:09:56 -04:00
Rapptz 9ea6ee8887 Add support for ForumChannel annotations in app commands 2022-08-30 05:09:50 -04:00
Rapptz 6ab6b2cb96 [commands] Fix Context.from_interaction ignoring command_failed 2022-08-30 05:08:11 -04:00
Rapptz 7d1cb08c6d Remove buckets from webhook ratelimit warnings 2022-08-30 00:53:47 -04:00
Rapptz 2e37e47e38 Fix autocomplete documentation to mention it only passes strings 2022-08-28 02:01:29 -04:00
Rapptz 8ab4d25d40 Version bump for development 2022-08-27 19:52:46 -04:00
Rapptz cb587f67ba Version bump to v2.0.1 2022-08-27 19:47:48 -04:00
Rapptz 58193d18c5 Add changelogs for v2.0.1 2022-08-27 19:47:06 -04:00
Rapptz 7c1dffbf9d Use importlib.metadata instead of pkg_resources 2022-08-26 12:00:46 -04:00
Rapptz b92fd65707 Document app_commands.Choice limits 2022-08-26 11:59:12 -04:00
Rapptz 9237106ee3 Add v2 changelog entry to point to migrating page 2022-08-23 02:34:24 -04:00
Rapptz f5e3074886 Update version guarantees 2022-08-22 15:23:23 -04:00
Rapptz 5fe54b3ae6 Remove __slots__ from abc protocols
Fix #8354
2022-08-19 19:10:19 -04:00
Rapptz 59677c6738 Fix CommandTree.on_error not triggering if interaction_check raises 2022-08-18 21:10:10 -04:00
Rapptz 6327402730 Update View timeout only if interaction_check passes 2022-08-18 18:55:50 -04:00
Rapptz 5c7f6dd37e Clarify when None is returned from Member.edit 2022-08-18 09:52:28 -04:00
Rapptz bc00bc495e Document attachment:// URI more prominently in Embed docs 2022-08-18 09:50:16 -04:00
Rapptz 38ec8cfb0e Add FUNDING.yml 2022-08-18 09:40:28 -04:00
Rapptz 03dbd7a01d Fix cchardet being installed on Python >=3.10
This project is unmaintained now
2022-08-18 09:39:25 -04:00
Rapptz 4abea7bafa Version bump for development 2022-08-17 23:30:19 -04:00
Rapptz 575af0ff51 Version bump to v2.0.0 2022-08-17 23:28:51 -04:00
Rapptz 2bf2bfc9b4 Add utils.setup_logging to help set up logging outside of Client.run 2022-08-17 22:53:03 -04:00
Rapptz 1c7747fe9d Fix nested Annotated calls not resolving 2022-08-17 10:41:57 -04:00
Rapptz 8dd186cf1e Fix cache eviction for ratelimit objects 2022-08-17 08:39:39 -04:00
Rapptz 54ee383585 [commands] Add warning if Intent.message_content is not enabled 2022-08-17 03:52:29 -04:00
Rapptz cdce8fae5b Change ui.TextInput.value to not be Optional 2022-08-17 02:26:17 -04:00
Rapptz f52a02359d Use built-in isascii instead of regex 2022-08-17 01:52:29 -04:00
Rapptz d78be1f591 Fix Exception Hierarchy to have the proper heading 2022-08-16 22:38:57 -04:00
Rapptz bd19ad05e7 Fix app_command_completion triggering on certain errors 2022-08-16 20:03:02 -04:00
Rapptz 7be0779b65 Add root_logger setting to Client.run
This allows people one way to use the colour logger globally
2022-08-16 20:03:02 -04:00
Rapptz 3aa3c36c4f Marginally speed up CI doc builds by using multiple jobs 2022-08-16 18:57:03 -04:00
Rapptz 1a11c9eeee [commands] Properly set module information for hybrid commands 2022-08-16 01:28:27 -04:00
Rapptz de5fa8bc9c Improve sync error format for children options 2022-08-16 01:18:12 -04:00
Rapptz 596f2ca222 Fix time_snowflake not being documented 2022-08-15 14:01:54 -04:00
Rapptz 6b50fcd5e4 Add Command.parameters to get all parameters of a command 2022-08-15 13:42:47 -04:00
Rapptz 5b56899676 Change snowflake_time and time_snowflake parameters to pos/kw-only 2022-08-15 13:39:03 -04:00
Rapptz c92422d185 Add app commands transformer example
Closes #7984
2022-08-15 11:32:49 -04:00
Rapptz 6886f1d01a Move modal example to its own folder 2022-08-15 10:54:52 -04:00
Rapptz 54541ba6f0 Ensure FFmpeg players have a _process attribute set even during errors 2022-08-15 10:32:07 -04:00
Rapptz 3802780f77 Change a lot of logging INFO calls to be less verbose
Some of the logs were only useful for debug scenarios, so they have
been downgraded to DEBUG. Others were in INFO but supposed to be in
WARNING so those were upgraded.
2022-08-15 10:21:36 -04:00
Rapptz 0ec06f0ac5 Add on_app_command_completion event
Fix #8126
2022-08-15 09:19:01 -04:00
Rapptz 0b69148c84 Fix float focused autocomplete options being parsed
According to the Discord docs these aren't validated
2022-08-15 08:59:29 -04:00
Rapptz 49e6fe9a0c Fix autocomplete translations calling unnecessary locales 2022-08-14 17:35:43 -04:00
Rapptz 32c5a0cec1 Change default Choice.name_localizations to an empty dict 2022-08-14 17:35:43 -04:00
Rapptz f69d4ee5cb Add Choice.name_localizations data from Discord
Fix #8337
2022-08-14 16:29:16 -04:00
Rapptz ff1dd586d3 Always use last value as a fallback for Select.values 2022-08-14 15:50:16 -04:00
Rapptz c8db766be4 Fix empty strings crashing Namespace for float options
This feels like a Discord bug to me but it's causing issues
2022-08-14 05:38:11 -04:00
Rapptz 1fa7d7e402 Raise special CommandSyncFailure during sync for better errors
This is parsed from the error to allow for users to better debug
what exactly is causing the issue in sync.
2022-08-12 22:36:13 -04:00
Rapptz a9025ca3d1 Remove public CommandTree.call method and make it private 2022-08-12 10:57:54 -04:00
Rapptz 0744737e86 Fix default_permissions serialisation error from __bool__ change 2022-08-11 18:24:23 -04:00
Rapptz f1ec0919f6 Remove stack info from ratelimit logs 2022-08-10 22:55:27 -04:00
Rapptz 747091d4a2 Add __bool__ for flags 2022-08-10 22:49:49 -04:00
Rapptz 7da2048d1a Add support for resume_gateway_url 2022-08-10 22:47:27 -04:00
Rapptz a36d6daec7 Fix formatting issue in app_commands 2022-08-10 22:39:53 -04:00
Rapptz 11278d55e8 Add command information to Parameter class 2022-08-09 23:11:40 -04:00
Rapptz 4fbafcd718 Fix attribute error in TranslationError 2022-08-09 10:45:12 -04:00
Rapptz df54da8bc9 Fix secret example requiring more intents than necessary 2022-08-09 10:42:15 -04:00
Rapptz c32567ea81 Refactor TranslationContext to be more useful
The previous enum was good at accomplishing dynamic key generation for
a few cases, but it fell short in others:

1. It could not discern group names and command names
2. It could not give you more contextual data such as the full object
   currently being translated.

On top of that, the context being a required parameter for
Translator.translate meant that it wouldn't be possible to re-use the
translator for other use cases outside of the rigid ones defined in the
library.

To alleviate these concerns, new enum attributes were added along with
a richer type for obtaining even more context.
2022-08-09 10:41:45 -04:00
Rapptz 57efb5a5a0 Fix failing tests to use new get_parameter function 2022-08-09 08:02:41 -04:00
Rapptz 1727eca106 Add app_commands.Parameter for parameter introspection 2022-08-09 07:43:40 -04:00
Rapptz 0e386ec2cc Fix parameter descriptions being serialised as locale_str 2022-08-08 21:15:08 -04:00
Rapptz cc0c261925 Change auto_locale_strings default to True 2022-08-08 20:17:47 -04:00
Rapptz 7e3b08871b Fix documentation build failure from previous rename 2022-08-08 08:30:54 -04:00
Rapptz dd40ff1d57 Add __slots__ to locale_str 2022-08-08 08:11:19 -04:00
Rapptz 9ce1541775 Rename Interaction.original_message to original_response 2022-08-08 08:11:19 -04:00
Rapptz 6381b5a8f4 Change abc.GuildChannel.overwrites to have Object keys if cache failed
Ultimately despite it not being the prettiest, Object keys ended up
being the sanest solution to this without destroying ergonomics.
2022-08-06 14:46:52 -04:00
Rapptz 1a361f4519 Document Text in Voice in the migrating documentation
Closes #8179 #8064
2022-08-06 14:24:15 -04:00
Rapptz 842d6b4fbb Fix auto_locale_strings when no choices are given 2022-08-06 09:20:00 -04:00
Rapptz 87c9c95bb8 Use persistent dictionary for ratelimit information
This should prevent ratelimit information from being cleared too early.
In order to prevent the dictionary from growing to large expired keys
are deleted once they've been deleted.

At present I'm unsure if this change would cause too much CPU pressure.
2022-08-05 23:19:16 -04:00
Rapptz 7d20379bd9 Add name_localizations and description_localizations to AppCommand & co 2022-08-05 22:36:40 -04:00
Rapptz 1c9792e0ed Add auto_locale_strings parameter to application commands 2022-08-05 22:36:40 -04:00
Rapptz 2d586ae805 Add initial support for app command localisation 2022-08-05 22:35:30 -04:00
Rapptz eb3bc7102b [commands] Ensure Command.extras are copied
Fix #8309
2022-08-05 21:56:51 -04:00
Rapptz 60079aee1b [commands] Fix Annotated not working with FlagConverter 2022-08-04 10:44:03 -04:00
Rapptz 08fa9aa65c Add support for inline transformers via classmethod 2022-08-04 10:28:57 -04:00
Rapptz 6c42065210 Fix various a -> an typos across the library
Closes #8301, #8287
2022-08-04 08:17:07 -04:00
Rapptz 99d2ecac54 Fix and add tests for new autocomplete regression 2022-08-03 20:21:13 -04:00
Rapptz c735682ac6 Fix autocomplete bindings not working for transformer instances 2022-08-03 19:02:36 -04:00
Rapptz 13c725f183 Fix EnumNameTransformer passing values 2022-08-02 11:02:30 -04:00
Rapptz 5527de688a Fix Python 3.10 __or__ not working with transformers
Fixes #8214
2022-07-30 04:48:26 -04:00
Rapptz 11618cd1ba Refactor transformers to use instances instead of classmethods
This should allow them to be easier to use for users without requiring
a lot of metaprogramming hackery if you want to involve state.
2022-07-30 04:40:28 -04:00
Rapptz cbf02eda0c Fix bolded HTTPException not working due to rST limitation 2022-07-29 21:58:32 -04:00
Rapptz c43d302a28 [commands] Only call hybrid after_invoke hooks if the command is called
Fix #8276
2022-07-29 21:39:23 -04:00
Rapptz efdda635fb Fix View.from_message not respecting ActionRow row order 2022-07-23 15:24:26 -04:00
Rapptz 9d9d96fce1 Fix crash with automod due to silent Discord breaking change
Fix #8264
2022-07-23 15:14:45 -04:00
Rapptz b68568f375 [commands] Fix type annotations to use Union instead of | 2022-07-23 15:11:19 -04:00
Rapptz 406495b465 Use a sequence instead of a list for AllowedMentions 2022-07-23 01:26:59 -04:00
Rapptz dc50736bfc Add ApplicationFlags.app_commands_badge 2022-07-21 15:00:40 -04:00
Rapptz d52bc5d225 Cache voice members on start up if MemberCacheFlags.voice is enabled
Fix #8209
2022-07-20 23:12:36 -04:00
Rapptz 0b1c5df3e0 Fix minimum and maximum being casted to str in Range[str, ...] 2022-07-20 23:12:00 -04:00
Rapptz 87bc79e6e3 Change certain sequences to use a special proxy type instead of list
This is to speed up cases where someone is just querying the length
of the underlying sequence. If anything else is done to the sequence
then it is copied from the original iterator.

This change should be mostly transparent.
2022-07-19 01:58:58 -04:00
Rapptz 98c4f2ae8b Fix utils.copy_doc being partially unknown 2022-07-19 01:36:18 -04:00
Rapptz a01dad283f Add extraneous debug logging to sub ratelimits being detected 2022-07-19 01:36:18 -04:00
Rapptz 76402b00f9 Allow configuring the maximum ratelimit timeout before erroring
This is useful for cases where a rate limit is known to be
extraordinarily high, but you still want to handle the error.
This is common with routes such as emoji creation.
2022-07-19 01:36:18 -04:00
Rapptz 85ea418776 Special case message deletion sub rate limits 2022-07-19 00:07:28 -04:00
RapptzandJosh c17eb31328 Rewrite rate limit handling to use X-Ratelimit-Bucket and a semaphore
This should increase throughput of the number of requests that can be
made at once, while simultaneously following the new standard practice
of using the rate limit bucket header.

This is an accumulation of a lot of months of work between a few people
and it has been tested extensively. From the testing it seems to work
fine, but I'm not sure if it's the best way to do it.

This changeset does not currently take into consideration sub
rate limits yet, but the foundation is there via Route.metadata. In the
future, this metadata will be filled in with the known sub rate limit
implementation to allow them to have separate keys in the rate limit
mapping.

Co-authored-by: Josh <josh.ja.butt@gmail.com>
2022-07-19 00:07:28 -04:00