bot.py 文件源码

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

项目:matrigram 作者: GalPressman 项目源码 文件源码
def do_leave(self, msg, match):
        query_id, _, _ = telepot.glance(msg, flavor='callback_query')
        chat_id = msg['message']['chat']['id']
        room_name = match.group('room')
        client = self._get_client(chat_id)

        prev_focus_room = client.get_focus_room_alias()
        client.leave_room(room_name)
        self.sendMessage(chat_id, 'Left {}'.format(room_name))
        curr_focus_room = client.get_focus_room_alias()

        if curr_focus_room != prev_focus_room and curr_focus_room is not None:
            self.sendMessage(chat_id,
                             'You are now participating in: {}'.format(
                                 client.get_focus_room_alias()))

        self.answerCallbackQuery(query_id, 'Done!')
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号