var category = client.guilds.get('269811924399685634').channels.get('691715649625653450');
var voice_channels = category.children.find(c => c.type == 'voice');
我已经设置好了。我正在获取语音通道,但无法删除此类别的某个语音通道。
答案 0 :(得分:0)
您要删除获得的频道吗? -该机器人具有权限吗?
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