[英](discord.js) Select specific channel in a guild
我需要這個工作,但我不知道變量 selectedchannel 是什么。 我需要刪除 710069375184404500 頻道上的所有消息。 我正在使用v12 Discord.js。
var selectedchannel = .....
selectedchannel.messages.fetch({ limit: 99 }).then(messages => {
selectedchannel.bulkDelete(messages)
});
您可以通過首先獲取頻道來實現此目的。
var selectedchannel = client.channels.cache.get('710069375184404500')
selectedchannel.messages.fetch({ limit: 99 }).then(messages => {
selectedchannel.bulkDelete(messages)
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.