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
2 answers

how do I access the file_id in this list?

i'm trying to access file_id but its in a list. this is a part of the code update.message.photo.file_id i am getting this error: 'list' object has no attribute 'file_id' here's the json file: { 'update_id': 703304245, 'message': { 'photo':…
Shadmehr
  • 3
  • 3
-1
votes
1 answer

Having error "got an unexpected keyword argument" and can't fix it

Good day to everyone, I have been writing a simple bot to delete messages from one group and to forward them to another, so while executing I am facing this error, it says "TeleBot.forward_message() got an unexpected keyword argument 'chatid'" I am…
-1
votes
1 answer

Unable to run Python Telegram Bot Package - Error

Hello StackOverFlow Community. I am working on a telegram bot but facing the error: (stockAlert) PS D:\Development\StockAlert> python .\stockAlertBot.py Traceback (most recent call last): File "D:\Development\StockAlert\stockAlertBot.py", line 1, in…
-1
votes
3 answers

using if else while declaring a variable

I'm writing a script to sent proxies file from a directory to telegram channel. With the help of some good folks I was able to complete it almost from telegram import Bot, InputMediaDocument BOT_TOKEN = "xxx" CHAT_ID = xxx def main(): bot =…
Ajesh
  • 43
  • 10
-1
votes
1 answer

Getting TypeError: delete_message() missing 1 required positional argument: 'self', when trying to delete a Bot message in Telegram Bot

I am using 'python-telegram-bot' when trying to delete the previous message send by the Bot above got raised! my code: updater = Updater(BOT_TOKEN, use_context=True) dispatcher = updater.dispatcher def start (update: Update, context:…
-1
votes
2 answers

Can I use a .txt file as a user database in Telegram? I use Telethon

So, I created a minigame bot on telegram. The bot just contains a fishing game, and it's already running. I want if a user fishes and gets a fish, the fish will be stored in a database. So the user can see what he got while fishing. Does this is…
Ravi
  • 20
  • 1
-1
votes
1 answer

Some questions about using python-telegram-bot

Some questions about using python-telegram-bot I'm using python-telegram-bot to create a telegram bot. I want to forward a graphic message (similar to the one below) to the robot, and the robot removes the image and returns the text. I didn't find…
essesoul
  • 21
  • 6
-1
votes
1 answer

Telegram bot convert youtube link to mp3 (Python)

How to make a telegram bot that converts simple youtube link (something like https://www.youtube.com/watch?v=v3F3v8yNucc) into .mp3? Please suggest something with minimum efford
Scott
  • 4,974
  • 6
  • 35
  • 62
-1
votes
1 answer

How to receive a file in telegram bot, process it and send it back to user?

I need to get a file from user, download it, pass into a function to process it, and then send it back to the user. I've read the docs multiple times, but I still don't understand how to get a file_id and work with it. That's an echo code I've…
-1
votes
1 answer

I got an error when create telegram application

On my Telegram site, after filling in the fields, when I click on the submit button, I encounter this problem: Does anyone know what the solution is?
-1
votes
2 answers

Return does not return information

When wanting to return a value with the return and wanting to use it later in a variable, nothing is returned to me. #Actualizacion de informacion def messageHandler(update: Update, context: CallbackContext): userName =…
-1
votes
2 answers

Python Telegram Bot: How to measure interaction time/response time of user?

how can I measure the time the user uses to interact with the bot? E.g. The bot sends a message. We want to measure the time from the reception of the message to a response (click on a put on the online keyboard). I need this using python telegram…
-1
votes
1 answer

College Telegram bot

I am Creating a telegram bot using python and using the python-telegram-bot library for sending the response but how do I take Input from the input using this library? Have a great Day ahead Programmers
-1
votes
2 answers

Creating a function to concatenate strings based on len(array)

I am trying to concatenate a string to send a message via python>telegram My plan is so that the function is modular. It first import lines from a .txt file and based on that many lines it creates two different arrays array1[] and array2[], array1…
-1
votes
1 answer

TypeError: 'coroutine' object is not subscriptable | Python3

▶️ Code : photos = client.get_profile_photos("me") await client.delete_profile_photos([p.file_id for p in photos[1:]]) ▶️ Output / TraceBack : Traceback (most recent call last): File "/plugins/code_runner.py", line 44, in eval await…
x-gorn
  • 43
  • 6