fix (schedule): Require existent Channels.
This commit is contained in:
@@ -51,6 +51,8 @@ class ScheduleSettings(SettingGroup):
|
||||
|
||||
_model = ScheduleData.ScheduleGuild
|
||||
_column = ScheduleData.ScheduleGuild.lobby_channel.name
|
||||
_allow_object = False
|
||||
|
||||
|
||||
@property
|
||||
def update_message(self):
|
||||
@@ -110,6 +112,7 @@ class ScheduleSettings(SettingGroup):
|
||||
|
||||
_model = ScheduleData.ScheduleGuild
|
||||
_column = ScheduleData.ScheduleGuild.room_channel.name
|
||||
_allow_object = False
|
||||
|
||||
@property
|
||||
def update_message(self):
|
||||
@@ -424,6 +427,7 @@ class ScheduleSettings(SettingGroup):
|
||||
|
||||
_model = ScheduleData.ScheduleGuild
|
||||
_column = ScheduleData.ScheduleGuild.blacklist_role.name
|
||||
_allow_object = False
|
||||
|
||||
@property
|
||||
def update_message(self):
|
||||
|
||||
@@ -237,6 +237,7 @@ class ChannelSetting(Generic[ParentID, CT], InteractiveSetting[ParentID, int, CT
|
||||
|
||||
_selector_placeholder = "Select a Channel"
|
||||
channel_types: list[discord.ChannelType] = []
|
||||
_allow_object = True
|
||||
|
||||
@classmethod
|
||||
def _data_from_value(cls, parent_id, value, **kwargs):
|
||||
@@ -255,7 +256,7 @@ class ChannelSetting(Generic[ParentID, CT], InteractiveSetting[ParentID, int, CT
|
||||
if data is not None:
|
||||
bot = ctx_bot.get()
|
||||
channel = bot.get_channel(data)
|
||||
if channel is None:
|
||||
if channel is None and cls._allow_object:
|
||||
channel = discord.Object(id=data)
|
||||
return channel
|
||||
|
||||
|
||||
Reference in New Issue
Block a user