Сообщество IT-специалистов
Ответы на любые вопросы об IT
Профессиональное развитие в IT
Удаленная работа для IT-специалистов
@bot.command() async def help(ctx): embed = discord.Embed(title="Вызываю саппорта?") row_of_buttons = ActionRow( Button(style=ButtonStyle.green, label="Да", custom_id="yes"), Button(style=ButtonStyle.red, label="Нет", custom_id="no") msg = await ctx.send(embed=embed, components=[row_of_buttons]) @bot.event async def on_button_click(ctx): if ctx.component.custom_id == "yes": await msg.edit(f"Окей, вызываю саппорта, <@Тут айди роли или юзера>") if ctx.component.custom_id == "no": await msg.edit("Тогда идите нахуй :>")
from dislash import SlashClient, Option, OptionType, ActionRow, Button, ButtonStyle, slash_command
pip3 install discord==1.7.3 pip3 install discord.py==1.7.3
@slash.command( name='play' description='test' )
@slash.command( name="play", description="Начать воспроизведение", )
@client.command() AttributeError: 'Client' object has no attribute 'command'
То - что надо импортировать для библиотеки dislash: