From 00ae8bb18c7eeb55d1ebd96aa523b265d66ec0f1 Mon Sep 17 00:00:00 2001 From: Gnome! <45660393+Gnome-py@users.noreply.github.com> Date: Mon, 20 Sep 2021 20:25:48 +0100 Subject: [PATCH 01/10] Fix all invites to devision server invite (#69) --- .github/ISSUE_TEMPLATE/bug_report.yml | 2 +- .github/ISSUE_TEMPLATE/config.yml | 2 +- README.rst | 4 ++-- docs/conf.py | 4 ++-- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/.github/ISSUE_TEMPLATE/bug_report.yml b/.github/ISSUE_TEMPLATE/bug_report.yml index eabf5c07..d163d40d 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.yml +++ b/.github/ISSUE_TEMPLATE/bug_report.yml @@ -6,7 +6,7 @@ body: attributes: value: > Thanks for taking the time to fill out a bug. - If you want real-time support, consider joining our Discord at https://discord.gg/r3sSKJJ instead. + If you want real-time support, consider joining our Discord at https://discord.gg/TvqYBrGXEm instead. Please note that this form is for bugs only! - type: input diff --git a/.github/ISSUE_TEMPLATE/config.yml b/.github/ISSUE_TEMPLATE/config.yml index 7934e4a8..8d62a0e1 100644 --- a/.github/ISSUE_TEMPLATE/config.yml +++ b/.github/ISSUE_TEMPLATE/config.yml @@ -5,4 +5,4 @@ contact_links: url: https://github.com/Rapptz/discord.py/discussions - name: Discord Server about: Use our official Discord server to ask for help and questions as well. - url: https://discord.gg/r3sSKJJ + url: https://discord.gg/TvqYBrGXEm diff --git a/README.rst b/README.rst index 9f222e10..1c956bdc 100644 --- a/README.rst +++ b/README.rst @@ -2,7 +2,7 @@ enhanced-discord.py =================== .. image:: https://discord.com/api/guilds/514232441498763279/embed.png - :target: https://discord.gg/PYAfZzpsjG + :target: https://discord.gg/TvqYBrGXEm :alt: Discord server invite .. image:: https://img.shields.io/pypi/v/enhanced-dpy.svg :target: https://pypi.python.org/pypi/enhanced-dpy @@ -117,5 +117,5 @@ Links ------ - `Documentation `_ -- `Official Discord Server `_ +- `Official Discord Server `_ - `Discord API `_ diff --git a/docs/conf.py b/docs/conf.py index e0878cd2..e6464b4a 100644 --- a/docs/conf.py +++ b/docs/conf.py @@ -159,7 +159,7 @@ html_experimental_html5_writer = True html_theme = "basic" html_context = { - "discord_invite": "https://discord.gg/r3sSKJJ", + "discord_invite": "https://discord.gg/TvqYBrGXEm", "discord_extensions": [ ("discord.ext.commands", "ext/commands"), ("discord.ext.tasks", "ext/tasks"), @@ -167,7 +167,7 @@ html_context = { } resource_links = { - "discord": "https://discord.gg/r3sSKJJ", + "discord": "https://discord.gg/TvqYBrGXEm", "issues": "https://github.com/Rapptz/discord.py/issues", "discussions": "https://github.com/Rapptz/discord.py/discussions", "examples": f"https://github.com/Rapptz/discord.py/tree/{branch}/examples", -- 2.47.2 From 2ecf75537224c349fe62ac5f71ecd67618e61494 Mon Sep 17 00:00:00 2001 From: Astrea Date: Tue, 21 Sep 2021 14:37:28 -0400 Subject: [PATCH 02/10] Merge pull request #57 * FIx _accent_colour being improperly typehinted --- discord/user.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/user.py b/discord/user.py index 6b7d53f6..c0394318 100644 --- a/discord/user.py +++ b/discord/user.py @@ -80,7 +80,7 @@ class BaseUser(_UserTag): _state: ConnectionState _avatar: Optional[str] _banner: Optional[str] - _accent_colour: Optional[str] + _accent_colour: Optional[int] _public_flags: int def __init__(self, *, state: ConnectionState, data: UserPayload) -> None: -- 2.47.2 From e65415d3c8f1ae01f2e5b91dd5f7f24538cfcadd Mon Sep 17 00:00:00 2001 From: Gnome! <45660393+Gnome-py@users.noreply.github.com> Date: Tue, 21 Sep 2021 19:47:28 +0100 Subject: [PATCH 03/10] Merge pull request #60 * Rework how checks add attributes to Commmand * Merge remote-tracking branch 'upstream/2.0' into command-attrs-checks --- discord/ext/commands/core.py | 85 +++++++++++++++++++++++------------- 1 file changed, 55 insertions(+), 30 deletions(-) diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index fa1e4212..5947dc19 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -330,6 +330,7 @@ class Command(_BaseCommand, Generic[CogT, P, T]): .. versionadded:: 2.0 """ __original_kwargs__: Dict[str, Any] + _max_concurrency: Optional[MaxConcurrency] def __new__(cls: Type[CommandT], *args: Any, **kwargs: Any) -> CommandT: # if you're wondering why this is done, it's because we need to ensure @@ -392,17 +393,20 @@ class Command(_BaseCommand, Generic[CogT, P, T]): self.description: str = inspect.cleandoc(kwargs.get("description", "")) self.hidden: bool = kwargs.get("hidden", False) + if hasattr(func, "__command_attrs__"): + command_attrs: Dict[str, Any] = func.__command_attrs__ + else: + command_attrs = {} + try: - checks = func.__commands_checks__ + checks = command_attrs.pop("checks") checks.reverse() - except AttributeError: + except KeyError: checks = kwargs.get("checks", []) - self.checks: List[Check] = checks - try: - cooldown = func.__commands_cooldown__ - except AttributeError: + cooldown = command_attrs.pop("cooldown") + except KeyError: cooldown = kwargs.get("cooldown") if cooldown is None: @@ -411,14 +415,10 @@ class Command(_BaseCommand, Generic[CogT, P, T]): buckets = cooldown else: raise TypeError("Cooldown must be a an instance of CooldownMapping or None.") + + self.checks: List[Check] = checks self._buckets: CooldownMapping = buckets - - try: - max_concurrency = func.__commands_max_concurrency__ - except AttributeError: - max_concurrency = kwargs.get("max_concurrency") - - self._max_concurrency: Optional[MaxConcurrency] = max_concurrency + self._max_concurrency = kwargs.get("max_concurrency") self.require_var_positional: bool = kwargs.get("require_var_positional", False) self.ignore_extra: bool = kwargs.get("ignore_extra", True) @@ -435,20 +435,23 @@ class Command(_BaseCommand, Generic[CogT, P, T]): self._before_invoke: Optional[Hook] = None try: - before_invoke = func.__before_invoke__ - except AttributeError: + before_invoke = command_attrs.pop("before_invoke") + except KeyError: pass else: self.before_invoke(before_invoke) self._after_invoke: Optional[Hook] = None try: - after_invoke = func.__after_invoke__ - except AttributeError: + after_invoke = command_attrs.pop("after_invoke") + except KeyError: pass else: self.after_invoke(after_invoke) + # Handle user provided command attrs + self._update_attrs(**command_attrs) + @property def callback( self, @@ -474,6 +477,10 @@ class Command(_BaseCommand, Generic[CogT, P, T]): self.params, self.option_descriptions = get_signature_parameters(function, globalns) + def _update_attrs(self, **command_attrs: Any): + for key, value in command_attrs.items(): + setattr(self, key, value) + def add_check(self, func: Check) -> None: """Adds a check to the command. @@ -1829,7 +1836,7 @@ def group( return command(name=name, cls=cls, **attrs) # type: ignore -def check(predicate: Check) -> Callable[[T], T]: +def check(predicate: Check, **command_attrs: Any) -> Callable[[T], T]: r"""A decorator that adds a check to the :class:`.Command` or its subclasses. These checks could be accessed via :attr:`.Command.checks`. @@ -1898,16 +1905,22 @@ def check(predicate: Check) -> Callable[[T], T]: ----------- predicate: Callable[[:class:`Context`], :class:`bool`] The predicate to check if the command should be invoked. + **command_attrs: Dict[:class:`str`, Any] + key: value pairs to be added to the command's attributes. """ def decorator(func: Union[Command, CoroFunc]) -> Union[Command, CoroFunc]: if isinstance(func, Command): func.checks.append(predicate) + func._update_attrs(**command_attrs) else: if not hasattr(func, "__commands_checks__"): func.__commands_checks__ = [] + if not hasattr(func, "__command_attrs__"): + func.__command_attrs__ = {} func.__commands_checks__.append(predicate) + func.__command_attrs__.update(command_attrs) return func @@ -2080,7 +2093,7 @@ def has_any_role(*items: Union[int, str]) -> Callable[[T], T]: return True raise MissingAnyRole(list(items)) - return check(predicate) + return check(predicate, required_roles=items) def bot_has_role(item: int) -> Callable[[T], T]: @@ -2110,7 +2123,7 @@ def bot_has_role(item: int) -> Callable[[T], T]: raise BotMissingRole(item) return True - return check(predicate) + return check(predicate, bot_required_role=item) def bot_has_any_role(*items: int) -> Callable[[T], T]: @@ -2139,7 +2152,7 @@ def bot_has_any_role(*items: int) -> Callable[[T], T]: return True raise BotMissingAnyRole(list(items)) - return check(predicate) + return check(predicate, bot_required_roles=items) def has_permissions(**perms: bool) -> Callable[[T], T]: @@ -2187,7 +2200,7 @@ def has_permissions(**perms: bool) -> Callable[[T], T]: raise MissingPermissions(missing) - return check(predicate) + return check(predicate, required_permissions=perms) def bot_has_permissions(**perms: bool) -> Callable[[T], T]: @@ -2214,7 +2227,7 @@ def bot_has_permissions(**perms: bool) -> Callable[[T], T]: raise BotMissingPermissions(missing) - return check(predicate) + return check(predicate, bot_required_permissions=perms) def has_guild_permissions(**perms: bool) -> Callable[[T], T]: @@ -2243,7 +2256,7 @@ def has_guild_permissions(**perms: bool) -> Callable[[T], T]: raise MissingPermissions(missing) - return check(predicate) + return check(predicate, required_guild_permissions=perms) def bot_has_guild_permissions(**perms: bool) -> Callable[[T], T]: @@ -2269,7 +2282,7 @@ def bot_has_guild_permissions(**perms: bool) -> Callable[[T], T]: raise BotMissingPermissions(missing) - return check(predicate) + return check(predicate, bot_required_guild_permissions=perms) def dm_only() -> Callable[[T], T]: @@ -2380,7 +2393,10 @@ def cooldown( if isinstance(func, Command): func._buckets = CooldownMapping(Cooldown(rate, per), type) else: - func.__commands_cooldown__ = CooldownMapping(Cooldown(rate, per), type) + if not hasattr(func, "__command_attrs__"): + func.__command_attrs__ = {} + + func.__command_attrs__["cooldown"] = CooldownMapping(Cooldown(rate, per), type) return func return decorator # type: ignore @@ -2424,7 +2440,10 @@ def dynamic_cooldown( if isinstance(func, Command): func._buckets = DynamicCooldownMapping(cooldown, type) else: - func.__commands_cooldown__ = DynamicCooldownMapping(cooldown, type) + if not hasattr(func, "__command_attrs__"): + func.__command_attrs__ = {} + + func.__command_attrs__["cooldown"] = DynamicCooldownMapping(cooldown, type) return func return decorator # type: ignore @@ -2459,7 +2478,10 @@ def max_concurrency(number: int, per: BucketType = BucketType.default, *, wait: if isinstance(func, Command): func._max_concurrency = value else: - func.__commands_max_concurrency__ = value + if not hasattr(func, "__command_attrs__"): + func.__command_attrs__ = {} + + func.__command_attrs__["_max_concurrency"] = value return func return decorator # type: ignore @@ -2508,7 +2530,10 @@ def before_invoke(coro) -> Callable[[T], T]: if isinstance(func, Command): func.before_invoke(coro) else: - func.__before_invoke__ = coro + if not hasattr(func, "__command_attrs__"): + func.__command_attrs__ = {} + + func.__command_attrs__["before_invoke"] = coro return func return decorator # type: ignore @@ -2527,7 +2552,7 @@ def after_invoke(coro) -> Callable[[T], T]: if isinstance(func, Command): func.after_invoke(coro) else: - func.__after_invoke__ = coro + func.__command_attrs__["after_invoke"] = coro return func return decorator # type: ignore -- 2.47.2 From fba7ca420c74da2a93e0cd97bed552bfdf80ad34 Mon Sep 17 00:00:00 2001 From: Gnome! <45660393+Gnome-py@users.noreply.github.com> Date: Tue, 21 Sep 2021 19:51:23 +0100 Subject: [PATCH 04/10] Merge pull request #63 * Add ephemeral attachment field * I did not miss a comma --- discord/message.py | 8 +++++++- discord/types/message.py | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/discord/message.py b/discord/message.py index 30464bd8..d8757022 100644 --- a/discord/message.py +++ b/discord/message.py @@ -169,9 +169,14 @@ class Attachment(Hashable): The attachment's `media type `_ .. versionadded:: 1.7 + ephemeral: Optional[:class:`bool`] + If the attachment is ephemeral. Ephemeral attachments are temporary and + will automatically be removed after a set period of time. + + .. versionadded:: 2.0 """ - __slots__ = ("id", "size", "height", "width", "filename", "url", "proxy_url", "_http", "content_type") + __slots__ = ("id", "size", "height", "width", "filename", "url", "proxy_url", "ephemeral", "_http", "content_type") def __init__(self, *, data: AttachmentPayload, state: ConnectionState): self.id: int = int(data["id"]) @@ -183,6 +188,7 @@ class Attachment(Hashable): self.proxy_url: str = data.get("proxy_url") self._http = state.http self.content_type: Optional[str] = data.get("content_type") + self.ephemeral: Optional[bool] = data.get("ephemeral") def is_spoiler(self) -> bool: """:class:`bool`: Whether this attachment contains a spoiler.""" diff --git a/discord/types/message.py b/discord/types/message.py index 2522e839..6a6dc0bb 100644 --- a/discord/types/message.py +++ b/discord/types/message.py @@ -53,6 +53,7 @@ class _AttachmentOptional(TypedDict, total=False): height: Optional[int] width: Optional[int] content_type: str + ephemeral: bool spoiler: bool -- 2.47.2 From 6a63ce2ed7849f95b5a2d4a14c1f5618d4d9718f Mon Sep 17 00:00:00 2001 From: Arnav Jindal Date: Wed, 22 Sep 2021 00:22:03 +0530 Subject: [PATCH 05/10] Add typechecking for PRS/Commits (#59) * Create ci.yml * Create .python-black * Remove linting --- .github/workflows/ci.yml | 26 ++++++++++++++++++++++++++ .python-black | 1 + 2 files changed, 27 insertions(+) create mode 100644 .github/workflows/ci.yml create mode 100644 .python-black diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..f4dd5c56 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,26 @@ +name: CI + +on: [push, pull_request] + +jobs: + lint: + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v2 + + - name: Setup Python + uses: actions/setup-python@v1 + with: + python-version: 3.8 + + - name: Setup node.js (for pyright) + uses: actions/setup-node@v1 + with: + node-version: "14" + + - name: Run type checking + run: | + npm install -g pyright + pip install -r requirements.txt + pyright --lib --verifytypes discord --ignoreexternal diff --git a/.python-black b/.python-black new file mode 100644 index 00000000..8b137891 --- /dev/null +++ b/.python-black @@ -0,0 +1 @@ + -- 2.47.2 From cd4bb296f3fedf8cc8b0c9cb6575e52e7681f3f1 Mon Sep 17 00:00:00 2001 From: Astrea Date: Tue, 21 Sep 2021 14:52:55 -0400 Subject: [PATCH 06/10] Merge pull request #58 * FIxed `userinfo` command not returning an avatar... * Quick merge conflict fix * Merge branch '2.0' into converter-example-fix * Fix code style issues with Black --- examples/converters.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/converters.py b/examples/converters.py index 2a02c0a4..a1b4a6c6 100644 --- a/examples/converters.py +++ b/examples/converters.py @@ -27,7 +27,7 @@ async def userinfo(ctx: commands.Context, user: discord.User): # and can do the following: user_id = user.id username = user.name - avatar = user.avatar.url + avatar = user.display_avatar.url await ctx.send(f"User found: {user_id} -- {username}\n{avatar}") -- 2.47.2 From b81084827379d3b3996fe8f66d973cc410b685ca Mon Sep 17 00:00:00 2001 From: Gnome! <45660393+Gnome-py@users.noreply.github.com> Date: Tue, 21 Sep 2021 20:10:16 +0100 Subject: [PATCH 07/10] Merge pull request #70 * Fix embed image/thumbnail property --- discord/embeds.py | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/discord/embeds.py b/discord/embeds.py index 4e1647f1..81f7e5ff 100644 --- a/discord/embeds.py +++ b/discord/embeds.py @@ -398,16 +398,14 @@ class Embed: return EmbedProxy(getattr(self, "_image", {})) # type: ignore @image.setter - def image(self: E, url: Any): + def image(self, url: Any): if url is EmptyEmbed: - del self._image + del self.image else: - self._image = { - "url": str(url), - } + self._image = {"url": str(url)} @image.deleter - def image(self: E): + def image(self): try: del self._image except AttributeError: @@ -429,7 +427,6 @@ class Embed: """ self.image = url - return self @property @@ -448,13 +445,11 @@ class Embed: return EmbedProxy(getattr(self, "_thumbnail", {})) # type: ignore @thumbnail.setter - def thumbnail(self: E, url: Any): + def thumbnail(self, url: Any): if url is EmptyEmbed: - del self._thumbnail + del self.thumbnail else: - self._thumbnail = { - "url": str(url), - } + self._thumbnail = {"url": str(url)} @thumbnail.deleter def thumbnail(self): @@ -463,7 +458,7 @@ class Embed: except AttributeError: pass - def set_thumbnail(self: E, *, url: MaybeEmpty[Any]): + def set_thumbnail(self, *, url: MaybeEmpty[Any]): """Sets the thumbnail for the embed content. This function returns the class instance to allow for fluent-style @@ -479,7 +474,6 @@ class Embed: """ self.thumbnail = url - return self @property -- 2.47.2 From 02c6b078340541023bc23c15a76f29bfd2363666 Mon Sep 17 00:00:00 2001 From: Gnome! <45660393+Gnome-py@users.noreply.github.com> Date: Tue, 21 Sep 2021 22:34:54 +0100 Subject: [PATCH 08/10] Merge pull request #72 * Fix command checks actually working --- discord/ext/commands/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index 5947dc19..5d48eb8f 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -399,9 +399,9 @@ class Command(_BaseCommand, Generic[CogT, P, T]): command_attrs = {} try: - checks = command_attrs.pop("checks") + checks = func.__commands_checks__ checks.reverse() - except KeyError: + except AttributeError: checks = kwargs.get("checks", []) try: -- 2.47.2 From 0637a628caa8734a6a12156ab7a340ddd0e63576 Mon Sep 17 00:00:00 2001 From: Tom <47765953+IAmTomahawkx@users.noreply.github.com> Date: Tue, 21 Sep 2021 14:51:46 -0700 Subject: [PATCH 09/10] update workflows (#73) * modify workflows to fit into one file, fix pyright workflow * remove redundant pip install * add check flag to black * use psf/black for black checker --- .github/workflows/black.yml | 25 ------------------------- .github/workflows/ci.yml | 16 ++++++++++++++-- 2 files changed, 14 insertions(+), 27 deletions(-) delete mode 100644 .github/workflows/black.yml diff --git a/.github/workflows/black.yml b/.github/workflows/black.yml deleted file mode 100644 index b95fb1dd..00000000 --- a/.github/workflows/black.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: Lint - -on: [push] - -jobs: - lint: - runs-on: ubuntu-latest - steps: - - name: checkout - uses: actions/checkout@v2 - - - name: Setup Python - uses: actions/setup-python@v1 - with: - python-version: 3.8 - - - name: install black - run: pip install black - - - name: run linter - uses: wearerequired/lint-action@v1 - with: - black: true - black_args: ". --line-length 120" - auto_fix: true \ No newline at end of file diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index f4dd5c56..27a7e1d0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -3,7 +3,7 @@ name: CI on: [push, pull_request] jobs: - lint: + pyright: runs-on: ubuntu-latest steps: - name: checkout @@ -22,5 +22,17 @@ jobs: - name: Run type checking run: | npm install -g pyright - pip install -r requirements.txt + pip install . pyright --lib --verifytypes discord --ignoreexternal + + black: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + + - name: Run linter + uses: psf/black@stable + with: + options: "--line-length 120 --check" + src: "./discord" \ No newline at end of file -- 2.47.2 From 82332ff1b9a1fc92522194ab57d9e232e1227acb Mon Sep 17 00:00:00 2001 From: Gnome Date: Wed, 22 Sep 2021 19:07:14 +0100 Subject: [PATCH 10/10] Add better support for MENTIONABLE --- discord/ext/commands/core.py | 20 +++++++++++++++----- 1 file changed, 15 insertions(+), 5 deletions(-) diff --git a/discord/ext/commands/core.py b/discord/ext/commands/core.py index fa1e4212..bebead79 100644 --- a/discord/ext/commands/core.py +++ b/discord/ext/commands/core.py @@ -54,7 +54,16 @@ import discord from .errors import * from .cooldowns import Cooldown, BucketType, CooldownMapping, MaxConcurrency, DynamicCooldownMapping -from .converter import CONVERTER_MAPPING, Converter, run_converters, get_converter, Greedy, Option +from .converter import ( + CONVERTER_MAPPING, + Converter, + MemberConverter, + RoleConverter, + run_converters, + get_converter, + Greedy, + Option, +) from ._types import _BaseCommand from .cog import Cog from .context import Context @@ -125,7 +134,6 @@ application_option_type_lookup = { ): 6, # Preferably discord.abc.User, but 'Protocols with non-method members don't support issubclass()' (discord.abc.GuildChannel, discord.DMChannel): 7, discord.Role: 8, - discord.Object: 9, float: 10, } @@ -1208,7 +1216,6 @@ class Command(_BaseCommand, Generic[CogT, P, T]): def _param_to_options( self, name: str, annotation: Any, required: bool, varadic: bool ) -> List[Optional[ApplicationCommandInteractionDataOption]]: - origin = getattr(annotation, "__origin__", None) if inspect.isclass(annotation) and issubclass(annotation, FlagConverter): return [ @@ -1228,6 +1235,7 @@ class Command(_BaseCommand, Generic[CogT, P, T]): annotation, origin = annotation.__args__[0], None option: Dict[str, Any] = { + "type": 3, "name": name, "required": required, "description": self.option_descriptions[name], @@ -1242,12 +1250,15 @@ class Command(_BaseCommand, Generic[CogT, P, T]): # one, in which we can get the original type, eg, (MemberConverter -> Member) annotation = REVERSED_CONVERTER_MAPPING.get(annotation, annotation) - option["type"] = 3 for python_type, discord_type in application_option_type_lookup.items(): if issubclass(annotation, python_type): option["type"] = discord_type break + elif origin is Union: + if annotation in {Union[discord.Member, discord.Role], Union[MemberConverter, RoleConverter]}: + option["type"] = 9 + elif origin is Literal: literal_values = annotation.__args__ python_type = type(literal_values[0]) @@ -1261,7 +1272,6 @@ class Command(_BaseCommand, Generic[CogT, P, T]): {"name": literal_value, "value": literal_value} for literal_value in annotation.__args__ ] - option.setdefault("type", 3) # STRING return [option] # type: ignore def to_application_command(self, nested: int = 0) -> Optional[EditApplicationCommand]: -- 2.47.2