Answer the question
In order to leave comments, you need to log in
How to understand who clicked on a button in discord.py?
I have a command:
i = False
@bot.command(aliases=['t2'])
#@commands.has_any_role(890220161943097404)
async def testinfinitybutton(ctx):
emb = discord.Embed(title='Нажмите на кнопку')
emb.set_thumbnail(url=ctx.author.avatar_url)
msg = await ctx.send(embed = emb,
components = [
Button(style=ButtonStyle.gray, label='Роль', emoji='')
])
while i == False:
responce = await bot.wait_for('button_click')
if responce.component.label == 'Роль':
await responce.respond(content="держи свою роль)")
import discord
from discord.embeds import Embed
from discord.ext import commands
from discord.ext.commands import Bot
from discord import member
import asyncio
import os
import string
import json
from discord import Activity, ActivityType
from discord.utils import *
import io
import time
import string
from discord_components import *
from dislash import *
import requests
import random
import re
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