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

Telegram user api

I have a task to communicate with someone else's bot in Telegram by making requests. Is it possible somehow to send messages, press keys inline through requests and receive a response? p.s. not having a bot api key Selenium doesn't quite suit me.
Павел
  • 19
  • 5
-1
votes
1 answer

python telegram bot - how to get bot role for private channels?

bot.get_chat_administrators seems to return ChatMember instance for public channels. I need role of my bot in private channels.
OuzKagan
  • 482
  • 4
  • 8
-1
votes
1 answer

Inner wrapper function never called

I'm currently working on a small Telegram bot library that uses PTB under the hood. One of the syntactic sugar features is this decorator function I use, to ensure code locality. Unfortunately, the inner wrapper is never called (in my current…
-1
votes
1 answer

I need example on how to mention using PTB

I need further elaboration on this thread How can I mention Telegram users without a username? Can someone give me an example of how to use the markdown style? I am also using PTB library The code I want…
-1
votes
1 answer

Deploy Django Telegram bot on digital ocean

I am a beginner python programmer. I made a Telegram bot in Django framework. The bot's files are located in myapp/management/commands/bot.py. I am using 2 terminals on my computer to use both the bot and the Django administration on the local…
-1
votes
1 answer

Object of type InputMediaDocument is not JSON serializable, i tried to send file over telegram bot

query.edit_message_text(InputMediaDocument("https://t.me/aastuchem/125")) TypeError: Object of type InputMediaDocument is not JSON serializable
-1
votes
3 answers

How to make auto-run python file when time is 06:00 P.M

I have telegram bot which is made by python. The file must run at 06:00 P.M everyday. My PC is Windows 10. How can I achieve this , please guide me.
-1
votes
1 answer

i want to write some text in .txt file with bot command (telegram bot)

first of all, i make a telegram bot using python 3.10 with telegram.ext as module. i make a certain command can be run only with certain role. thus, i make a txt file for each role. so that command for example "/add_user" can only be run with…
-1
votes
1 answer

How to store ConversationHandler States?

I created a ConversationHandler function for my bot. But the issue is I uploaded it to heroku and there my bot script is keep restarting after a specific time for that reason on every restart we need to start ConversationHandler again by sending a…
-1
votes
1 answer

Send Telegram message as a user

I want to know if it possible to send message to my telegram bot as a user. Maybe I should send a request with my credentials? Or I am completely missing something? UPD: Ok I see it is not clear. I want to send message using program.
lisichka ggg
  • 563
  • 3
  • 15
-1
votes
1 answer

Python Telegram Bot how to make the bot respond to multiple messages in a function

I'm new in StackOverflow. I'm currently making a telegram bot with the python-telegram-bot library. Unfortunately I'm having a problem that I tried so many times to solve, with no results. I'm wondering how I can make the bot sends a message, waits…
-1
votes
1 answer

requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='api.telegram.org', port=443): # python telegram bot using pytelegrambotapi and Tor

When I want to connect to telegram bot using Tor that returns error blow requests.exceptions.ConnectTimeout: HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /bot/getUpdates?offset=1&timeout=20 (Caused by…
Bambier
  • 586
  • 10
  • 16
-1
votes
1 answer

Strange Telegram Bot probem

I have a python Heroku app that hosts a telegram bot. It's using python-telegram-bot. It works perfectly except 1 command.. That command is /reputation. And please read the notes at the end. In the project directory we…
-1
votes
2 answers

AttributeError: 'list' object has no attribute 'data_filter'

I want to make a Telegram bot to notify korea school meal but It has a problem AttributeError: 'list' object has no attribute 'data_filter' I tried to modify the source code, but I was quite a beginner, so another error occurred when I tried to…
-1
votes
1 answer

Want to print only phone numbers not else in python

I had a code for making a telegram bot and I only want to print the numerical digit here, however I'm only getting the dict.value and my module which I'm using for this bot only allows the numerical number. My code: def search(update,context): …