В вашем сообщении о событии
client.on('message', async msg => {
msg.content = filter(msg.content)
let channelid1 = 'xxxx' //
let channelid2 = 'xx' //
if (msg.channel.id == channelid1 && msg.author.id != client.user.id) {
let attach = msg.attachments.array()
let test = getUrls(msg.content);
let arr = Array.from(test);
let emojiname = ''
if (msg.content.startsWith("<:uparrow:")) {
emojiname = 'uparrow'
} else if (msg.content.startsWith("<:downarrow:")) {
emojiname = 'downarrow'
}
let name = msg.guild.emojis.find(emoji => emoji.name == emojiname);
let embed = new Discord.RichEmbed()
.setDescription(msg.content)
.setColor('#A9A9A9')
if (name) {
start("Bot token xxxxx", 'Landing Discord channel ID xxx', embed, name)
} else {
start("Bot token xxxxx", 'Landing Discord channel ID xxx', embed)
}
if(arr.length > 0){
for(let i in arr){
start("Bot token xxxxx", 'Landing Discord channel ID xxx', arr[i])
}
}
if (attach.length > 0) {
start("Bot token xxxxx", 'Landing Discord channel ID xxx', attach[0].url)
}
client.login('Client token xxxx') //
}
Вам необходимо удалить вызов функции входа в систему
client.login('Client token xxxx')
, так как вы не хотите, чтобы ваш бот повторно входил в систему каждый раз, когда происходило событиеуволен.