Find a role by name then update it
How do I find a role in a guild by it's name. Then update it's info?
Does this code work. Note that this is in the
guildCreate
event16 Replies
Unknown User•2y ago
Message Not Public
Sign In & Join Server To View
oh yeah
oops
thanks
<Collection>.find()
doesn't return a PromiseUnknown User•2y ago
Message Not Public
Sign In & Join Server To View
would that work instead?
.find()
returns a Role
or undefined
, not a Promise
You can't do .then()
would this work if I am trying to edit the bot's role?
No
roles.me is not a think
guild.roles.client.edit
?<Guild>.roles.botRoleFor(client.user).edit()
k
would
guild.client.user
work? or does it have to be client.user
?Yes, it would
k
I (Bot )has
ManageRoles
permission though
this is how i assign intents / patials
We highly recommend only specifying the intents you actually need.
• Note, that
98303
, 32767
or whatever other magic number you read that represents "all intents", gets outdated as soon as new intents are introduced.
• The number will always represent the same set of intents, and will not include new ones. There is no magic "all intents" bit.same error occurs every time
is this because the bot can't update it's own role?
^^^
If that role is it's highest role then it can't edit it