Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

message.guild.roles.find is not a function

Tags:

discord.js

EDITED FOR SELF ANSWER

message.guild.roles.find is not a function Is a result of using a DJS v11 method on DJS v12, in other words message.guild.roles.find is outdated and should be replaced with

message.guild.roles.cache.find

DJS v11 is now discontinued. Follow this guide to update your code for v12 Here

like image 352
Elitezen Avatar asked Mar 03 '23 17:03

Elitezen


1 Answers

Yes, you now have to use message.guild.roles.cache.find, since v12 uses Managers. You can read the documentation to find the other changes by yourself ^^

like image 90
Androz2091 Avatar answered Mar 07 '23 07:03

Androz2091