我的discord bot命令返回相同的响应3次

时间:2020-11-03 11:16:18

标签: node.js discord.js

我有一个不和谐的漫游器,当我在频道中输入ping!时,漫游器会用pong!回复三遍:

enter image description here

这是我的代码:

const Discord = require("discord.js");
const client = new Discord.Client();

client.once("ready", () => {
    console.log("Ready");

});

client.login("NzcyNzI0MDYzMTc3MTQ2MzY4.X5-1XQ.2xXEMz_ZNAYuHK9GbokDixIOCsY");

client.on("message", message =>{
    if(message.content === "!ping") {
        message.channel.send("Pong!");
    }else if(message.content === "Hi!") {
        message.channel.send("Hello");
    }
    
});

我该如何解决?

0 个答案:

没有答案