Discord Not a Bug Error when editing roles in XF admin, roles not synchronised.

Affected add-on version
2.8.8
Affected XenForo version
2.3.3
Hi, bit of an odd one here!

Everything installed well, but when I try to edit Discord roles in XF Admin, I get the following error when I hit save:

GuzzleHttp\Exception\ClientException: Client error: PATCH https://discord.com/api/guilds/1308090346806186086/roles/1308091284212158564 resulted in a 403 Forbidden response: {"message": "Missing Permissions", "code": 50013} in src/vendor/guzzlehttp/guzzle/src/Exception/RequestException.php at line 113
  1. GuzzleHttp\Exception\RequestException::create() in src/vendor/guzzlehttp/guzzle/src/Middleware.php at line 72
  2. GuzzleHttp\Middleware::GuzzleHttp\{closure}() in src/vendor/guzzlehttp/promises/src/Promise.php at line 209
  3. GuzzleHttp\Promise\Promise::callHandler() in src/vendor/guzzlehttp/promises/src/Promise.php at line 158
  4. GuzzleHttp\Promise\Promise::GuzzleHttp\Promise\{closure}() in src/vendor/guzzlehttp/promises/src/TaskQueue.php at line 52
  5. GuzzleHttp\Promise\TaskQueue->run() in src/vendor/guzzlehttp/promises/src/Promise.php at line 251
  6. GuzzleHttp\Promise\Promise->invokeWaitFn() in src/vendor/guzzlehttp/promises/src/Promise.php at line 227
  7. GuzzleHttp\Promise\Promise->waitIfPending() in src/vendor/guzzlehttp/promises/src/Promise.php at line 272
  8. GuzzleHttp\Promise\Promise->invokeWaitList() in src/vendor/guzzlehttp/promises/src/Promise.php at line 229
  9. GuzzleHttp\Promise\Promise->waitIfPending() in src/vendor/guzzlehttp/promises/src/Promise.php at line 69
  10. GuzzleHttp\Promise\Promise->wait() in src/vendor/guzzlehttp/guzzle/src/Client.php at line 189
  11. GuzzleHttp\Client->request() in src/addons/NF/Discord/Api.php at line 1020
  12. NF\Discord\Api->request() in src/addons/NF/Discord/Api.php at line 1142
  13. NF\Discord\Api->patch() in src/addons/NF/Discord/Api.php at line 546
  14. NF\Discord\Api->patchRole() in src/addons/NF/Discord/Api.php at line 519
  15. NF\Discord\Api->updateRole() in src/addons/NF/Discord/Admin/Controller/Role.php at line 109
  16. NF\Discord\Admin\Controller\Role->actionSave() in src/XF/Mvc/Dispatcher.php at line 362
  17. XF\Mvc\Dispatcher->dispatchClass() in src/XF/Mvc/Dispatcher.php at line 264
  18. XF\Mvc\Dispatcher->dispatchFromMatch() in src/XF/Mvc/Dispatcher.php at line 121
  19. XF\Mvc\Dispatcher->dispatchLoop() in src/XF/Mvc/Dispatcher.php at line 63
  20. XF\Mvc\Dispatcher->run() in src/XF/App.php at line 2826
  21. XF\App->run() in src/XF.php at line 806
  22. XF::runApp() in admin.php at line 15

Then, even though the checked boxes are actually saved, Discord users aren't having their Discord role assigned to them according to their XF group.

Bot is otherwise working well, posting threads to the correct Discord channels, DMing the user their watched alerts. Testing shows the bot has the required permissions:

Screenshot 2024-11-22 at 14.58.31.png

We're on XF v2.3.3, PHP 8.3.14, Standard Library 1.21.9. The error happens whether attempting to edit admin-level roles or user-level roles.

Any ideas?
 
Is this happening with users that are in roles that outrank the bot?

AHA of course!!! Moved the bot to the top of the roles list and the error disappeared!

Not sure the bot has the power to change roles for the server owner, but that's less of a concern.

Thank you!!
 
  • Like
Reactions: Naz
Back
Top