tulul / tululbot

Telegram Bot for Tululness
Apache License 2.0
8 stars 6 forks source link

Make leli command more interactive #54

Closed kmkurn closed 8 years ago

kmkurn commented 8 years ago

Quite a big PR here.

Basically to implement what was discussed on issue #53, we have to change our bot implementation radically. I made a proposal before about using a library and I found that this PyTelegram library is the best out there (forget all about my proposal previously; it doesn't work). It's still pretty young though so I wrap it with our own classes etc and I wrote tests for them too so it should be easy if we want to swap with another library later on.

This PR mostly about refactoring our implementation to use the wrapped library. However I also implemented the interactive leli command. Might be better in a separate PR but hey it's done already.

I consider a user's message is a leli command if 1) it starts with /leli (as usual), or 2) it is a reply to TululBot's message asking what to leli. The details can be viewed on commands.py file.

This PR may be daunting but please do review this. Don't hesitate to ask me should you need explanation or reason why I did something this way etc.

wazaundtechnik commented 8 years ago

Everything looks good for me. I think we do still have a problem about conversation-mode program flow, but we can figure out it later if everything gets bigger.