python
でボタン機能を作り押したらroleが付与されるものを作ろうとしましたボタンはできましたがなぜかroleが付与されません
import discord
from discord.ext import commands
#pip install discord-buttons-plugin
from discord_buttons_plugin import *
#pip install requests
import requests
bot = commands.Bot(command_prefix = "yu!")
buttons = ButtonsClient(bot)
@bot.event
async def on_ready():
print("準備完了")
@buttons.click
async def button_hello(ctx):
member = await button_hello.guild.get_member(button_hello.user.id)
await ctx.user.add_roles(1002207471814848633)
@bot.command()
async def create(ctx):
await buttons.send(
content = "認証",
channel = ctx.channel.id,
components = [
ActionRow([
Button(
label=" ここをクリック",
style=ButtonType().Primary,
custom_id="button_hello"
)
])
]
)
bot.run("とけn")
を今使ってます なぜ付与されないのか教えてもらいたいです
追記いろんなサイトを見てもわかりません
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。