forwards-long-jump / discotron

Modular Discord bot supporting plugins hosted on git repositories
MIT License
3 stars 5 forks source link

Move from Promises to async/await #90

Closed RedMser closed 4 years ago

RedMser commented 4 years ago

Where it makes sense, we should try using async/await instead of Promises due to the hard-to-maintain nature of chains. Chains become a big problem when initializing a class that mixes sync statements (set variables, null check etc.) with async statements (Discord API, database etc.).

For starters, we could look at the index.js which is currently being replaced with async/await in #89 but the Promises are not yet refactored (let's wait for that to be merged first). Not sure if there are other places where it's worth doing this switch.