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

Why a link is not correct? (Pyrogram)

I have to join chats via links, which are in a file.Only 30 links were correct but if i try to join myself it will be succeed. Last time i tried to use a link in join_chat method: async def main(): await app.start() me = await app.get_me() …
Zervan
  • 21
  • 2
1
vote
2 answers

Ran the function during project execution using rocketry

I have a code similar to this, and I want the function "do_something" to be executed when I run the project. Its job is to prepare the database, etc. I don't know how do it. I would it if you could guide me. I have read the rocketry documentation,…
sobhani
  • 23
  • 5
1
vote
0 answers

Pyrogram Python fails to catch Exception

I'm trying to download pictures from Telegram with the Pyrogram API. After some images I do get ratelimited but the code fails to catch the exception an wait the given seconds. I keep getting these errors and it continues my for loop instead of…
yuskox
  • 11
  • 2
1
vote
1 answer

Python Pyrogram download_media doesn't work

I have a simple function to download images from Telegram messages by using Pyrogram, but the download_media method doesn't download anything for me, and the returned file_path is always None. The received message object and its photo attribute do…
abdus_salam
  • 738
  • 2
  • 7
  • 19
1
vote
0 answers

How to use telegram bot to handle that the user is typing write now?

I'm trying to capture user actions using a Python bot. Currently, I'm trying to take one example to learn and then implement it for others. Right now, I'm attempting to capture the moment when a user starts typing in the chat with the bot (not…
1
vote
1 answer

Cancel a ongoing pyrogram upload with an inline button

Well I created a class that is called from main.py bot is created from a telethon Client, while app is from pyrogram's; class uploader: def __init__(self, bot, app): self.bot = bot self.app = app self.is_cancelled =…
Nubuki
  • 11
  • 3
1
vote
1 answer

What is access_hash in telegram API?

When you contacts.resolveUsername, the result always contains both id and access_hash. It creates confusion for API users, as to why you are only able to resolve a user/chat/channel only by their username or by their (id, access_hash) pair (eg. here…
winwin
  • 958
  • 7
  • 25
1
vote
0 answers

breaking an async for loop with break in python

I have an asynchronous for loop and I would like to break it with an if statement. However, I am getting the following error: Task was destroyed but it is pending! task:
ai-py
  • 177
  • 1
  • 7
1
vote
0 answers

Message sent without sound (silently) in Pyrogram — how to determine?

The is no flag/attribute in Pyrogram if the message was sent silently. How to get it for incoming message? Official Telegram Api: https://core.telegram.org/constructor/messageService Tried to check all documentation, git repo an issues, but didn't…
1
vote
0 answers

Is there any way to click a bot's menu button which is a web app by Pyrogram

I wrote a userbot by Pyrogram to send_message, click bot keyboard with my telegram account. There's a bot , its menu button is a web app. Can I click its menu button by Pyrogram? I wrote some code, but it didn't work out. raw_bot_peer = await…
zhongwang
  • 11
  • 1
1
vote
0 answers

How to build a telegram bot for esxi and is it possible?

I have a bot written in python, the customer wants to make ESXI out of it (to be honest, I never worked with this) Is it possible? I did not find information on the Internet
krausser
  • 11
  • 2
1
vote
1 answer

is not a valid SentCodeType pyrogram

after I enter the phone number in the console for the pyrogram, the bot user string app.run() pyrogram gives this error: Exception has occurred: ValueError is not a…
1
vote
1 answer

How to upgrade pyrogram to the latest version in linux

I can't to upgrade pyrogram to latest version in Linux. I'm using pip3 install --upgrade pyrogram and it looks like my program is not seeing a newer version of pyrogram. But using the same command in Windows I was able to upgrade pyrogram to 2...…
1
vote
1 answer

Send message to user when he is online in Pyrogram

I am using Pyrogram to make userbot. I need to check if user is online and if he is online I will send him a message. I couldn't understand documentation. from pyrogram import Client app = Client( "my_account", api_id= 111111111, …
1
vote
0 answers

Pyrogram multi account compose

How can I make several accounts do the same thing in pyrogram through compose with one command? import asyncio from pyrogram import Client, compose async def main(): apps = [ Client("account1"), Client("account2"), …
Ho3EiN
  • 11
  • 1
1
2
3
18 19