app.py 文件源码

python
阅读 21 收藏 0 点赞 0 评论 0

项目:pitalk 作者: samar-agrawal 项目源码 文件源码
def on_chat_message(self, msg):
        '''process and response message'''

        ntuple = Message(**msg)

        if telepot.glance(msg)[0] == 'text':

            if any(q in ntuple.text for q in ACTION_DICT.keys()):
                response = perform_action(ntuple.text, ntuple.from_.id)
            else:
                response = KERNEL.respond(ntuple.text)

        #if not response:
            #response = self.sender.sendMessage(
               # chat_id, 'I do not understand your last message.', reply_to_message_id=msg_id)
        self.sender.sendMessage(response)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号