szastupov / aiotg

Asynchronous Python library for building Telegram bots
MIT License
381 stars 44 forks source link

regexp-based inlines and callbacks #42

Closed akolechkin closed 7 years ago

akolechkin commented 7 years ago

Hi, I would like to share my extension for aiotg I've been using in my projects. You can take a look at ext.py file, I just copied from my project. It adds ability to handle regexp based callback and inlines based on callback_data and query. It's similar to regex command interface. If you think this behavior fits well, I can merge the extension into existing codebase. I created it as a subclass just because I wanted to have aiotg installed from pypi without forking it.

szastupov commented 7 years ago

Looks good, I'm definitely interested in merging it into bot.py (it shouldn't break existing API, though).

akolechkin commented 7 years ago

Yes, you're right. It's not a big deal. I've added one more check to the callback and inline regexp argument and merged ext.py into bot.py.

szastupov commented 7 years ago

Good job! Thanks a lot!