You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Apr 8, 2021. It is now read-only.
I was trying to work on implementing the User class in the bot but I kept running into circular dependencies. This was even more confusing to figure out because of the mess of require functions in each file. Thus, we need to find a better way to pass and import these things from files.
I was thinking about initializing the structures in app.js by requiring their modules. Then passing them down through the Client. So we can access them directly through discord.js based classes and also import them directly from a single file when needed. However I'm kind of lost on how we should initialize the structures, as many depend on each other.
Or suggest any other method to avoid circular dependencies crashing the bot.
The text was updated successfully, but these errors were encountered:
Perhaps it's better to even make a custom class which extends the CommandoClient. And we can make a PickupsManager and UserManager to interact with and manage cached games and users. We can define the handlers and utils as methods which can directly have access to the Classes instead of having to import stuff. Overall, it will be a more consistent implementation. Having to import things everywhere is really janky.
Progress - Defined Basic Structures for PugClient (Extension of CommandoClient). Now it's time to work on updating the existing structures (Pickups and Game) to work with the new Client.
I was trying to work on implementing the User class in the bot but I kept running into circular dependencies. This was even more confusing to figure out because of the mess of require functions in each file. Thus, we need to find a better way to pass and import these things from files.
I was thinking about initializing the structures in app.js by requiring their modules. Then passing them down through the Client. So we can access them directly through discord.js based classes and also import them directly from a single file when needed. However I'm kind of lost on how we should initialize the structures, as many depend on each other.
Or suggest any other method to avoid circular dependencies crashing the bot.
The text was updated successfully, but these errors were encountered: