【发布时间】:2018-07-28 10:48:22
【问题描述】:
const Discord = require('discord.js');
const bot = new Discord.Client();
bot.on('message', (message) => {
if(message.content == 'ping') {
message.reply('Pong');
}
});
bot.login('my token is here');
当用户说出包含“服务器 IP”的内容时,我希望我的机器人说些什么 我目前有这个代码,但它只在我发送“ping”时回复,我怎样才能让它检测到句子中是否有“ping”这个词?
【问题讨论】:
标签: javascript bots discord