stock_reminder_bot icon indicating copy to clipboard operation
stock_reminder_bot copied to clipboard

Refactor bot.py

Open luisgc93 opened this issue 4 years ago • 2 comments

Just how the test suite was split into several modules, the same should probably be done for bot.py since the code is getting a bit spaghetti.

Some ideas of how it could be broken down:

  • Modules for methods with outside API calls vs methods that don't have outside calls
  • One module for each feature e.g. reply_mentions.py, publish_reminders.py, generate_report.py

luisgc93 avatar Jan 23 '21 09:01 luisgc93

It might make sense to follow a composition approach as in: https://github.com/luisgc93/chamath2cash/commit/9c9b706869e550b3caa82be97a2b33f1fa98b44c I.e. To create a Bot class that contains all the different clients plus some business logic.

luisgc93 avatar Feb 07 '21 14:02 luisgc93

WIP in branch refactor-with-composition-approach

luisgc93 avatar Feb 27 '21 17:02 luisgc93