fix(config): Fix general settings UI.
This commit is contained in:
@@ -57,7 +57,7 @@ class TimerOptions(SettingGroup):
|
||||
_allow_object = False
|
||||
|
||||
@classmethod
|
||||
async def _check_value(cls, parent_id: int, value: Optional[discord.abc.GuildChannel], **kwargs):
|
||||
async def _check_value(cls, parent_id: int, value, **kwargs):
|
||||
if value is not None:
|
||||
# TODO: Check we either have or can create a webhook
|
||||
# TODO: Check we can send messages, embeds, and files
|
||||
|
||||
@@ -145,13 +145,11 @@ class TimerOptionsUI(MessageUI):
|
||||
value = selected.values[0] if selected.values else None
|
||||
setting = self.timer.config.get('notification_channel')
|
||||
|
||||
if issue := await setting._check_value(self.timer.data.channelid, value):
|
||||
await selection.edit_original_response(embed=error_embed(issue))
|
||||
else:
|
||||
setting.value = value
|
||||
await setting.write()
|
||||
await self.timer.send_status()
|
||||
await self.refresh(thinking=selection)
|
||||
await setting._check_value(self.timer.data.channelid, value)
|
||||
setting.value = value
|
||||
await setting.write()
|
||||
await self.timer.send_status()
|
||||
await self.refresh(thinking=selection)
|
||||
|
||||
async def refresh_notification_menu(self):
|
||||
self.notification_menu.placeholder = self.bot.translator.t(_p(
|
||||
|
||||
Reference in New Issue
Block a user