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
0
votes
0 answers

Chat types in pyrogram

Why is the 'members' list always empty when I try to append Telegram channels to it in the given code? async def main(): async with app: async for dialog in app.get_dialogs(): # print(dialog.chat.title or…
0
votes
0 answers

Problem with sending video using python telegram libraries

I've sent this videos using python libraries (first with pyrogram, second with telethon but I've sent them as a client) and I got this (smaller videos are sent properly) My friends say that they cant see them as well (I can watch and download them…
0
votes
1 answer

get list of archived chats in pyrogram

How can I get list of archived chats with pyrogram? or with any other python library? I have searched a lot in documentation and goolge, couldn't find anything. looks like not implemented in pyrogram. ---------------------------------------------
EBRAHIM
  • 17
  • 5
0
votes
1 answer

How to run the GetMessagePublicForwards on Telethon / Pyrogram on Python?

I am trying to run the GetMessagePublicForwards function for a public channel on Telegram, using either the telethon or the pyrogram Python libraries. That function should allow to "Obtains a list of messages, indicating to which other public…
0
votes
0 answers

Terminating a long-running function in Pyrogram library based on user messages

In the Pyrogram library, I have implemented functions that initiate a long-running process whenever a user sends a "do" message to the bot. Now, I would like to terminate the ongoing function for a specific user whenever they send an "exit" message.…
0
votes
1 answer

How to get all chat members of Telegram group?

Using Pyrogram I am trying to get the id of users who are chat members, but the get_chat_members function does not return all users, about 5-10 depending on the selected group, although there are many more in the chat. How do I get all users? from…
0
votes
0 answers

How to handle all errors in async function (Pyrogram library)

I have a few thousand lines of code that consists of several normal and async functions. I want to save all the errors I receive in a file without trying/excepting or logging the entire code. I got acquainted with this excellent function by…
Sayhag
  • 44
  • 4
0
votes
0 answers

Not stopping the process with (Ctrl + C) while using asyncio.gather

When I use asyncio.gather to run two asynchronous functions, one of which is infinite, the program does not stop with Ctrl + C. One of them is idle related to pyrogram and the other is an endless function. I tried many methods, but none of them…
0
votes
2 answers

How to get user id of the sender who sent the message in a telegram channel?

My telegram bot is an admin in a channel. I'm listening to message using on_message handler. I want to get the username/userid of the user of that message. How can I do that in pyrogram or another python telegram bot library?
0
votes
1 answer

How to run aiogram bot and pyrogram app together (these two modules)?

I wrote a function on pyrogram that parses the history of a chat. The history is filtered by participant id, if a specific user wrote to the chat, the message will be forwarded to me. (We need to know: the name of the group, the id of the…
0
votes
1 answer

Pyrogram: Get detailed Chat media permissions (Can send stickers, Can send videos)

Telegram client has rich Chat media permissions (Can send stickers, Can send videos, etc). How can I check if stickers, images or videos can be sent in chat using Pyrogram?
IML
  • 181
  • 2
  • 7
0
votes
0 answers

Problem with replying to new messages in the channel

When creating a new message with the filters.channel parameter in the decorator, the bot does not create new comments to the channel message, if you change this parameter, it will respond to all messages from all types of chats, and I only need…
Fiv_
  • 3
  • 2
0
votes
1 answer

How to process telegram messages in parallel using pyrogram

from pyrogram import Client app = Client(client_name, api_id=api_id, api_hash=api_hash) async def handle_messages(client, message): await some_other_function() app.run() If multiple messages are received together, it seems to process them…
understack
  • 11,212
  • 24
  • 77
  • 100
0
votes
0 answers

raise error 'int' has no len() in raw method GetMessagesViews pyrogram

I try get and increase view a post channel but get this error: File ~/.../venv/lib/python3.10/site-packages/pyrogram/raw/core/primitives/vector.py:57, in Vector.__new__(cls, value, t) 55 def __new__(cls, value: list, t: Any = None) -> bytes: #…
Pooya
  • 1
0
votes
1 answer

Prevent TimeoutError from asyncio in Python

I am building a test suite for my Telegram Bot. There is a long-running task which may take +10mins. However, after ~15s I receive a asyncio.exceptions.TimeoutError This is a simplified code: from tgintegration import BotController from…
Geiser
  • 1,054
  • 1
  • 12
  • 28