Fix rolegiver
This commit is contained in:
parent
dd3cc69394
commit
98cea4a4e6
1 changed files with 40 additions and 24 deletions
|
@ -230,13 +230,24 @@ class RolegiverCog(commands.Cog):
|
||||||
select = create_select(
|
select = create_select(
|
||||||
options=options,
|
options=options,
|
||||||
custom_id="to_delete",
|
custom_id="to_delete",
|
||||||
placeholder="Select roles to remove",
|
placeholder="Select roles to add",
|
||||||
min_values=1,
|
min_values=1,
|
||||||
max_values=len(options),
|
max_values=len(options),
|
||||||
)
|
)
|
||||||
components = [create_actionrow(select)]
|
components = [create_actionrow(select)]
|
||||||
|
|
||||||
_ = await ctx.send(content="\u200b", components=components)
|
message = await ctx.send(content="\u200b", components=components)
|
||||||
|
|
||||||
|
try:
|
||||||
|
|
||||||
|
context = await wait_for_component(
|
||||||
|
self.bot,
|
||||||
|
check=lambda x: ctx.author.id == x.author.id,
|
||||||
|
message=message,
|
||||||
|
timeout=60 * 5,
|
||||||
|
)
|
||||||
|
|
||||||
|
role = ctx.guild.get_role(context.selected_options[0])
|
||||||
|
|
||||||
await ctx.author.add_roles(role, reason="Rolegiver")
|
await ctx.author.add_roles(role, reason="Rolegiver")
|
||||||
|
|
||||||
|
@ -266,6 +277,11 @@ class RolegiverCog(commands.Cog):
|
||||||
embed.set_footer(text=f"{ctx.author.name}#{ctx.author.discriminator} | {ctx.author.id}")
|
embed.set_footer(text=f"{ctx.author.name}#{ctx.author.discriminator} | {ctx.author.id}")
|
||||||
|
|
||||||
await ctx.send(embed=embed)
|
await ctx.send(embed=embed)
|
||||||
|
except asyncio.TimeoutError:
|
||||||
|
for row in components:
|
||||||
|
for component in row["components"]:
|
||||||
|
component["disabled"] = True
|
||||||
|
await message.edit(components=components)
|
||||||
|
|
||||||
@cog_ext.cog_subcommand(
|
@cog_ext.cog_subcommand(
|
||||||
base="role",
|
base="role",
|
||||||
|
|
Loading…
Add table
Reference in a new issue