【发布时间】:2020-11-15 03:01:06
【问题描述】:
所以我正在开发我的机器人,对于我的;say 命令,我有以下代码。问题是,当用户执行“;say hi”之类的操作时,它会重复为 ;say 在一行上,下一行,然后在那一行上说 hi。在我添加命令处理程序之前,该命令运行良好,但现在我遇到了问题。
代码(包括 vars + command handler 部分)-
const Prefix = require('./../../config.json');
module.exports = {
name: "say",
description: "Says the user input",
execute (Client, message, Args) {
let Say = message.content.substring(({Prefix} + 'say').Args).split(" ");
let Output = Say.splice(1);
message.channel.send(Output);
message.delete({ timeout: 1 });
},
};
如果出于某种原因需要,我的 config.json 文件(可能是前缀问题)位于以下文件位置的“容器”目录中 -
container/commands/fun/say.js
【问题讨论】:
标签: discord discord.js