Commit Graph
3965 Commits
Author SHA1 Message Date
Rapptz ff1dd586d3 Always use last value as a fallback for Select.values 2022-08-14 15:50:16 -04:00
MikeyandGitHub 9c38cf3aef Fix ui.Select.values in modals 2022-08-14 15:25:43 -04:00
584c22f642 Raise TypeError when token is not a string
Co-authored-by: Danny <1695103+Rapptz@users.noreply.github.com>
2022-08-14 05:39:06 -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
JohannesIBKandRapptz 610edaeead [commands] Add option to disable auto_locale_strings in GroupCog 2022-08-14 00:59:33 -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
z03handGitHub afcec46dfd Fix Sticker Objects type being StageInstance 2022-08-09 22:52:30 -04:00
Rapptz 4fbafcd718 Fix attribute error in TranslationError 2022-08-09 10:45:12 -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
MikeyandGitHub d826f4f3a8 Change ui.Select.values to a ContextVar to avoid race conditions 2022-08-09 08:37:46 -04:00
z03handGitHub dc81ff76c4 Add Object.type to Objects where a type can be determined 2022-08-09 08:18:58 -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
James Hilton-BalfeandGitHub 40986f9279 Fix overlapping or incorrect slots found by slotscheck 2022-08-08 19:58:48 -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
PuncherandGitHub 44abc469f1 [commands] Remove unused with_command HybridCommand parameter 2022-08-07 17:20:02 -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
1787867320 Add support for specifying the type of a generic discord.Object
Co-authored-by: Danny <1695103+Rapptz@users.noreply.github.com>
2022-08-06 14:23:37 -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
Bryan ForbesandGitHub d707019348 Bump Pyright to 1.1.265, fix type errors, and remove unnecessary ignores 2022-08-04 22:46:02 -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
MikeyandGitHub c4e09acff8 Add InteractionResponse.type property 2022-08-04 08:13:27 -04:00
z03handGitHub ca1365d7ef Set allow_list for fetched AutoModRules 2022-08-03 20:23:58 -04:00
Rapptz c735682ac6 Fix autocomplete bindings not working for transformer instances 2022-08-03 19:02:36 -04:00
MikeyandGitHub 5538cd501c Document relationship between AutoModRuleAction and its type 2022-08-03 03:13:00 -04:00
MayaandGitHub 2fb309a463 [commands] Fix typing error with CheckAnyFailure 2022-08-03 03:11:12 -04:00
Alex NørgaardandGitHub c604f853ea Allow creation of allow lists in automod word filter rules 2022-08-03 03:10:36 -04:00
Rapptz 13c725f183 Fix EnumNameTransformer passing values 2022-08-02 11:02:30 -04:00
Bryan ForbesandGitHub 07ad6951fb Fix various generics throughout the public interface
Fix CooldownMapping generic typing and ensure other public methods 
have proper generics
2022-08-01 06:24:55 -04:00
6e3c359373 Add min/max_length to Argument
Co-authored-by: Danny <1695103+Rapptz@users.noreply.github.com>
2022-08-01 06:23:12 -04:00
SoheabandGitHub f5b0717661 [commands] Add get_app_commands and walk_app_commands to Cog 2022-08-01 06:22:02 -04:00
Varun JandGitHub c26473d0eb Fix views not being persistent if modifying custom_id after __init__ 2022-07-31 04:53:25 -04:00
Rapptz 5527de688a Fix Python 3.10 __or__ not working with transformers
Fixes #8214
2022-07-30 04:48:26 -04:00