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

Use 'send_ Video 'When uploading a video, the video will stretch

When "pyrogram" is used to upload videos in batches, the video frames will stretch and the video duration will not be displaye Because there are many videos and different screen sizes, the specific width and height cannot be set def…
suixin
  • 11
  • 2
1
vote
1 answer

Pyrogram: how to run async method in FastAPI router

How i can run pyrogram method in FastApi routes? I use Pyrogram and i have some methods for working with Telegram. class UserBot: def __init__(self, username: str, debug: Optional[bool] = False) -> None: self.username = username …
Иван
  • 158
  • 2
  • 12
1
vote
1 answer

How to return from async function?

I have this function code, when I call it, output is my list printed but this list doesn't return. from pyrogram import Client from pyrogram import enums async def search_for_deals(message_to_search): async with client: async for…
vankerok
  • 21
  • 2
1
vote
1 answer

How to take a bio with a pyrogram

import asyncio from pyrogram import Client from pyrogram.raw import functions api_id = api_hash = "" TARGET = - app = Client("my_account") async def main(): async with app: # для парсинга группы async for member in…
1
vote
0 answers

How to resume a process in python

I have a telegram bot with over 60k users. And broadcasting a message to all those users takes more than 15 hours to complete. But my bot is running on GitHub workflows. And the bot gets restarted every 6 hours. So if I have a broadcast in progress,…
Shaheen M
  • 36
  • 5
1
vote
1 answer

line 242, in __init__ else: raise ValueError("Unknown storage engine")

I am trying to deploy this bot on the local machine. But I have got irritated by an error. main.py import logging from .utubebot import UtubeBot from .config import Config if __name__ == "__main__": logging.basicConfig(level=logging.DEBUG if…
Ankit
  • 123
  • 9
1
vote
1 answer

Calling a function in pyrogram from another Python file

In Pyrogram package, how can I call a function from another Python script? For example, suppose that the Pyrogram function takes two arguments chat_id and text as input and then send text to given chat_id. We know that app.send_message(chat_id =…
1
vote
0 answers

sms code not coming from pyrogram for new accounts

When I call in pyrogram function "send code" to new account, i don't get it. But i get it for already created accounts in telegram's message. Here is a part of a code: phone_number = "+79111443505" client = Client(":popo", app_id, api_hash) …
Stranik
  • 129
  • 8
1
vote
3 answers

How to delete a private chat (pyrogram)

i tried pyrogram.raw.functions.messages.DeleteChat but get following trackback pyrogram.errors.exceptions.bad_request_400.PeerIdInvalid: Telegram says: [400 PEER_ID_INVALID] - The peer id being used is invalid or not known yet. Make sure you meet…
charlieqwq
  • 11
  • 4
1
vote
0 answers

how to fix loop in a code Python (Pyrogram) - reportpeer

question, I am building a module for reporting fake news and propaganda, using many accounts (cients - connections). I can't fix the loop to go through the list for each channel TypeError: required asyncio.Future, coprogram or awaitable or something…
RiseFox
  • 11
  • 2
1
vote
1 answer

Telegram video call with USB webcam stream (pytgcalls)

I'm trying to send the stream of a usb webcam with pytgcalls on Telegram. In the documentation there is nothing about that, but there are several example of streaming youtube video or local mp4 files. I have found this example of streaming a youtube…
1
vote
1 answer

PySimpleGui + Telegram how to upload file in a separate thread?

I'm trying to upload a file in thread. So later I can add callback with progress bar update etc. I've tried to do that with threading and PySimpleGui's perform_long_operation. It is not working this way. So how do I do it? Probably, I'm missing…
MonZon
  • 31
  • 9
1
vote
2 answers

Pyrogram telegram poll : how to get the chosen option from user

I created a telegram bot that sends quiz with pyrogram, but i want to get the user's answer using a method called Poll.chosen_option and then compare it with the correct answer!! But this method returns None, Please how can i solve that and get what…
louay075
  • 21
  • 3
1
vote
0 answers

Python Pyrogram handle poll answers from users

I've sent a poll using Pyrogram but i don't know how to get users answers! For example: the quiz has 4 answers one of them is correct when the user press one of the answers i want to get what they pressed, here my…
louay075
  • 21
  • 3
1
vote
2 answers

Method that returns file size and possibly file type

Is there any method to return the size of a file and possibly file type in Pyrogram (not Python itself)?
Ne0
  • 11
  • 2
1 2
3
18 19