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!')
评论列表
文章目录