Skip to content
This repository was archived by the owner on Aug 28, 2019. It is now read-only.

Commit 863df7d

Browse files
committed
Add support for discord.Thread annotation in app commands
1 parent 6d55b96 commit 863df7d

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

discord/app_commands/transformers.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,7 @@
4747
from .errors import AppCommandError, TransformerError
4848
from .models import AppCommandChannel, AppCommandThread, Choice
4949
from ..channel import StageChannel, VoiceChannel, TextChannel, CategoryChannel
50+
from ..threads import Thread
5051
from ..enums import Enum as InternalEnum, AppCommandOptionType, ChannelType
5152
from ..utils import MISSING, maybe_coroutine
5253
from ..user import User
@@ -574,6 +575,7 @@ async def transform(cls, interaction: Interaction, value: Any):
574575
ChannelType.category,
575576
],
576577
AppCommandThread: [ChannelType.news_thread, ChannelType.private_thread, ChannelType.public_thread],
578+
Thread: [ChannelType.news_thread, ChannelType.private_thread, ChannelType.public_thread],
577579
StageChannel: [ChannelType.stage_voice],
578580
VoiceChannel: [ChannelType.voice],
579581
TextChannel: [ChannelType.text, ChannelType.news],
@@ -590,6 +592,7 @@ async def transform(cls, interaction: Interaction, value: Any):
590592
Role: passthrough_transformer(AppCommandOptionType.role),
591593
AppCommandChannel: channel_transformer(AppCommandChannel, raw=True),
592594
AppCommandThread: channel_transformer(AppCommandThread, raw=True),
595+
Thread: channel_transformer(Thread),
593596
StageChannel: channel_transformer(StageChannel),
594597
VoiceChannel: channel_transformer(VoiceChannel),
595598
TextChannel: channel_transformer(TextChannel),

0 commit comments

Comments
 (0)