Sim*_*mon 4 javascript bots discord
我正在尝试制作一个机器人,每当有人说话时,它就会在频道中发送一条消息,表明该人在那里并正在等待某人加入。但是,它仅以纯文本形式打印@ne1(我希望它提及的角色)。另外,当我提到用户时,它只写入用户 ID,而不是实际发送 @(用户名)。
const Discord = require('discord.js');
const keepAlive = require('./server');
const client = new Discord.Client();
client.on('message', message => {
if (message.toString().toLowerCase().includes('ne1 here')) {
message.channel.send('@ne1, ' + message.author + ' is online and waiting for you to join!');
}
});
keepAlive();
client.login(process.env.TOKEN);Run Code Online (Sandbox Code Playgroud)
我想要的是它提及 @ne1 角色以及使用该命令运行机器人的人。它只打印:“@ne1 571713056673890324 在线,等待您加入!”
| 归档时间: |
|
| 查看次数: |
12039 次 |
| 最近记录: |