我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用telepot.DelegatorBot()。
def per_real_chat_id(msg): if "chat" in msg: return msg['chat']['id'] elif "message" in msg: return msg["message"]['chat']['id'] elif "from" in msg: return msg["from"]["id"] print("?!") return [] # forces to launch new delegator each time # DelegatorBot works wrongly with callback # so we convert callback to ordinary message