Python telepot 模块,DelegatorBot() 实例源码

我们从Python开源项目中,提取了以下1个代码示例,用于说明如何使用telepot.DelegatorBot()

项目:progrobot    作者:petr-kalinin    | 项目源码 | 文件源码
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