Answer the question
In order to leave comments, you need to log in
How to make a bot that accepts applications and the admin accepted by clicking on the buttons and the person was given a role?
@slash.slash(name = 'inv', description = 'Заявка"',
options = [{'name': "test",
'description': "Test cmd",
'type': 3,
'requied': True},
])
async def __inv__(ctx, test):
role = guild.get_role('904345147322544129')
msg = await ctx.send(
embed = discord.Embed(title = f'<@{ctx.author.id}>' ,embed = discord.Embed(title = 'Новая заявка!',description = f'**```{test}```**'),
components = [
Button(style = ButtonStyle.blue, label = 'Принять'),
Button(style = ButtonStyle.red, label = 'Отклонить'),
])
responce = await client.wait_for('button_click', check = lambda message: message.author == ctx.author)
if responce.component.label == 'Отклонить':
await ctx.author.send(embed = discord.Embed(description = f'Приветствую {ctx.author.name}, вашу заявку отклонили!', color=0x4169E1))
else:
await ctx.author.add_roles(role)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question