Best answer

Discord "Add role" action used to work, now throws error: Failed to create a role in Discord


Userlevel 1

Hi,

 

I had a Zap set-up that would find a user using the “Find User in Discord” action, and then assign a role to this user. The Zap used to work perfectly, until March 6th it stopped working - while nothing had been changed on my part.

I looked into it and saw the following error being thrown:

 

Failed to create a role in Discord
Class constructor AppError cannot be invoked without 'new'

 

I proceeded to test to narrow down the problem, by

  • Assigning a different role
  • Assigning the role to a different hardcoded user value instead of ID through Find User
  • Testing the Add role action as barebones as possible in a new Zap: using a fresh server, fresh role, and to a different user, both hardcoded and through Find User.

All attempts resulted in the same error.

After some googling I found this Reddit post (https://www.reddit.com/r/zapier/comments/1b7u2bz/discord_api_in_zapier/) of a set of other users experiencing the same error, happening from around the same time (March 6th onward).

My educated guess is that something is awry on the side of the Discord Zapier integration itself (or more specifically, the Add Role action) - rather than in my own implementation. But maybe I’m overlooking something.

I contacted Discord but they said this was out of their scope and asked me to contact Zapier instead. So here we are.

Can anyone provide some help with this?

Thanks in advance,

Philip

icon

Best answer by ken.a 19 March 2024, 07:09

View original

10 replies

Userlevel 1

Here’s some screenshots of the Add role action config (user ID and role name redacted for privacy reasons)

 

Userlevel 7
Badge +6

Hi there @flip.vanwijk,

Welcome to the Community! 🎉

I have a hunch this issue might be a permission issue with Discord. This happens when the Zapier bot's own role is too low. Bots cannot assign users to roles higher than the bot, itself. The bot's role needs to be higher than the role it's assigning.

Discord determines role priority by its physical place in the "Roles" list, and users can drag-and-drop to rearrange roles. Moving Zapier's role higher than the role it's assigning should resolve the issue.

Kindly give it a try and let me know how it goes? I'll keep an eye out for your response!

Userlevel 1

It totally worked - thanks a bunch @ken.a :)

Userlevel 1

Hi Ken,

 

Thanks for the swift response! Your hunch was totally correct, moving the role up the order resolved the issue.

 

Strange and unclear feature on Discord’s side, one would assume a role with admin rights would just be able to assign any role...

Thanks a ton for the insight! Got everything working now.

 

Kind regards,

Philip

Userlevel 7
Badge +6

Hi @flip.vanwijk and @husayngokal,

You are most welcome! I’m glad I was able to help!

If you have any other questions, please don’t hesitate to reach out to the Community. We’re always happy to help! 🤗

Userlevel 1
Badge

I followed these steps and still the same error. What now?

Userlevel 1
Badge

Hi @flip.vanwijk and @husayngokal,

You are most welcome! I’m glad I was able to help!

If you have any other questions, please don’t hesitate to reach out to the Community. We’re always happy to help! 🤗

I followed these steps and still the same error. What now?

Userlevel 7
Badge +6

Hi @thereverend,

Thanks for letting me know.

Could you please try reconnecting your Discord account here: https://zapier.com/app/connections/discord. Additionally, could you please send a screenshot of your Roles in Discord?

Thanks!

Hey @ken.a ,

 

For some reason, even after re-connecting - I can’t get the zap to work. It still give me the same error and the role is the highest in my roles overview.

 

What other information would you need?

Userlevel 7
Badge +6

Hi @Jasper.mittelmeijer,

The Roles on your Discord should be correct here. However, you mentioned that you’re still getting the error. Would you mind sharing a screenshot of the “Action” section of your Discord action step that shows all of its fields? Like so:

46dd6c0979e3d815d621b8da43084ef1.png
(view larger)

Please don't include personal information in the screenshot, or be sure blur out any personal information.

Thanks!

Reply