From e5cd16a51989cae9cad17d1ebf89b8b61f3ba24e Mon Sep 17 00:00:00 2001 From: insert Date: Fri, 9 Aug 2024 09:52:31 -0400 Subject: [PATCH] Update --- rolebuttons.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/rolebuttons.py b/rolebuttons.py index 7e72dfe..108305e 100644 --- a/rolebuttons.py +++ b/rolebuttons.py @@ -11,18 +11,18 @@ class RoleView(nextcord.ui.View): def __init__(self,bot): super().__init__(timeout=None) self.bot = bot - + async def buttoncallback(self, button: nextcord.ui.Button, interaction: nextcord.Interaction): + await interaction.response.send_message(f"user requested role {button.custom_id}", ephemeral=True) + return #res = await self.bot.cur.execute(f"SELECT roleid FROM rolebutton WHERE serverid = {self.bot.roleguild.id}") button = nextcord.ui.Button(label="Test", style=nextcord.ButtonStyle.gray, custom_id="rolebutton:821095192831852554") - button.callback = callback() + button.callback = buttoncallback() self.add_item(button) button = nextcord.ui.Button(label="Test 2", style=nextcord.ButtonStyle.gray, custom_id="rolebutton:1058708072064884736") - button.callback = callback() + button.callback = buttoncallback() self.add_item(button) - async def callback(self, button: nextcord.ui.Button, interaction: nextcord.Interaction): - await interaction.response.send_message(f"user requested role {button.custom_id}", ephemeral=True) - return + class rolebutton(commands.Cog):