'How can I give a role to the bot?
I have created a role and want to give it to the bot. How can I do this? I have the role as var 'role'. I can't figure out how to give the bot itself a role, just other members.
Solution 1:[1]
client.on('messageCreate', (message) => {
message.guild.members.cache.get("your bot id").roles.add("rol id")
})
Try this. When you post a message, you will add a role to your bot (discord v13). If you want an example for your case, post what you want exactly.
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|---|
| Solution 1 | Yulius |
