-
Notifications
You must be signed in to change notification settings - Fork 0
Description
The problem:
Currently, the bot is implemented in a manner that depends on global state, which can cause confusion, unexpected behaviour, and inconsistency.
The solution:
Switching to a more functional approach where the same input to a function always produces the same output would bring many benefits to reliability and improve development conditions
how to implement it:
Everywhere that calls on the global variables users or games should instead take in all the state it needs as function parameters.
Everywhere that writes to the global variables users or games should instead return the value instead
when it comes to buttons and views, you can't really return since all the work is being done by a callback function being called within the discord api wrapper. Instead edit the object's attributes and access them when the view has stopped