fix: Better input handling for linker channelid arg

This commit is contained in:
2025-09-18 13:18:54 +10:00
parent 657968e117
commit 4375dd9deb

View File

@@ -277,8 +277,11 @@ class VoiceFixCog(LionCog):
maybe_channels = [
channel1, channel2, channel3, channel4, channel5,
]
if channelid and channelid.isdigit():
channel = self.bot.get_channel(int(channelid))
if channelid:
if not channelid.isdigit():
return await ctx.error_reply("Channel id provided must be an integer!")
if not (channel := self.bot.get_channel(int(channelid))):
return await ctx.error_reply("Could not find a channel with the provided id!")
maybe_channels.append(channel)
channels = [channel for channel in maybe_channels if channel]