【发布时间】:2019-09-04 07:55:33
【问题描述】:
如何在 discord.js 中读取 args?我正在尝试创建一个支持机器人,并且我想要一个 !help {topic} 命令。我怎么做?
我当前的代码非常基础
const Discord = require('discord.js');
const client = new Discord.Client();
const prefix = ("!")
const token = ("removed")
client.on('ready', () => {
console.log(`Logged in as ${client.user.tag}!`);
});
client.on('message', msg => {
if (msg.content === 'ping') {
msg.reply('pong');
}
if (msg.content === 'help') {
msg.reply('type -new to create a support ticket');
}
});
client.login(token);
【问题讨论】:
标签: discord.js