【发布时间】:2019-09-16 07:05:24
【问题描述】:
我正在尝试为 discord bot 编写 javascript 代码。因此,当我将消息内容添加为 '+epic' 时,机器人需要发送带有史诗昵称但在一列中而不是像现在这样在一两行中的消息。有人可以为此建议正确的实现吗?
const Discord = require('discord.js');
const Discord = require('discord.js');
const client = new Discord.Client();
const auth = require('./auth.json');
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on('message', msg => {
if (msg.content === '+epic') {
msg.reply('lista epic nikova klana je: name - nick1, name - nick2, name - nick3, name - nick4, name - nick5, ...');
}
});
client.login(auth.token);
【问题讨论】:
-
欢迎来到 Stack Overflow!请使用tour 并阅读有关如何创建minimal, complete, and verifiable example 的信息。这将使那些试图帮助您的人更轻松,并增加您快速找到问题解决方案的机会。
标签: javascript node.js bots discord