This commit is contained in:
insert 2024-08-09 10:26:25 -04:00
parent 77f5acc290
commit 0cc57c78d5
Signed by: insert
GPG key ID: A70775C389ACF105

View file

@ -11,17 +11,19 @@ class RoleView(nextcord.ui.View):
def __init__(self,bot): def __init__(self,bot):
super().__init__(timeout=None) super().__init__(timeout=None)
self.bot = bot self.bot = bot
async def buttoncallback(self, button: nextcord.ui.Button, interaction: nextcord.Interaction) -> None:
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}") #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 = nextcord.ui.Button(label="Test", style=nextcord.ButtonStyle.gray, custom_id="rolebutton:821095192831852554")
button.callback = buttoncallback button.callback = self.buttoncallback
self.add_item(button) self.add_item(button)
button = nextcord.ui.Button(label="Test 2", style=nextcord.ButtonStyle.gray, custom_id="rolebutton:1058708072064884736") button = nextcord.ui.Button(label="Test 2", style=nextcord.ButtonStyle.gray, custom_id="rolebutton:1058708072064884736")
button.callback = buttoncallback button.callback = self.buttoncallback
self.add_item(button) self.add_item(button)
async def buttoncallback(self, interaction: nextcord.Interaction) -> None:
await interaction.response.send_message(f"user requested role", ephemeral=True)
return
class rolebutton(commands.Cog): class rolebutton(commands.Cog):