错误:
TypeError: Cannot read property 'roles' of null
at Object.process (/home/bots/fortnite-bot/commands/stats/stats.js:19:33)
行(stats.js):
let platform = message.member.roles.find(x => (x.id === psnRoleId) || (x.id === xboxRoleId))
请帮助....
答案 0 :(得分:0)
自从 Discord.JS v12 出来后,你必须用 message.member.roles.find()
代替 message.member.roles.cache.find()
。该函数在您使用它的上下文中以完全相同的方式工作,您只需要在其中添加 .cache
。