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
5
votes
3 answers

How to login manually to telegram account with pyrogram without interactive console

I'm using Python's pyrogram lib to login to multiple accounts. I need to create a function just to send verification code to account and then read it from other user input (not the default pyrogram login prompt). When I use send_code it sends code…
Khalil Abbas
  • 110
  • 2
  • 7
4
votes
1 answer

How to proceed to the next cycle?

This code sends a message to the Telegram Supergroup if a new member has joined. When an error occurs when sending a message, I want to change my account to continue. It is possible to go to the next "item". How do I go to the next account in a loop…
3
votes
2 answers

What does mean parameter offset in function get_inline_bot_results?

I cannot understand what parameter offset did in this function and what's kind of values accept? I try use integers but there is no effect. from pyrogram import Client, filters import time app = Client( "my_account", api_id=api_id,…
3
votes
1 answer

Send premium-emoji with Pyrogram

I need to send a premium emoji on the user's account using Pyrogram. I tried to send with send_message() a list of MessageEntityCustomEmoji and MessageEntity. The first one gave the error 'MessageEntityCustomEmoji' object has no attribute '_client',…
3
votes
1 answer

How to deal with two event loops? Pyrogram's and Tkinter's

I am using Pyrogram and Tkinter: from tkinter import * from pyrogram import Client root = Tk() app = Client("my_account") First, I register a handler with Pyrogram: @app.on_message() def message(client, message): print("Message!") Second, I…
Bob
  • 1,713
  • 10
  • 23
3
votes
0 answers

RuntimeError: There is no current event loop in thread 'ThreadPoolExecutor-0_0'

Trying to call app.add_chat_members from Pyrogram in a Django view but can't seem to instantiate the client. Steps to Reproduce views.py ... from pyrogram import Client def add_users_to_chat(chat_id, user_ids, forward_limit = 0): user_bot =…
Joshua
  • 197
  • 12
2
votes
0 answers

Telegram multiple online clients are not showing as online in groups

I am using pyrogram to run multiple clients ( about 30 client ) at the same time . I need clients to appear online in groups . They are showing online status in profile but not in groups ( only about 2 users appear online in groups even if all 30…
Nour Eldin
  • 21
  • 3
2
votes
2 answers

How do I mark a message as read?

How do I mark a message as read? app = Client(session_name, api_id, api_hash) @app.on_message() async def my_handler(client, message): await app.send_message(message.from_user.username, "ok boss") await…
2
votes
1 answer

Deploy Telegram Bot (Pyrogram) on Back4App

I just found Back4App free tier to test my lightweight apps, want to deploy a Telegram bot written with Pyrogram but didn't find any guide on the website for Python app deployment. How can I deploy my app? It doesn't have a database and has only two…
Ali Abdi
  • 408
  • 7
  • 21
2
votes
1 answer

how to run pyrogram userbot with multiple user accounts using thread

I am coding a userbot in pyrogram but I want to run multiple Clients with different telegram account but I am stuck here. I want to run userbot on multiple accounts using one script if I will run it separately then I have to host it so many time I…
Akrash Nadeem
  • 96
  • 2
  • 11
2
votes
0 answers

Pyrogram does not work inside the Pytelegrambotapi Handler

There is a handler for processing messages for the telegram bot. Inside under certain conditions, the Pyrogram method should operate # coding: utf8 import telebot from pyrogram import * import time bot =…
2
votes
2 answers

asyncio not working on Google Cloud Functions

I have this function which works fine locally on my machine with python 3.8, but it throws runtime error on Google Cloud Functions. def telegram_test(request): request_json = request.get_json() import datetime import pandas as pd …
2
votes
2 answers

how forward link from a inline button to another chat in pyrogram

I use a user bot in pyrogram to save links from a bot to a personal channel. I use this code: def forwardlik(mensaje) if "Link!" in mensaje.text: mensaje.forward(ids["channel"]) But now the bot it's sending the link with a button…
2
votes
1 answer

What should i do to get "telegram private group ids" new way

I want to create new bot that print users first name in telegram groups. So it could be easily done in public groups but in private groups I need its id so I have to add bot to private groups and then what should I do? I want to do it in Python or…
1
vote
1 answer

pyrogram: filenames of documents or videos files from topic of a supergroup is not printed

I try to extract filenames from a topic of supergroup. I try in this way from pyrogram import Client app = Client( name="@Peter_LongX", api_id=27*******, api_hash="b5*******************", phone_number="+393*******", …
Peter Long
  • 21
  • 3
1
2 3
18 19