discord - 静音每个频道 discord.js 中的角色
问题描述
我尝试在每个频道中静音一个名为“mutedRole”的角色,所以我输入了一些代码,这是代码:
if(message.content === `${prefix}mute`) {
message.guild.channels.cache.forEach((channel) => {
channel.updateOverwrite(channel.guild.roles.mutedRole, {
SEND_MESSAGES: false
})
.then(channel => console.log(channel.permissionOverwrites.get(message.author.id)))
.catch(console.error);
});
}
但是现在,当我输入 !mute 时,它给了我以下错误:
TypeError [INVALID_TYPE]: Supplied parameter is not a User nor a Role.
如何在每个频道中静音角色“mutedRole”?
问候:)
解决方案
推荐阅读
- arrays - 从python中的函数获取变量列表
- yocto - 尝试构建 bsp 配方,但发生错误需要构建目标“sysdig-driver”
- php - 使用 $_POST 中的变量来查询数据库
- grails - 如何在 input 元素的 value 字段中发送 JSon 对象
- pyspark - Pyspark如何将行附加到BigQuery表
- css - 当在其中打开 Mat-chip-autocomplete 时,Angular Material Mat-Menu 叠加层的高度不会增加
- flutter - 颤振:CustomPainter 目标图像未落在 BlendMode.src 上
- php - 如何从 AT 回复的响应中获得平衡?
- c# - MongoDB Driver C# 仅反序列化对象内的一半对象键
- python - TypeError: 'int' 对象在使用 pandas read_csv() 时不可下标