Open eknoes opened 3 years ago
Is there anything new here, @eknoes ?
Unfortunately not, sorry. I am currently quite busy.
Okay. Is there any guidance on how to combine the programmed into a library? Because maybe I could have a look at it.
Not really, one has to make some architectural decisions. Currently, all the functionality is in main.py and the different platforms are in interfaces/. It would be nice to have a library with a common interface and decorators for the chatbot.
https://medium.com/analytics-vidhya/how-to-create-a-python-library-7d5aea80cc3f
I found this post which seems to be quite helpful. What do you think, @eknoes ? This method seems to me (without having actively tested it) to be quite simple to transfer the programmed contents into a bibliohtek.
Yes, the question is not really how it could be put into a library, but how the library API should be designed.
Yes, the question is not really how it could be put into a library, but how the library API should be designed.
Would much have to be changed structurally?
Yes! Honestly, I am not sure if you can help a lot regarding this issue, but of course you can give it a try. One must decide how to e.g. annotate a bot who would use this library: Obviously, the functions would return BotResponses (https://github.com/eknoes/covidbot/blob/main/covidbot/interfaces/bot_response.py) and some kind of general structure for all messenger messages. Furthermore, it should provide hooks, so that prior to receiving a general state might be saved. Basically the setup and this function must be extracted (https://github.com/eknoes/covidbot/blob/2d4f1e43124090a3c5d23aa623554b813835f504/covidbot/bot.py#L111). The setup should be replaced through decorators.
Have cleanups or similar changes to the code base changed anything in the initial situation, @eknoes ?
No, there was no progress or heavy changes here. If you still want to help, you could come up with a suggestion for a general API and we can discuss it. I currently do even not have enough spare time to handle the core issues of the bot.
After #117, it would be easy to extract the core of that bot and create a Python Library for Multi-Platform Chatbots.