From f535a5ace04d7bc0610dc0ffd8c07eb943aaad1c Mon Sep 17 00:00:00 2001 From: shtlrs Date: Sun, 12 Mar 2023 15:09:55 +0100 Subject: bring back the interaction_check This one is still needed for the `!subscribe` text command to work properly --- bot/exts/info/subscribe.py | 10 ++++++++++ 1 file changed, 10 insertions(+) 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.""" -- cgit v1.2.3