telepot is a python library to access the Telegram Bot API and work with it via python script or console
Questions tagged [telepot]
109 questions
27
votes
7 answers
How to send photo on telegram bot
i'm just implementing a simple bot who should send some photos and videos to my chat_id.
Well, i'm using python, this is the script
import sys
import time
import random
import datetime
import telepot
def handle(msg):
chat_id =…

rollotommasi
- 461
- 1
- 6
- 11
12
votes
2 answers
Bad Request: query is too old and response timeout expired or query ID is invalid
I have been working a lot on a telegram bot for a long time now, but when I press an inline key to receive the pop up with:
bot.answerCallbackQuery (aalex_id, text = 'Notification at top of screen)
I get this error:
TelegramError: (u'Bad Request:…

Vaykor MIP
- 129
- 1
- 8
10
votes
3 answers
How can I bold text in telepot Telegram bot?
I have tried this
elif command == 'bold':
telegram_bot.sendMessage (chat_id, str("*bold*"), reply_markup=markup)
But it is replying *bold* instead of bold

SudoGuy
- 165
- 1
- 1
- 9
9
votes
2 answers
How to send a hyperlink in bot.sendMessage()
My bot sends out links. so I wanted to include a hyperlink like the one you can do with HTML for example -a href="google.com" Google /a shows up a click able text called "Google" how can I do this in bot.sendMessage()? and also if you have any idea…

chris
- 139
- 1
- 1
- 6
5
votes
1 answer
How does the DelegatorBot work exactly in TelePot?
I'm trying to study the python library Telepot by looking at the counter.py example available here: https://github.com/nickoala/telepot/blob/master/examples/chat/counter.py.
I'm finding a little bit difficult to understand how the DelegatorBot class…

Cesco
- 3,770
- 7
- 24
- 26
4
votes
1 answer
is there a way to make a telepot bot read messages from other bots?
I am developing a telegram bot using the telepot library for python and needed to have two bots communicate with each other in a group.
for some reason, neither bot cannot read messages sent by bots.
can someone tell me how i could do ?
here are the…

SAL
- 547
- 2
- 8
- 25
4
votes
3 answers
How to manage more users in a telegram bot?
I did a telegram bot with python, who send a message like
if message == '/start':
bot.sendMessage(chat_id, "Insert your name:")
a = 'name'
if a == 'name' and message != '/start'
name_user = message
bot.sendMessage(chat_id, "Insert…

Andrea Rossi
- 45
- 1
- 5
3
votes
3 answers
Python Bot Telepot error 'raise KeyError('No suggested keys %s in %s' % (str(keys), str(d)))'
I have already implemented a lot of telegram bots with Telepot 12.7 and never had a single problem. Now, suddenly, after adding my bot to a group it started spamming this error message:
raise KeyError('No suggested keys %s in %s' % (str(keys),…

Descanso7
- 55
- 1
- 7
3
votes
1 answer
Telepot error that keeps appearing again and again
I have created a bot for telegram groups but whenever someone sends a poll this error keeps appearing again and again..
API message that keeps giving error:
{"update_id":869921319,
"poll":{"id":"5427146762856956026","question":"[4/10] Qui \u00e9tait…

Sumit Jaiswal
- 216
- 1
- 4
- 17
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.

Igor Krutilin
- 41
- 4
3
votes
1 answer
python - telegram bot sendMessage in specific date
I am terribly new in python and my progress is like a snail:(
I want to make a telegram bot that send a message at specific date and time. I used apscheduler and telepot libraries for that. and this is my code:
import telepot
import sys
import…

faeze saghafi
- 650
- 10
- 25
2
votes
0 answers
how to handle multiple messages at once - telegram
I built a telegram bot using telepot that sand big amount of photos. (between 100 - 200 pics)
and I got a problem that if multiple users ask the bot for photos at the same time the bot will start sending the first request and then go to the second…

shaked maman
- 111
- 1
- 2
- 6
2
votes
2 answers
How do I schedule python telegram bot to send message at/after certain time?
I'm making a telegram bot using telepot to serve as a "medical" survey. I've done up the bot and it is working. Now I want this bot to send a message automatically at certain times of the day or after 24hrs to remind the user to start the survey. Or…

Nicopii
- 31
- 4
2
votes
1 answer
Telepot - read text of a sent message
I use telepot python library with my bot, in python 3.5. I want to read the text of a message that is already in a chat, knowing the id of the telegram chat and the id of the message. How can I do?

Antonio F.
- 21
- 3
2
votes
1 answer
Telegram API sendPhoto gives back "Bad Request: type of file mismatch"
I'm trying to upload a photo using telepot python library in a telegram bot.
fd, path = tempfile.mkstemp()
image_bytes = requests.get(url=fileUrl, stream=True)
with open(path, 'wb') as strm:
for chunk in image_bytes:
…

Marco Castano
- 1,114
- 1
- 10
- 25