Nabrok / gw2-discord-bot

Discord bot for the Guild Wars 2 API.
GNU General Public License v3.0
33 stars 25 forks source link

Link command not applying role #13

Closed frodesigns closed 7 years ago

frodesigns commented 7 years ago

Hello,

I'm trying to get the "link" command to add a role to the user, but it is not applying the role.

Console shows this error during the process:

(node:22586) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: Forbidden
(node:22586) DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

config snippet:

[world]
id = 1005 # world member has to be on to get in role, and default world for wvw stuffs.
role = "maguuma" # Name of the role, leave blank if you don't want this

Any thoughts or ideas?

Nabrok commented 7 years ago

Sounds like a permission issue. Check the bot has at least the "Manage Roles" permission, or preferably the "Administrator" permission.

Also if you can provide an error message that includes line numbers that might be helpful.

frodesigns commented 7 years ago

The bot does have Administrator permission, and the name of the role is "maguuma" so they definitely match.

Something interesting, if I put quotes around "1005" in the config it stops giving those console errors. It still associates the API key, but doesn't add the role.

I haven't seen any other errors, and ideas for how can get you that info?

frodesigns commented 7 years ago

Could this be due to discord.js needing to be updated to a newer version?

Nabrok commented 7 years ago

The new version of discord.js is quite a big change and requires node version 6. In my opinion it's still a bit early to start requiring 6, so I'm sticking with discord.js version 8 for now.

That said, there have been a few problems that seem to be related to version 8, so I might migrate sooner rather than later.

frodesigns commented 7 years ago

I see. Well I can't for the life of me get the link command to add the world role, so I think I will have to give up for now. Thanks anyway!

frodesigns commented 7 years ago

Got it working by dragging the Bot role above all of the other roles.... wow