Update
This commit is contained in:
parent
9a522aa71d
commit
08986386b3
1 changed files with 5 additions and 3 deletions
|
@ -60,7 +60,7 @@ class rolebutton(commands.Cog):
|
|||
await interaction.response.send_message(view=RoleView(self.bot))
|
||||
|
||||
@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)
|
||||
|
@ -71,8 +71,10 @@ class rolebutton(commands.Cog):
|
|||
res = await self.bot.cur.execute(f"SELECT roleid FROM rolebutton WHERE serverid = {interaction.guild.id}")
|
||||
res = await res.fetchall()
|
||||
buttonlist.clear()
|
||||
for r in res:
|
||||
button = nextcord.ui.Button(label="r", style=nextcord.ButtonStyle.gray, custom_id=f"rolebutton:{r}")
|
||||
for [r] in res:
|
||||
role = interaction.guild.get_role(int(r))
|
||||
role.name
|
||||
button = nextcord.ui.Button(label=role.name, style=nextcord.ButtonStyle.gray, custom_id=f"rolebutton:{role.id}")
|
||||
buttonlist.append(button)
|
||||
await message.edit(view=RoleView(self.bot))
|
||||
await interaction.response.send_message("Edited!", ephemeral=True)
|
||||
|
|
Loading…
Reference in a new issue