如何向不一致按下按钮的用户发送dm?
await ctx.send(
embed = emb,
components=[
Button(style=ButtonStyle.green, label="Buy!")
]
)
response = await Bot.wait_for("button_click")
if response.channel == ctx.channel:发布于 2021-07-11 16:16:47
首先,你需要得到按下那个按钮的用户,不确定这个按钮是否有效,但是也许可以发送user = response.author,然后你就可以像这样发送dm了,await user.send(your_text_here_must_send_as_string)。如果response.author不起作用,您必须获取用户的id,然后像下面的user = Bot.fetch_user(id_of_user_as_int)一样获取它
https://stackoverflow.com/questions/68329683
复制相似问题