![](/img/trans.png)
[英](Discord.js) How do i get all the members connected to the voice channels of a category?
[英]Discord.js How access to voice channel in voice channels in category?
var category = client.guilds.get('269811924399685634').channels.get('691715649625653450');
var voice_channels = category.children.find(c => c.type == 'voice');
我是這樣設置的。 我正在獲取語音頻道,但我無法刪除此類別中的某個語音頻道。
您要刪除獲得的頻道嗎? - 機器人有權限嗎?
var voice_channels = category.children.find(c => c.type == 'voice');
- 返回第一個語音通道
如果要獲取每個頻道,請使用:
var voice_channels = category.children.filter(c => c.type == 'voice');
刪除頻道: https : //discord.js.org/#/docs/main/stable/class/Channel?scrollTo=delete
var voice_channels = category.children.filter(c => c.type == 'voice');
//Discord.js version 12 (I believe)
var channels = voice_channels.map(e => client.channels.resolve(e))
channels[1].delete()
//use client.channels.get(e) in older versions
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.