From e6d0557f586da7f66b96952a7e4cfa8407c59d43 Mon Sep 17 00:00:00 2001 From: insert Date: Fri, 9 Aug 2024 09:49:30 -0400 Subject: [PATCH] Update --- rolebuttons.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/rolebuttons.py b/rolebuttons.py index a10d9e1..7e72dfe 100644 --- a/rolebuttons.py +++ b/rolebuttons.py @@ -13,9 +13,12 @@ class RoleView(nextcord.ui.View): self.bot = bot #res = await self.bot.cur.execute(f"SELECT roleid FROM rolebutton WHERE serverid = {self.bot.roleguild.id}") - - self.add_item(nextcord.ui.Button(label="Test", style=nextcord.ButtonStyle.gray, custom_id="rolebutton:821095192831852554")) - self.add_item(nextcord.ui.Button(label="Test 2", style=nextcord.ButtonStyle.gray, custom_id="rolebutton:1058708072064884736")) + button = nextcord.ui.Button(label="Test", style=nextcord.ButtonStyle.gray, custom_id="rolebutton:821095192831852554") + button.callback = callback() + self.add_item(button) + button = nextcord.ui.Button(label="Test 2", style=nextcord.ButtonStyle.gray, custom_id="rolebutton:1058708072064884736") + button.callback = callback() + 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)