aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/exts/info/subscribe.py10
1 files changed, 10 insertions, 0 deletions
diff --git a/bot/exts/info/subscribe.py b/bot/exts/info/subscribe.py
index db66069b6..3cde07aee 100644
--- a/bot/exts/info/subscribe.py
+++ b/bot/exts/info/subscribe.py
@@ -82,6 +82,16 @@ class RoleButtonView(discord.ui.View):
row = index // ITEMS_PER_ROW
self.add_item(SingleRoleButton(role, role.role_id in author_roles, row))
+ async def interaction_check(self, interaction: Interaction) -> bool:
+ """Ensure that the user clicking the button is the member who invoked the command."""
+ if interaction.user != self.interaction_owner:
+ await interaction.response.send_message(
+ ":x: This is not your command to react to!",
+ ephemeral=True
+ )
+ return False
+ return True
+
class SingleRoleButton(discord.ui.Button):
"""A button that adds or removes a role from the member depending on its current state."""