Python Forum
How to get response data from telegram API call in python
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to get response data from telegram API call in python
#1
Hi,
i am approaching python development with telegram API and I am facing a problem.

I have two parts on my app, a python telegram bot (python-telegram-bot API) and a php webapp that it's needed to authenticate users before let them use the telegram bot handlers.

The php app makes a call to the telegram bot using the SendMessage api command like following:

https://api.telegram.org/botToken/SendMessage

Quote:$params=[ 'chat_id'=>$chatID, 'text'=>'text to send here..', 'response'=> $oneTimePassword ]

in the message I send I have stored chat_id, text and a response code (one time password) that I need the telegram bot to read and store in a variable for further check.

With this setup my php app sends the message to the python bot and I got the notification on telegram, but what I want to do, is to extract the data from the telegram api call and save them in variables, especially I want to save the response code (OTP) i put in the api call in the first place..

How can I do that inside my python telegram bot?

Hope you can help me
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  queue for async function python telegram.ext noctious 0 1,576 Jun-11-2023, 02:58 PM
Last Post: noctious
  Problem with importing python-telegram library into the project gandonio 1 1,563 Nov-01-2022, 02:19 AM
Last Post: deanhystad
  Telegram bot python help! wolfdevs 0 770 Sep-07-2022, 11:34 AM
Last Post: wolfdevs
  Python Requests package: Handling xml response soumyarani 1 2,154 Sep-14-2020, 11:41 AM
Last Post: buran
  Multiplayer call to Telegram bot AlexSn2020 2 2,404 Jul-01-2020, 10:35 AM
Last Post: AlexSn2020
  Bot coding telegram.ext Kumarkv 1 1,866 May-29-2020, 01:00 AM
Last Post: Kumarkv
  Python Automated Response System Help altoon 3 3,913 Oct-10-2019, 07:09 AM
Last Post: perfringo
  Call pip3 from python folder build by me call pip3 from the /usr/bin Suryavarman 3 3,684 Oct-07-2019, 10:23 PM
Last Post: Suryavarman
  Question about telegram bot Romank 0 2,243 Mar-29-2018, 09:36 PM
Last Post: Romank
  Telegram code help AaronJonk 0 9,491 Oct-05-2017, 02:44 PM
Last Post: AaronJonk

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020