到目前为止,我已经知道了:
function dailylot(){
let channel = message.guild.channels.find(channel => channel.name === "general69420")
if(!channel){return;}
channel.send(".")
return;
}
function settimer(){
setTimeout(() => {
settimer()
dailylot()
console.log("Cycle")
},5000)
}
while (i < 1){
console.log("set timer " + i);
settimer()
i++;
}
此操作有效,但仅对发送邮件的服务器有效。即使删除了While,因此它多次激活,也只想转到一台服务器。如何检索所有服务器的通道? bot.guilds.channels不是问题。