gpt4 book ai didi

javascript - 机器人不断重复

转载 作者:太空宇宙 更新时间:2023-11-04 01:52:16 25 4
gpt4 key购买 nike

这个不和谐的机器人不断重复它刚才所说的连接两个字符串!请帮忙!

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

client.on('message', (message) => {
if (message.content == prefix + 'test') {
message.channel.sendMessage("```User Bot is a way to get more users in your discord server. When you first invite the bot, it will create a channel called #invites. You can put your message in #invites by doing the command *message <message>. Doing this command will make the bot broadcast your message and your invite link so all people with the bot in there #invites channel will get the message.```");
} else if (message.content == prefix + 'setup') {
message.channel.sendMessage("```To setup User Bot, you must join the user bot discord listed here. https://discord.gg/amuzrvr, then in #bots type your message!");
} else if (message.channel.guild.name == 'UserBot' && message.channel.name == 'bots') {
channel(message);
}

});

function channel(message) {
message.channel.sendMessage("***A server! " + message.content + "!***")
}

最佳答案

我找到了一个答案,每次机器人说话时都会触发它,因为条件是相同的。

关于javascript - 机器人不断重复,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49204248/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com