我希望您就我创建的一个功能寻求帮助,该功能允许刷新列表中的频道,但我有一个问题,每 10 秒内存只会增加一次,而且她永远不会清空自己。找了5个多小时,即使我认为这是一个愚蠢的事情,提前谢谢你的帮助(对不起翻译,我不是英语)
我的代码:
updateChannel: async function(client, newList){
let a = setInterval(async ()=> {
for(let i = 0; i < newList.length; i++){
const message = await this.replace$Var(client, newList[i][1])
const channel = await client.channels.get(newList[i][0])
channel.setName(message).catch(err => {
console.log(`The channel with the id : ${newList[i][0]} was deleted, please restart the bot`)
newList.splice(i,1)
i-=1
})
}
clearInterval(a)
this.updateChannel(client, newList)
}, 10000)
}
守着一只汪
慕雪6442864
相关分类