Python telepot.aio() Examples

The following are 1 code examples of telepot.aio(). You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may also want to check out all available functions/classes of the module telepot , or try the search function .
Example #1
Source File: test3a_admin.py    From telepot with MIT License 5 votes vote down vote up
def on_chat_message(self, msg):
        content_type, chat_type, chat_id = telepot.glance(msg)

        if 'edit_date' not in msg:
            await self.sendMessage(chat_id, 'Edit the message, please.')
        else:
            await self.sendMessage(chat_id, 'Add me to a group, please.')

            # Make a router to route `new_chat_member` and `left_chat_member`
            r = telepot.aio.helper.Router(by_content_type(), make_content_type_routing_table(self))

            # Replace current handler with that router
            self._router.routing_table['chat'] = r.route