skip to Main Content

Python JSON returning None value (Telegram API)

I am trying to return the user id of new members who join a telegram group, I can get the JSON data but I cannot retrieve values from a level deeper: code: def new_chat_members(self, bot, update): print(update) print(update['message']) print(update['message']['from']) print(update['message'].get('from'))…

VIEW QUESTION

I coded my telegram bot (in python) prompting user to send an image. How do I make sure users only send image and nothing else? – Telegram API

def process_color_step(message): chat_id = message.chat.id product.color = message.text msg = bot.send_message(chat_id, 'ok, send me a photo of your phone') bot.register_next_step_handler(msg,process_image_step) def process_image_step(message): chat_id = message.chat.id product.image = message.photo[1].file_id msg = bot.send_message(chat_id, 'Ok, send me a description of your phone?') bot.register_next_step_handler(msg,process_description_step)…

VIEW QUESTION
Back To Top
Search