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

python-telegram-bot Pass argument between conversation handlers

I'm trying to write a bot where a user clicks on a command, sends a link as a message, and then the bot adds the link to some database. Here's how it would look: So I thought I should use a ConversationHandler. Here's what I wrote, the bot.py: from…
Amir Shabani
  • 3,857
  • 6
  • 30
  • 67
4
votes
3 answers

Force closure of the popup on telegram “Open this link?”

When i use html formatting in a post and i create a link, Telegram show a popup before open the link. There is a script or something that force closure of the popup and open the link immediatly? I don't want insert the link without HTML.
4
votes
1 answer

Deeplinking into a telegram bot

I have a simple use case. When a user clicks the link below, T.me/MycompanynameBot?start=Microsoft I want to show him 3 inline buttons corresponding to 3 Telegram channels within Microsoft. Is this possible? The key is the bot must be able to…
4
votes
1 answer

Can Telegram bot detect a new member joining a channel event?

I have a Telegram bot and I set this bot as admin of a channel. Now, when a new user ordinarily joins a channel (not a group) there is no message on the channel and no message we could get with getUpdates method. Is it technically possible to post a…
4
votes
2 answers

How to fix ImportError: No module named 'telebot'

I'm configuring a bot to send alerts from Zabbix, so I installed Python and the modules: sudo apt install python python-pip python-setuptools After that, I installed the bot API to use on Zabbix: python -m pip install --user…
Lucas SF
  • 111
  • 1
  • 1
  • 6
4
votes
2 answers

how to make my python telegram bot to send message at certain time every day?

I'm trying to make a bot which will be able to notify users at a certain time every day. how can I make bot to send notification at certain time every day? I've tried to use while loop but it s @bot.callback_query_handler(func=lambda c:True) def…
4
votes
1 answer

Bot started but /start command isn't doing anything

After setting up the python teegram bot script on Heroku using docker container, script is running but the /start command isn't doing anything at all Setting up Telegram bot on Heroku server using Python telegram bot import logging import os import…
Reactorboy
  • 41
  • 5
4
votes
0 answers

Python-Telegram-Bot: Can't reuse ConversationHandler after ending conversation

I'm trying to develop my own bot with the python-telegram-bot library. I have a problem with ConversationHandler, that may come from the fact that I haven't understand very well how to use it. I would like to put a /settings command to my bot that,…
Gianmarco F.
  • 780
  • 2
  • 12
  • 36
4
votes
1 answer

How to send photos with self-destruct timer using Telegram Bot API?

In the Telegram app, you can send photos that self-destruct and can't be screenshotted by clicking on the clock icon before sending them. Is there any way to reproduce this behavior using the Telegram Bot API? I'm using python-telegram-bot and…
Ozymas
  • 427
  • 1
  • 5
  • 12
4
votes
2 answers

Sending locally hosted photo on telegram bot

I'm using api.telegram.bot and requests to send messages and images. requests.get(url + 'sendMessage', params=dict(chat_id=send_to_user_id,text="Messo")) This is working fine. My telegram user is able to receive the message "Messo". Now, I'm trying…
Gen Tan
  • 858
  • 1
  • 11
  • 26
4
votes
3 answers

python-telegram-bot: How to keep the bot working after changing the code and re-running it

I'm trying to create a telegram bot using python-telegram-bot. For this bot I'm using ConversationHandler. The question is that when I change the code and re-run it, the bot waits until the user enters the command (e.g. /start) to jump into the…
Amir
  • 486
  • 3
  • 10
  • 17
4
votes
1 answer

how to get chat_id and message_id in telebot(pytelegramBotAPI) to update last sent message in telegram bot(Python)

Here is my piece of code bot.edit_message_text(chat_id = CHAT_ID, message_id = MESSAGE_ID, text = "message has been updated", reply_markup=inline_keyboard)
Jahongirmirzo
  • 103
  • 1
  • 1
  • 7
4
votes
2 answers

How to make telegram keyboard button issue commands?

I just got acquainted with the keyboard buttons for telegram bots using the .KeyboardButton from the Telegram API documentation but I have an issue; so far I've only been able to design the buttons such that the output after clicking on the button…
4
votes
1 answer

python-telegram-bot using webhook

I was developing a telegram bot, running from my personal machine (Mac) The bot is running on python, in a specific environment with modules installed on that environment Now that the bot is fine, I'd like to put it on a web server, running Apache.…
Roberto Junior
  • 115
  • 1
  • 1
  • 9
4
votes
8 answers

Although I install python-telegram-bot, error of no module named 'telegram'

I installed telegram packages. But when I try to run the simple example, echobot.py, I got an error: Traceback (most recent call last): File "echobot.py", line 8, in import telegram ImportError: No module named 'telegram' Can anyone…
Mahyar
  • 57
  • 2
  • 4
  • 9