Circular dependency
Hi, I'm new to creating bots, and this is my first bot. The idea is to make an rpg bot, integrated with my server. When started, it calls spawnCreatures.js, which will make the bot send random messages, from creatures randomly searched for in the database, in random channels, which are part of the game map (each channel is a location on the map, present in the database data). Each message will be an independent creature, and will have a button to start combat. If I click the combat button, every now and then, the creature should attack me, subtracting my life on the field from the database. However, with a recent modification I made to spawnCreatures.js, adding the new newMessages module, it gives an error as soon as the creature tries to attack me, talking about circular dependency. I have no idea what this is, but it must have something to do with this new module. Would anyone know the reason?
Obs: v14.10.2
5 Replies
- What's your exact discord.js
npm list discord.js
and node node -v
version?
- Not a discord.js issue? Check out #other-js-ts.
- Consider reading #how-to-get-help to improve your question!
- Explain what exactly your issue is.
- Post the full error stack trace, not just the top part!
- Show your code!
- Issue solved? Press the button!index.js
spawnCreatures.js
interactionEvents.js
combat.js