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
1 answer

CallbackQueryHandler or ConversationHandler for a message sent from bot class

Using python-telegram-bot, I have a bot running with very similar settings as for the other examples. On the other side i have parallel processes that allow me to send messages to users interacting with the bot periodically. The parallel proccess…
Alvaro
  • 1,430
  • 2
  • 23
  • 41
3
votes
1 answer

Get User Input after keyboard inline keyboard selection Telegram Bot Python

I have an issue with my telegram bot. I wrote a bot in which the user needs to make a choice with an Inline Keyboard. If he selects 'Cerca un prodotto' the bot should wait for user input and print it. But if I start the bot then it prints the text…
3
votes
0 answers

How to get messages from a private channel using Telethon

I used to get the posts from a public telegram channel using telethon and everything works fine until today that the channel became private and although I am a subscriber to the channel I can not retrieve the channel messages with the message-id…
3
votes
3 answers

How to send emoji in Telegram bot with python?

I'm dealing with a small project, I decided to add emoji to make the visual a little better, but I couldn't send it. I tried Unicodes like "\U000203C" or even tried to copy the emoji and past it but still can't do it. Is there any way that I can…
Exavier
  • 63
  • 1
  • 1
  • 6
3
votes
3 answers

Signing In to Telegram Client with Telethon automatically (python)

I am trying to program a telegram bot which accesses the Telegram Client, using the Telethon library. Everything is working correctly in the code below, but when running the code, the Telegram Auth procedure is run through the Terminal. Is there a…
3
votes
1 answer

Telegram bot - can't use getUpdates method while webhook is active

When I'm starting a bot after 10 minutes - 2 hours appears exception: can't use getUpdates method while webhook is active. I already tried to delete webhook like that: https://api.telegram.org/bot{token}/deleteWebhook, but it did not help. Also, I…
Danya
  • 77
  • 1
  • 6
3
votes
1 answer

Number keyboard for python-telegram-bot

I am currently creating a telegram bot using python-telegram-bot. For some questions in the bot I need a number keyboard displayed to the user. I tried: number_keys = [ ['7', '8', '9'], ['4', '5', '6'], …
Sören Etler
  • 288
  • 1
  • 4
  • 13
3
votes
1 answer

Python telegram bot - can the bot send the first message in chat?

Is it possible to get a bot to send the first message in the chat without running a command like "/Start"? Maybe it possible to save the chat_id of the requested user in advance and send him a message in the future, thus allowing the bot to send a…
3
votes
1 answer

How to send photos on telegram with python

I am trying to send a photo that I have on my computer to my telegram bot chat when I issue the command /screen. However, I don't seem to make it work, what am I missing? This is the file I am working with, sorry its a bit long, but I wanted to show…
gapansi
  • 105
  • 2
  • 10
3
votes
2 answers

Python Telegram Bot - run_daily does not work

I have the same problem as in this thread run_daily doesn't do its job. run_once and run_repeating work well. I do not understand why. I tested your code but task is not carried out import telegram.ext from telegram.ext import Updater import…
Ulquiorra
  • 41
  • 4
3
votes
2 answers

Pretending that telegram bot is typing?

How can I make a bot to pretend that it is typing a message? The following text appears in the chat when the bot pretend to type: I use the python aiogram framework but a suggestion for the native Telegram API would be also helpful.
Viktor Be
  • 658
  • 1
  • 11
  • 25
3
votes
1 answer

send bulk messages to my telegram bot subscribers with chat.id

I want to send messages with my telegram bot to subscribers. I already store all chat ids from my subscribers in TXT file every chat id in 1 line. now I need help to access this file and make send.messages go throw all chat ids without going over…
3
votes
2 answers

how to save data in conversation for telegram bot conversationHandler

I am building a telegram bot. one of the functionalities of my bot require the bot to query the user to pick between choices. Hear is my code that query the user def entry_point(update: Update, context: CallbackContext): companies_btn = [ …
Yedidya kfir
  • 1,419
  • 3
  • 17
  • 32
3
votes
1 answer

Making a Python-Telegram-Bot persistent

I recently coded a simple telegram bot using the python-telegram-bot library, and deployed this bot on Heroku. Now i'm looking for an effective way to make the bot persistent, allowing it to store Bot_data and user_data between runs. I took a look…
3
votes
1 answer

Does bot api support creation of native polls?

I’m trying to have a bot that is part of a group conduct polls based on certain parameters it receives instead of the users of the group creating the polls themselves. Is this possible?
Carlos F
  • 893
  • 2
  • 12
  • 30