Questions tagged [python-telegram-bot]

This is a Python library that wraps around the Telegram Bot API. Note that this is not a general tag for "Telegram bots written with Python", but only for question about this particular library.

This is a library that wraps around the bot HTTP API. It is compatible with only (please check the PyPi/GitHub page for detailed info).

Telegram Bot API

The Telegram Bot API is an HTTP-based interface created for developers keen on building bots for Telegram.

1454 questions
0
votes
1 answer

Telegram CLI/BOT all implicit limits

I want to send OTP , first to Telegram with usual SMS fallback. Therefore i have to detect read callback of OTP message from user only with telegram cli API, unfortunately(Telegram bots doesn't provide read ack. feature). There is no any concrete…
aquavita_x
  • 41
  • 1
  • 7
0
votes
0 answers

Where does the functions like "start" "help" receive the arguements from?

I would like ask where the functions like "start" and "help" receive the arguments from? Take a look at this code : https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/echobot2.py In defining, the parameters, there are 2…
Calvin Yee
  • 32
  • 1
  • 5
0
votes
1 answer

Modular coding in a python bot

I am new to stackoverflow (and coding). I was wondering if in telegram bots, using python, how I would do modular coding. By which I mean that each command be in a different file. If I have a small bot which says replies to a message by echo, I…
ICanKindOfCode
  • 1,000
  • 1
  • 11
  • 32
0
votes
1 answer

Why the job stored in DB when loaded runs for ever?

I'm trying to add the Jobs to DB and then load them when the script runs again. The following code adds it to db but when you restart the script it loads the job but runs it for ever. It seems that the job import is correct but I can not figure out…
lameei
  • 184
  • 2
  • 11
0
votes
0 answers

send a photo in server telegram, don't know the adress

I'm trying to reshape my data, then create it like an image, using PIL. After that I would like to send it without hands a picture into a chat. srcData = np.reshape(srcData, [row, col, height]) # reshape srcData img = Image.fromarray(srcData) url =…
X22
  • 11
  • 5
0
votes
2 answers

How to get messages from other telegram bot in real time on Python?

I have in my contacts list a telegram bot which sends me messages. This bot is not mine. I want to parse these messages from other bot in real-time. How I can do this? I want to do something like this: while True: got_message = …
User Userov
  • 11
  • 1
  • 2
0
votes
1 answer

Python-telegram-bot send message to phone numbers

I create a telegram bot with framework python-telegram-bot. I have a little phone numbers,Now I want send message to phone numbers. The phone numbers have an account in Telegram,and this is my codes: from telegram.ext import Updater, MessageHandler,…
Sajjad
  • 41
  • 1
  • 4
  • 13
0
votes
1 answer

Telegram Bot API InlineQueryResultAudio

Okay i can send audio with some url in inline mode. But how can i send the local audio from the directory? Telegram Bot API return me this: A request to the Telegram API was unsuccessful. The server returned HTTP 400 Bad Request. Response body: …
0
votes
1 answer

How do I send locally stored sticker to an inlinequery in Telegram with python-telegram-bot

Using https://github.com/python-telegram-bot/python-telegram-bot/blob/master/examples/inlinebot.py is it possible to change this bot to send a local webp (sticker) file as a response to an inline query? Secondary, what would be the most convenient…
Sparx
  • 190
  • 8
0
votes
1 answer

Echo back the images sent to the echobot2.py telegram bot

I tried the echobot2.py of the python-telegram-bot library but it does not echo the images sent to the bot. How can I handle this issue?
lameei
  • 184
  • 2
  • 11
0
votes
1 answer

Alarm in pyTelegram Bot

I want to write a simple reminder-bot for telegram. Bot gets from user time (Hours:Minutes) and saves it. When system time equals to users remind time, bot sends message to user. This is how i track current time: import time def timer(): now =…
N.L0rem
  • 1
  • 5
0
votes
1 answer

How to set game score using setGameScore in python telegram bot

I'm using BOT API for telegram, through setGameScore i tried to set game score of user with _user_id_ and score but its not working ... used bot.setGameScore (user_id = 56443156,score=65) Iam not using game to set only for inlinequery i received a …
isaacalan
  • 73
  • 1
  • 8
0
votes
1 answer

I used Update.callback_query after which i used Update.message in same function its not working

update.callback_query.from_user Inside the same function I used update.message.text where i tried to get message from user update.message.text is not working giving me 'NoneType' object has no attribute 'text' how can i use two update in same…
isaacalan
  • 73
  • 1
  • 8
0
votes
2 answers

Hide InlineKeyboardMarkup in no answer provided

I would like to hide a InlineKeyboardMarkup if no answer is provided. I'm using Python and python-telegram-bot. Is this possible? Thank you.
ebdecastro
  • 61
  • 1
  • 2
  • 11
0
votes
1 answer

The telegram bot does not delete stickers from the group

I create a telegram bot using the Python-Telegram-Bot framework and the Re Module. The bot should delete the stickers the members send to the group, that is, when the word is start send to the group, it will delete the bot stickers that are sent…
Sajjad
  • 41
  • 1
  • 4
  • 13