diff --git a/CHANGELOG.md b/CHANGELOG.md index 9a408f10ce..cab295f935 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -123,6 +123,8 @@ These changes are available on the `master` branch, but have not yet been releas ([#2812](https://github.com/Pycord-Development/pycord/pull/2812)) - Fixed `AttributeError` when printing a File component's `__repr__`. ([#2843](https://github.com/Pycord-Development/pycord/pull/2843)) +- Fixed `TypeError` when using `@option` with certain annotations and along with + `channel_types`. ([#2835](https://github.com/Pycord-Development/pycord/pull/2835)) ### Changed diff --git a/discord/commands/options.py b/discord/commands/options.py index 0c6b1fb6f3..0425137aed 100644 --- a/discord/commands/options.py +++ b/discord/commands/options.py @@ -225,7 +225,9 @@ def __init__( self.description = description or "No description provided" self.channel_types: list[ChannelType] = kwargs.pop("channel_types", []) - if isinstance(input_type, SlashCommandOptionType): + if self.channel_types: + self.input_type = SlashCommandOptionType.channel + elif isinstance(input_type, SlashCommandOptionType): self.input_type = input_type else: from ..ext.commands import Converter