bots - 删除服务器中的所有 channel

标签 bots discord discord.js

我正在制作一个自动设置服务器的机器人,我想知道如何删除服务器中的所有 channel 和类别。

最佳答案

代码很简单:

message.guild.channels.forEach(channel => channel.delete())

应该可以的。

Remember to use this in response of a message, or message will be undefined

关于bots - 删除服务器中的所有 channel ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51201440/

相关文章:

ffmpeg - 错误 : FFMPEG not found

php - 调用函数时出错

bots - 当用户进入组时如何触发方法?

javascript - 类型错误 : Cannot read property 'user' of null | discord. js

javascript - Discord.js - 如何在一台服务器中切换命令?

node.js - 如何在discord bot中打破node js中的else语句

azure - 机器人如何发现我的 Azure 子域?

javascript - 如何找到discord机器人所连接的语音聊天

python - 如何修复 "UnicodeDecodeError: ' cp94 9' codec can' t 解码位置 24 : illegal multibyte sequence"中的字节 0xeb

python - Discord.py 重写 get_member() 函数为除 bot 之外的所有用户返回 None