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
3
votes
2 answers

How to send message from bot to user at a fixed time or at intervals through python telegram bot library?

I am trying to send messages to bot daily without trigger from user side (eg commandhadler) from second conversation onwards. I have build a basic menu for bot to interact with user But i am also trying to send messages daily through job_queue I…
Shubh
  • 585
  • 9
  • 29
3
votes
2 answers

how to schedule a telegram bot to send a message?

I am trying to create a Telegram bot that sends a message at a specific time, 5:30pm. However, the ways a was trying are not correct. I wanted to trigger send_message regarding to the time and without the necessity of the user to send any…
Kanayel
  • 310
  • 2
  • 4
  • 14
3
votes
3 answers

Telegram can get chat by id, can't by @name: Chat not found

So I've made a bot using @BotFather and I messaged it from my account. Then I found out the id of my account using @userinfobot and sent this request: https://api.telegram.org/botTOKEN/sendMessage?chat_id=id&text=test and it works fine…
parsecer
  • 4,758
  • 13
  • 71
  • 140
3
votes
2 answers

Getting input from users in Bot

I have a question about building a telegram bot with python. How can I get input from the user in my python-telegram-bot? For example, a dictionary bot, how can I get a word from the user?
3
votes
1 answer

How to edit caption/description from media message or media group message with telegram bot?

I tried to edit message from channel by bot, with this code (from aiogram python library): await bot.edit_message_caption( bot_id, message.forward_from_message_id, "new_caption", parse_mode=ParseMode.HTML) but it not work :( i try also…
tecn603
  • 211
  • 5
  • 14
3
votes
1 answer

Getting error "No package 'libffi' found" when installing python-telegram-bot

I tried to install python-telegram-bot on my raspberry pi but I got this problem: Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-QLuRQr/cffi/setup.py';f=getattr(tokenize, 'open',…
avtar550
  • 51
  • 1
  • 2
  • 8
3
votes
2 answers

Telegram API: how to get username from id (Python telepot)?

I save ids of all users of my bot in a database but how can I get their current username if I know id? I'm using Python 3 and Telepot framework.
3
votes
1 answer

How do I answer only the latest user inline query with python-telegram-bot?

I'm using python-telegram-bot to build a bot that answers to inline queries. The query result is kind of complex to process. I'm using @run_async. As a user types an inline query, the client produces several queries, every one of them spawning a…
3
votes
5 answers

Any way to open an app from Telegram bot?

I've coded a Telegram bot (python-telegram-bot) and I would like to know if there's a way to open an app from the bot. To be more accurate, the bot searches torrent links and the original idea was to send that links directly to qBitTorrent in the…
n40k1
  • 39
  • 1
  • 2
3
votes
1 answer

Python logging with ptb: Same line logged twice but only one handler added

python: 3.6.6 python-telegram-bot: 10.0.2 I have this problem: I have defined a python logger with a SMTPHandler, a TimedRotatingFileHandler and a StreamHandler. The StreamHandler works fine, but when I try to use it from a python-telegram-bot…
madtyn
  • 1,469
  • 27
  • 55
3
votes
1 answer

ifttt: redirect message (text, photo and video) from telegram to email

There is an applet which allows to send text messages from telegram to some email. Unfortunately there is a limitation: it only works with text. I would like to have the same functionality, but for images, video and may be audio. I suppose media…
doubts
  • 1,763
  • 2
  • 12
  • 19
3
votes
1 answer

Python telegram-bot: Prompt for another input

I have a bot in Python that prompts the user to pick from a list of IDs to change and the idea is that the user will select the ID and then supply the ID they want to change to. Here is my code: def build_menu(buttons, n_cols): menu =…
Bijan
  • 7,737
  • 18
  • 89
  • 149
3
votes
1 answer

Why I can't send sticker by it's id

I want my bot to send special sticker. I got it ID in logs after sending it to bot. file_id "CAADAgADOQADfyesDlKEqOOd72VKAg" This is what getUpdates give me But if I try to send it, for…
user8638529
3
votes
1 answer

Do telegram chat IDs stay the same when converting to a supergroup?

On Telegram, every group has a chat-id that my bot saves whenever it is added to a group. If an owner of a group converts it to a supergroup, will the ID of the group change? And if it does, how can we get the new chat-id for the group? I've…
3
votes
1 answer

Python telegram bot flood control exceeded

I develop telegram bot using python-telegram-bot. Despite the usage of MessageQueue (just as mentioned in the docs) I keep getting telegram.error.RetryAfter: Flood control exceeded. Retry in N seconds when I flooding from the client (by pressing…
BugDeveloper
  • 155
  • 2
  • 2
  • 11