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

Reseting variables for new user in Telegram bot (python)

I have a Telegram bot which responds with different messages depending on the value funcnex.state has. Function is operating with this class: class FuncCreator: def __init__(self, start_state): self.state = start_state def…
Alex Kedrov
  • 21
  • 1
  • 7
-1
votes
1 answer

how i can access to telegram bot database? I want to edit my bot's database

I'm new to telegram bots, I want access to my bot users chat_id? is it possible? another way? existence? I could not find any description about that. How can I obtain it for a user?
Sami
  • 1
  • 3
-2
votes
0 answers

how to Receive and store the info from a user in my telegram bot after entering the command by user

I'm using application library not updater and I'm stuck in this problem i have read documentation but haven't find any answers for example the user command /donte_code then wants to insert some data bot when i catch the text it includes…
Darknight
  • 1
  • 1
-2
votes
1 answer

How to make event.respond but just first sender will be responded? with Telethon

I have a question regarding the event on the telethon. So, I want to make something like event.respond(). But only the first sender will be responded by the bot. If there is a second sender - and the rest are not responded to by bots. How to make…
Ravi
  • 20
  • 1
-2
votes
1 answer

Send notifications in telegram group

How can I have my telegramBot send automatically messages in a group? def handle_event(event): #print(event) global amount0In global amount1Out global amount1In global amount0Out amount0In = event['args']['amount0In'] …
jimmyblue
  • 1
  • 2
-2
votes
1 answer

The telegram bot does not work(pyQiwi or aiogram)

Hello everyone I wrote a bot for a freelance tutorial order, the bot responds to messages, but there is a problem with payment, after entering the amount of replenishment, the bot does not respond, maybe I made a mistake somewhere? main.py code …
Mr. Bait
  • 23
  • 5
-2
votes
2 answers

Speech recognition with python-telegram-bot without downloading an audio file

I'm developing a telegram bot in which the user sends a voice message, the bot transcribes it and sends back what was said in text. For that I am using the python-telegram-bot library and the speech_recognition library with the google engine. My…
-2
votes
1 answer

Python-Telegram-Bot: How to wait for user input after clicking on InlineKeyboardButton

I'm working on a bot with the Python-Telegram-Bot API. Right now I'm updating the bot menu with InlineKeyboardButtons instead of ?menu, ?info type of commands (like on Discord). But I came across some trouble. Let me explain step by step what the…
-2
votes
1 answer

how to escape texts for formatting in python

I have the following text. "\*hello* * . [ }" It should be escaped like this: "\*hello\\* \* \\. \\[ \\}" How to do this with python regex? Every special character (the special characters are: _, *, [, ], (, ), ~, `, >, #, +, -, =, |, {, }, ., !…
a14stoner
  • 55
  • 1
  • 9
-2
votes
2 answers

Process finished with exit code 0 for Telegram Bot

I'm new to Pycharm but as a beginner, I know I get "Process finished with exit code 0" which means that My code doesn't have any error, but the code is running only 2 seconds. Could you guys help me out, please? Much appreciate…
-2
votes
2 answers

How to send large files through Telegram Bot?

I've been working on a bot that would send users videos (mostly larger than 500mb). I've read the telegram bot api docs. There is a restriction of 50MB, with videos/animations/documents. In the recent changes, Telegram announced now bots can send…
-2
votes
1 answer

Is there a way to make Telegram bots(python created) to send media on command?

So I've been making a tg bot. One of the commands is /rickroll which is planned to send them a music file from my computer along with a message when they enter that command. This is part of the code that is focusing on that command now: def…
-2
votes
1 answer

Python Telegram Bot: button data invalid

I am trying to make a super simple telegram bot using PTB. The bot has a button, when I click the button bot should make an http request to the web (without opening browser). And show the response data. Here is the piece of code I am using: def…
-2
votes
1 answer

How to read message from telegram group if the bot is not in the group but user is?

How to read message from telegram group if the bot is not in the group but user is
Yogesh Pandey
  • 13
  • 1
  • 3
-2
votes
1 answer

How to build python telegram bot?

I'm learnning python and i want to develop my self. I want to do this using telegram bot how can do it? For example i want to build un instagram video downloader. could you help me how to do that , from where i shall start , which library shoud…