I found that while using pytelegrambotapi you can't use botan, because json.dumps fails on processing message object that comes from Telegram. Also I've noticed that Telegram allows you to set full set of UTF-8 to last_name and first_name, which leads to exception in json.dumps.
I made a small change to botan.py:
Added make_json method, which fetches some values, such as username, chat.id, message_id from message object, which is enough to collect analytics from TG bots.
Added method to track inline requests.
If you have comments, please contact with me for further steps.
Kind regards, Margulan.
I found that while using
pytelegrambotapi
you can't usebotan
, becausejson.dumps
fails on processingmessage
object that comes from Telegram. Also I've noticed that Telegram allows you to set full set of UTF-8 tolast_name
andfirst_name
, which leads to exception injson.dumps
.I made a small change to
botan.py
:make_json
method, which fetches some values, such asusername
,chat.id
,message_id
frommessage
object, which is enough to collect analytics from TG bots.If you have comments, please contact with me for further steps. Kind regards, Margulan.