discord - discord.py 如何在服务器之间克隆频道?
问题描述
我正在尝试创建一个基本上可以复制服务器的机器人。不使用 discord.new/templates 的原因是这些只能用于新创建的服务器。
据我所知,频道和类别没有“权限”属性。有没有一种方法可以让我以某种方式查看频道的所有权限并将它们复制到不同服务器上的不同频道?
谢谢!
解决方案
它们被称为通道覆盖
获得频道的覆盖
overwrites = channel.overwrites # assuming channel is defined
然后在另一个公会
await guild.create_text_channel(..., overwrites=overwrites)
# the ... is just for example and you can have other arguments there to fit your needs
推荐阅读
- javascript - 使用 execCommand 复制的图像不会粘贴到任何地方
- android-mediacodec - Android MediaCodec onOutputBufferAvailable - 如何控制回调频率?
- python - Pandas 合并相同的值行并拆分不同的值列
- reactjs - axios 请求在 .forEach() 和 .map() 内都不起作用
- c# - Visual Studio 如何创建和运行 docker 容器?
- android - 在 Android 上的 Divider 上添加圆形 TextView 或 Button
- kotlin - 在kotlin中按子元素列表值对列表进行分组
- mysql - 主机组中的 proxysql SHUNNED 服务器
- react-native - 无法运行“npx react-native run-android”:无法识别的命令“run-android”
- flutter - 颤振:谷歌地图。如何通过这两种标记类型?