как сделать кнопку в discord.py
import discord
from discord.ext import commands
bot = commands.Bot(command_prefix='!', intents=discord.Intents.all())
# Create a class called MyView that subclasses discord.ui.View
class MyView(discord.ui.View):
# Create a button with the label "😎 Click me!" with color Blurple
@discord.ui.button(label="Click me!", style=discord.ButtonStyle.primary, emoji="😎")
async def button_callback(self, button, interaction):
await interaction.response.send_message("You clicked the button!")
@bot.command()
async def pon(ctx):
await ctx.send('ticet',view=MyView())
bot.run(token)
вот код и он не работает я не знаю почему
Источник: Stack Overflow на русском