Skip to content

Commit 718f2f2

Browse files
committed
Fix for change to single channel support in chatRole
1 parent c0fc706 commit 718f2f2

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

events/chatRole.py

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ async def _chatrole_start(
5353
self,
5454
interaction: discord.Interaction,
5555
role: discord.Role,
56-
channel_or_catagories: typing.Union[discord.TextChannel, discord.CategoryChannel],
56+
channel_or_catagory: typing.Union[discord.TextChannel, discord.CategoryChannel],
5757
notify_users: bool,
5858
):
5959
if self.active:
@@ -63,13 +63,12 @@ async def _chatrole_start(
6363
self.role = role.id
6464
self.ids = {'text': [], 'cat': []}
6565

66-
for channel in [channel_or_catagories]:
67-
if isinstance(channel, discord.channel.TextChannel):
68-
self.ids['text'].append(channel.id)
69-
elif isinstance(channel, discord.channel.CategoryChannel):
70-
self.ids['cat'].append(channel.id)
71-
else:
72-
return await interaction.response.send_message(f'{config.redTick} Invalid channel type: {channel}')
66+
if isinstance(channel_or_catagory, discord.channel.TextChannel):
67+
self.ids['text'].append(channel_or_catagory.id)
68+
elif isinstance(channel_or_catagory, discord.channel.CategoryChannel):
69+
self.ids['cat'].append(channel_or_catagory.id)
70+
else:
71+
return await interaction.response.send_message(f'{config.redTick} Invalid channel type: {channel}')
7372

7473
self.active = True
7574
return await interaction.response.send_message(

0 commit comments

Comments
 (0)