【发布时间】:2019-04-12 10:27:25
【问题描述】:
The line where i want to mention the user with @
first part of the code1 2nn part of the code after the mention i want to apply2 我正在开发一个不和谐的机器人,我希望机器人提及应用该命令的用户。我可以向您展示更多代码。这有点复杂。我尝试了很多次 Mention.user 和其他一些常见的答案,但什么也没发生。
ps。编辑:如果够的话,我还提供了 2 张带有代码的图像 :)
【问题讨论】:
-
请在您的问题中发布代码,而不是在图片中。
-
你使用什么 discordAPI?此外,没有库可以发送“@User”来提及某人,在 discord.py 中您必须发送 userObject.mention(),在 discord.js 中您必须发送用户对象。不懂语言我们无能为力
-
好的,感谢您回答我,我正在使用 discord.js (Javascript)。那我该怎么办? @TomMartin。你说我必须发送用户对象?我对javascript不太熟悉,你是什么意思?提前谢谢你,我感谢你的帮助:)
-
@BillPapadodemas 是您要在
client.on("message"或bot.on("message"中提及用户的“行”吗?如果是,您将可以message.channel.send(`${message.member.user} You are being mentioned!`)我将在答案中添加更多信息 -
另外,切勿发布代码图片。请,为了我的理智。
标签: node.js visual-studio-code discord mention