jonathonor / syncBot

A bot that syncs roles between multiple discord servers.
https://www.jonsbots.com/syncBot
30 stars 16 forks source link

Bot shuts down when this error appears. Could you tell me what's causing this? #19

Closed Re4LDeaL closed 1 year ago

Re4LDeaL commented 1 year ago

DiscordAPIError[10011]: Unknown Role at SequentialHandler.runRequest (C:\ReverseSync\syncBot\node_modules\@discordjs\rest\dist\index.js:667:15) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) at async SequentialHandler.queueRequest (C:\ReverseSync\syncBot\node_modules\@discordjs\rest\dist\index.js:464:14) at async REST.request (C:\ReverseSync\syncBot\node_modules\@discordjs\rest\dist\index.js:910:22) at async GuildMemberRoleManager.remove (C:\ReverseSync\syncBot\node_modules\discord.js\src\managers\GuildMemberRoleManager.js:168:7) { requestBody: { files: undefined, json: undefined }, rawError: { message: 'Unknown Role', code: 10011 }, code: 10011, status: 404, method: 'DELETE', url: 'https://discord.com/api/v10/guilds/929969152356155435/members/656621136808902656/roles/934472142404321311' } node:events:491 throw er; // Unhandled 'error' event ^

TypeError: Cannot read properties of undefined (reading 'id') at Client. (file:///C:/ReverseSync/syncBot/runReverse.js:321:76) at process.processTicksAndRejections (node:internal/process/task_queues:95:5) Emitted 'error' event on Client instance at: at emitUnhandledRejectionOrErr (node:events:394:10) at process.processTicksAndRejections (node:internal/process/task_queues:84:21)

Re4LDeaL commented 1 year ago

This is for the reverse version

jonathonor commented 1 year ago

Let me look into this for you. I don't have many people using reverse sync, so all of my effort has been on normal sync.

jonathonor commented 1 year ago

@Re4LDeaL Hey, that ended up being a simple fix, please get the latest version of the bot. Let me know if you run into any additional issues using the reverseSync and I'm happy to fix them!

Re4LDeaL commented 1 year ago

Hey @jonathonor Thank you very much! That was really fast. It works perfect as of this moment. I have a question though, I'm running both the normal Sync and reverse. Is it intended that way or is it not necessary?

jonathonor commented 1 year ago

@Re4LDeaL Yes, that is how it is intended to be run at the moment. I am currently working on a better solution to combine all functionality into a single performant bot, but it is still in progress.

Re4LDeaL commented 1 year ago

Gotcha, I think it's fine! I like it better that way tbh!

Re4LDeaL commented 1 year ago

Could you make a separate version for that if you did make that? Because I like having these 2 bots for aesthetics lol!

jonathonor commented 1 year ago

@Re4LDeaL These two bots will remain the same, the new bot will be completely separate. So you have nothing to worry about 😄