Update
This commit is contained in:
parent
4ad76e1439
commit
a1b82d4a79
1 changed files with 5 additions and 6 deletions
|
@ -55,14 +55,13 @@ class rolebutton(commands.Cog):
|
||||||
self.bot.roleguild = interaction.guild
|
self.bot.roleguild = interaction.guild
|
||||||
await interaction.response.send_message(view=RoleView(self.bot))
|
await interaction.response.send_message(view=RoleView(self.bot))
|
||||||
|
|
||||||
@rolebuttons.subcommand(
|
@nextcord.message_command(
|
||||||
name="refresh",
|
name="refresh",
|
||||||
description="refresh a role selection message",
|
description="refresh a role selection message",
|
||||||
)
|
)
|
||||||
async def rolerefresh(self, interaction: nextcord.Interaction, msgid):
|
@nextcord.ext.application_checks.has_permissions(manage_roles=True)
|
||||||
msgid = int(msgid)
|
async def rolerefresh(self, interaction: nextcord.Interaction, message: nextcord.Message):
|
||||||
msg = await nextcord.abc.Messageable.fetch_message(self.bot, msgid)
|
if message.author.id != self.bot.application_id:
|
||||||
if msg.author.id != self.bot.application_id:
|
|
||||||
await interaction.response.send_message("I can't edit that message", ephemeral=True)
|
await interaction.response.send_message("I can't edit that message", ephemeral=True)
|
||||||
return
|
return
|
||||||
res = await self.bot.cur.execute(f"SELECT roleid FROM rolebutton WHERE serverid = {interaction.guild.id}")
|
res = await self.bot.cur.execute(f"SELECT roleid FROM rolebutton WHERE serverid = {interaction.guild.id}")
|
||||||
|
@ -71,7 +70,7 @@ class rolebutton(commands.Cog):
|
||||||
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
|
button.callback = RoleView.buttoncallback
|
||||||
RoleView.add_item(button)
|
RoleView.add_item(button)
|
||||||
await msg.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)
|
||||||
|
|
||||||
@rolebuttons.subcommand(
|
@rolebuttons.subcommand(
|
||||||
|
|
Loading…
Reference in a new issue