小编Pho*_*nix的帖子

如何检测机器人是否被提及?

如何检测是否提到了我的机器人?

到目前为止,我尝试了这些:

if (msg.content.toLowerCase().includes('@The Guardian of The Bar#5180')) {
  msg.channel.send("My prefix here is" + prefix + "\n You can start with ``" + prefix + "help``");
}
Run Code Online (Sandbox Code Playgroud)

if (msg.content.toLowerCase().includes('@The Guardian of The Bar')) {
  msg.channel.send("My prefix here is" + prefix + "\n You can start with ``" + prefix + "help``");
}
Run Code Online (Sandbox Code Playgroud)

if (msg.content.includes('@The Guardian of The Bar#5180')) {
  msg.channel.send("My prefix here is" + prefix + "\n You can start with ``" + prefix + "help``");
}
Run Code Online (Sandbox Code Playgroud)

if (msg.content.includes('@The Guardian …
Run Code Online (Sandbox Code Playgroud)

javascript node.js discord.js

2
推荐指数
1
解决办法
1万
查看次数

标签 统计

discord.js ×1

javascript ×1

node.js ×1