[英]I keep receiving a error when trying to give roles
I have a small piece of code that reads from a mongodb database and give them the role in the database我有一小段代码从 mongodb 数据库中读取并赋予它们在数据库中的角色
The command requires the user to tag the person they wish to update, what am i doing wrong?该命令要求用户标记他们希望更新的人,我做错了什么?
msg.mentions.members.first().addRole(msg.guild.roles.find(r => r.name === result[0].MainRank));
This is the error:这是错误:
TypeError: msg.guild.roles.find is not a function
You now have to use msg.guild.roles.cache.find
, since v12 uses Managers.您现在必须使用msg.guild.roles.cache.find
,因为 v12 使用管理器。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.