Update
This commit is contained in:
parent
e6d0557f58
commit
e5cd16a519
1 changed files with 6 additions and 6 deletions
|
@ -11,18 +11,18 @@ 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):
|
||||||
#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()
|
|
||||||
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)
|
await interaction.response.send_message(f"user requested role {button.custom_id}", ephemeral=True)
|
||||||
return
|
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 = buttoncallback()
|
||||||
|
self.add_item(button)
|
||||||
|
button = nextcord.ui.Button(label="Test 2", style=nextcord.ButtonStyle.gray, custom_id="rolebutton:1058708072064884736")
|
||||||
|
button.callback = buttoncallback()
|
||||||
|
self.add_item(button)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class rolebutton(commands.Cog):
|
class rolebutton(commands.Cog):
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue