Skip to content

Commit ee47f48

Browse files
committed
Add support for all Discord channel types in .commands.parser
1 parent ca9c44c commit ee47f48

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

snakecore/commands/parser.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,9 @@
5757
"discord.Member": "an ID or mention of a Discord server member",
5858
"discord.User": "an ID or mention of a Discord user",
5959
"discord.TextChannel": "an ID or mention of a Discord server text channel",
60+
"discord.VoiceChannel": "an ID or mention of a Discord server voice channel",
61+
"discord.StageChannel": "an ID or mention of a Discord server stage channel",
62+
"discord.ForumChannel": "an ID or mention of a Discord server forum channel",
6063
"discord.Thread": "an ID or mention of a Discord server thread",
6164
"discord.Guild": "an ID of a discord server (A.K.A. 'guild')",
6265
"discord.Message": (
@@ -75,6 +78,9 @@
7578
ANNO_AND_ERROR["discord.member.Member"] = ANNO_AND_ERROR["discord.Member"]
7679
ANNO_AND_ERROR["discord.user.User"] = ANNO_AND_ERROR["discord.User"]
7780
ANNO_AND_ERROR["discord.channel.TextChannel"] = ANNO_AND_ERROR["discord.TextChannel"]
81+
ANNO_AND_ERROR["discord.channel.VoiceChannel"] = ANNO_AND_ERROR["discord.VoiceChannel"]
82+
ANNO_AND_ERROR["discord.channel.StageChannel"] = ANNO_AND_ERROR["discord.StageChannel"]
83+
ANNO_AND_ERROR["discord.channel.ForumChannel"] = ANNO_AND_ERROR["discord.ForumChannel"]
7884
ANNO_AND_ERROR["discord.threads.Thread"] = ANNO_AND_ERROR["discord.Thread"]
7985
ANNO_AND_ERROR["discord.guild.Guild"] = ANNO_AND_ERROR["discord.Guild"]
8086
ANNO_AND_ERROR["discord.message.Message"] = ANNO_AND_ERROR["discord.Message"]
@@ -678,6 +684,12 @@ async def cast_basic_arg(ctx: commands.Context, anno: str, arg: Any) -> Any:
678684
"discord.abc.GuildChannel",
679685
"discord.TextChannel",
680686
"discord.channel.TextChannel",
687+
"discord.VoiceChannel",
688+
"discord.channel.VoiceChannel",
689+
"discord.StageChannel",
690+
"discord.channel.StageChannel",
691+
"discord.ForumChannel",
692+
"discord.channel.ForumChannel",
681693
"discord.Thread",
682694
"discord.threads.Thread",
683695
):

0 commit comments

Comments
 (0)