mirror of
https://github.com/hencaric/SCNewsBot.git
synced 2026-11-16 01:43:56 +00:00
fix button permission bug
This commit is contained in:
1 parent
231da5e507
commit
d2f0f3230c
1 file changed
+12
@@ -303,6 +303,12 @@ class AnnouncementBuilderView(discord.ui.View):
|
||||
async def toggle_private(
|
||||
self, interaction: discord.Interaction, button: discord.ui.Button
|
||||
) -> None:
|
||||
if not self._has_permission(interaction.user):
|
||||
await interaction.response.send_message(
|
||||
"You cannot use this menu.", ephemeral=True
|
||||
)
|
||||
return
|
||||
|
||||
self.announcement_builder.announcement.is_private = (
|
||||
not self.announcement_builder.announcement.is_private
|
||||
)
|
||||
@@ -319,6 +325,12 @@ class AnnouncementBuilderView(discord.ui.View):
|
||||
async def toggle_notification(
|
||||
self, interaction: discord.Interaction, button: discord.ui.Button
|
||||
) -> None:
|
||||
if not self._has_permission(interaction.user):
|
||||
await interaction.response.send_message(
|
||||
"You cannot use this menu.", ephemeral=True
|
||||
)
|
||||
return
|
||||
|
||||
self.announcement_builder.announcement.will_notify = (
|
||||
not self.announcement_builder.announcement.will_notify
|
||||
)
|
||||
|
||||
Reference in new issue
Block a user