Questions tagged [pyrogram]

Pyrogram is a Telegram framework, used for custom apps for both user and bot identities. It uses the MTProto API

Pyrogram is a modern, elegant and easy-to-use Telegram framework written from the ground up in Python and C. It enables you to easily create custom apps for both user and bot identities (bot API alternative) via the MTProto API.

Homepage: https://docs.pyrogram.org/

278 questions
1
vote
0 answers

How to use phone_code parameter in pyrogram framework(python)

If you know pyrogram is a Telegram MTProto API Framework for Python Which You can give it a phone number to create a user account as a bot: see the doc When you give it a phone number, telegram will send you a phone code to authentication and you…
developer
  • 170
  • 2
  • 12
1
vote
1 answer

How do I print a message when there are updates from a specific channel (pyrogram)?

I receive a message with any new updates but I would like to receive one for a specific channel. @app.on_message(Filters.chat("mychannel")) def from_pyrogramchat(client, message): print("New message in…
holly
  • 43
  • 8
1
vote
0 answers

How to handle proxy connection timeout in pyrogram

I want to connect another proxy when i got timeout Error. but timeout error is not a raise so i don't know how to handle it. This is my code : from pyrogram import Client app =…
purya nms
  • 48
  • 1
  • 7
0
votes
0 answers

Cannot to correctly upload media files and texts from the telegram channel messages

I work on the on the python script, which downloads the contents of the telegram channel messages. I try to do this with pyrogram. The task is to create a separate folder for each message, and in each folder download photos or videos of the message,…
Kiten
  • 985
  • 2
  • 17
  • 35
0
votes
0 answers

Setting the DATETIME filter gives me a flood problem

With this code I can print message ID and filenames into results.txt and I have not flood problems. Only problem is that it doesn't print strings between 27-28 august 2023 but it prints all strings. import time from pyrogram import Client from…
Peter Long
  • 21
  • 3
0
votes
1 answer

Implementing pause and resume to handle flood of requests using Pyrogram in python

I'm trying to list the message_id and filenames from a Telegram supergroup topic. The last messages saved to results.txt were Message ID: 142452 File Name: 12_La_Modella_Di_Pickman.pdf Message ID: 142451 File Name: 11_Halloween.pdf But when the…
Peter Long
  • 21
  • 3
0
votes
0 answers

How to run two asynchronous tasks endlessly in asyncio?

My code: import asyncio from pyrogram import Client from art import * from datetime import datetime from colorama import Fore, just_fix_windows_console from pyrogram import enums from tqdm import tqdm just_fix_windows_console() bot = '#' api_id =…
dvbsh
  • 1
  • 1
0
votes
0 answers

Pyrogram does not work (does not run) on the server

I encountered the problem of program execution freezing while calling the run method of pyrogram library. This is the first time I've encountered something like this, no errors, no hints about what is needed. Configuration: ubuntu 18.04.6;…
Dron
  • 1
  • 1
0
votes
0 answers

How to properly stop and start bot in pyrogram(not restart)

I want clients to be able to stop a bot, and after a while start it again. If I use stop() function, and then start() function again, it no longer receives any updates. I don't want to use restart(), because restart starts straight away, which is…
Efim Rubin
  • 173
  • 1
  • 16
0
votes
0 answers

How to get data from Web App using Pyrogram

How to get data from Web App? I press on ReplyKeyboardButton, and then the Web App is launched. I input some data in the form, press on "Submit". Now I want to get the form data in my bot. I haven't found any web app data handler in…
srbssv
  • 23
  • 2
0
votes
0 answers

how to get the list of channels where a bot is admin using pyrogram?

I'm looking for a way to identify channels where a Telegram bot acts as an admin. My goal is to get a list of these channels to check if the bot has been added to any of them. I am currently using the Pyrogram framework to interact with the various…
0
votes
0 answers

How to read a channel post with an increase in the number of views on it in Pyrogram?

I can read posts from the channel this way: from pyrogram import Client from pyrogram import types chat_id = -1001878174410 api_id = 22257214 api_hash = "019bd32a22641c7c0c65833a8f283c17" app = Client( "my_account", api_id=api_id, …
0
votes
0 answers

How use pyrogram chatlist (JoinChatlistInvite)

I got a ChatList (all chats), but I don't know how I joined all chats with 1 request. check_list = await client.invoke(functions.chatlists.CheckChatlistInvite(slug=chat_list)) I have 1 option, join each chat separately, but maybe somebody know
Arthur
  • 1
0
votes
1 answer

How to edit message entities in Pyrogram?

Anyone knows how to edit entities in pyrogram? Below is a test script that I'm using, I just wanted to edit the 'url' entity of the message thru code but I'm getting an error on utils.py module: CODE: async with Client("tg") as tg: await…
jtrner
  • 1
  • 1
0
votes
0 answers

Pyrogram awaited OverflowError: int too big to convert

So, when i try to await bot.get_messages(CHAT_ID, MESSAGE_ID) i get OverflowError: int too big to convert. Both CHAT_ID and MESSAGE_ID are int. Any ideas? Expected await app.get_messages(CHAT_ID, MESSAGE_ID) returns types.Message