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