This commit is contained in:
insert 2024-08-10 16:27:03 -04:00
parent 49105886ec
commit 9a522aa71d
Signed by: insert
GPG key ID: A70775C389ACF105
2 changed files with 4 additions and 1 deletions

View file

@ -63,6 +63,7 @@ class gameutils(commands.Cog):
name="turngen", name="turngen",
description="Roll the next turn for a certian role", description="Roll the next turn for a certian role",
guild_ids=[699285282276507708], guild_ids=[699285282276507708],
default_member_permissions=nextcord.Permissions(manage_roles=True),
) )
@nextcord.ext.application_checks.has_permissions(manage_roles=True) @nextcord.ext.application_checks.has_permissions(manage_roles=True)
async def turngen(self, interaction: nextcord.Interaction, role: nextcord.Role): async def turngen(self, interaction: nextcord.Interaction, role: nextcord.Role):

View file

@ -13,6 +13,7 @@ class RoleView(nextcord.ui.View):
super().__init__(timeout=None) super().__init__(timeout=None)
self.bot = bot self.bot = bot
for b in buttonlist: for b in buttonlist:
b.callback = self.buttoncallback
self.add_item(b) self.add_item(b)
#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")
@ -51,6 +52,7 @@ class rolebutton(commands.Cog):
@nextcord.slash_command( @nextcord.slash_command(
name="rolebuttons", name="rolebuttons",
description="modify role buttons", description="modify role buttons",
default_member_permissions=nextcord.Permissions(manage_roles=True),
) )
async def rolebuttons(self, interaction: nextcord.Interaction): async def rolebuttons(self, interaction: nextcord.Interaction):
return return
@ -59,6 +61,7 @@ class rolebutton(commands.Cog):
@nextcord.message_command( @nextcord.message_command(
name="refresh role buttons", name="refresh role buttons",
default_member_permissions=nextcord.Permissions(manage_roles=True),
) )
@nextcord.ext.application_checks.has_permissions(manage_roles=True) @nextcord.ext.application_checks.has_permissions(manage_roles=True)
async def rolerefresh(self, interaction: nextcord.Interaction, message: nextcord.Message): async def rolerefresh(self, interaction: nextcord.Interaction, message: nextcord.Message):
@ -70,7 +73,6 @@ class rolebutton(commands.Cog):
buttonlist.clear() buttonlist.clear()
for r in res: for r in res:
button = nextcord.ui.Button(label="r", style=nextcord.ButtonStyle.gray, custom_id=f"rolebutton:{r}") button = nextcord.ui.Button(label="r", style=nextcord.ButtonStyle.gray, custom_id=f"rolebutton:{r}")
button.callback = RoleView.buttoncallback
buttonlist.append(button) buttonlist.append(button)
await message.edit(view=RoleView(self.bot)) await message.edit(view=RoleView(self.bot))
await interaction.response.send_message("Edited!", ephemeral=True) await interaction.response.send_message("Edited!", ephemeral=True)