fix (schedule): Validate session room.

This commit is contained in:
2023-08-18 22:12:52 +03:00
parent 6e2bf4154f
commit 0499946fad

View File

@@ -146,7 +146,17 @@ class ScheduledSession:
channel = self.bot.get_channel(channelid)
if channel is not None:
channels = self.channels_setting.value
return (not channels) or (channel in channels) or (channel.category and (channel.category in channels))
room = self.room_channel.value
valid = (
not channels
or (channel in channels)
or (channel == room)
or (channel.category and (
(channel.category in channels)
or (channel.category == room)
))
)
return valid
else:
return False