From 29d40cd80f38284ef3a66eeea390f1eddd020915 Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Sun, 11 Aug 2024 19:04:22 +0100 Subject: [PATCH] Fix up checking the auth scope for sending the button --- py/matchy.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/py/matchy.py b/py/matchy.py index f3e970d..c352f53 100755 --- a/py/matchy.py +++ b/py/matchy.py @@ -145,13 +145,14 @@ async def match(interaction: discord.Interaction, members_min: int = None): view = discord.utils.MISSING if State.get_user_has_scope(interaction.user.id, state.AuthScope.MATCHER): - # Let a non-matcher know why they don't have the button - msg += f"\n\nYou'll need the {state.AuthScope.MATCHER} scope to post this to the channel, sorry!" - else: # Otherwise set up the button msg += "\n\nClick the button to match up groups and send them to the channel.\n" view = discord.ui.View(timeout=None) view.add_item(DynamicGroupButton(members_min)) + else: + # Let a non-matcher know why they don't have the button + msg += f"\n\nYou'll need the { + state.AuthScope.MATCHER} scope to post this to the channel, sorry!" await interaction.response.send_message(msg, ephemeral=True, silent=True, view=view)