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

Pyrogram, problem [400 PEER_ID_INVALID] on Linux

I wrote a simple script on python to copy messages in one chat to the other. The destination chat is a chat with a telegram bot. It works perfectly on my computer, but I wanted it to work on my Raspberry Pi (not to keep my Windows computer ON). When…
-1
votes
1 answer

How to write the received id from get_chat_members Pyrogram to a separate file?

How can I make it so that when parsing members in a group using the pyrogram library, it writes to a separate file, only the id or username of the user? My code: from pyrogram import Client TARGET = -10011796008 app = Client("my_account") async…
-1
votes
1 answer

AttributeError: 'Message' object has no attribute 'message_id' (Pyrogram)

Created a command named redeemcode, to ask the user for redeem code as input and storing it as a variable 'code' heres the code: @bot.on_message(filters.command('redeemcode')) def redeemcode(bot, message): message.reply_text("Send the code to…
dedSec PC
  • 5
  • 1
  • 4
-1
votes
1 answer

How to prevent the bot from responding to the admin in Pyrogram

@app.on_message(filters.private & filters.user != ADMIN) def something(app, message): doSomething()
-1
votes
1 answer

TypeError: 'coroutine' object is not subscriptable | Python3

▶️ Code : photos = client.get_profile_photos("me") await client.delete_profile_photos([p.file_id for p in photos[1:]]) ▶️ Output / TraceBack : Traceback (most recent call last): File "/plugins/code_runner.py", line 44, in eval await…
x-gorn
  • 43
  • 6
-1
votes
1 answer

How to remove the error 400 PEER_ID_INVALID?

import asyncio from pyrogram import Client from pyrogram.errors import PeerFlood import time api_id = 12905662 api_hash = "a7cfcd44cb95d26d7529d547c9a1d9ef" vubor = input('Напишите "1" для парсинга, "2" для рассылки! ') text = input('Текст для…
-1
votes
1 answer

get all chat members id pyrogram

How can I get all members of chat ids? I tried app.get_chat_members, but i need only user id, and nothing else. Tried this: countingusers=app.get_chat_members(f"{link}")
ggindinson
  • 21
  • 7
-1
votes
2 answers

Trouble importing filters using Pyrogram

I am facing this error and I do not know how to solve it and I think I have written my code correctly File "C:\Users\Revenger\index.py", line 1, in from pyrogram import Client, Filters ImportError: cannot import name 'Filters'…
-1
votes
1 answer

Pyrogram: how to retrive a selected info using get_me()

i need to create a command in my userbot that if the user use it his username will be (normal username) + ONLINE. Im trying to use get_me() for getting the username but i get all the infos. I need only username... How i can do this?
null.user
  • 1
  • 1
-2
votes
1 answer

Can i get chat id with pyrogram?

I want to know, is there a way, to get a of a chat which i'm joining my bot to?(using pyrogram) like, i created a chat manager bot, and when i'm joining him to chat, i want him to work in this specific chat. But every function like…
-2
votes
1 answer

How to make pyrogram python filter many channels

I want the pyrogram track library to be able to filter more than 1 channel @app.on_message(filters.chat("test channel")) I tried @app.on_message(filters.chat(chats=Chats)) but it didn't work.. Chats = '@test', '@test',…
ArtL
  • 1
-2
votes
1 answer

How to fix the issue of {sqlite3.OperationalError: unable to open database file} in aws-ec2 instance ubuntu machine?

I am trying to deploy this telegram bot(https://github.com/odysseusmax/utube/) on AWS-ec2 instance which is using ubuntu-20. At the start everything is fine until I got this error: sqlite3.OperationalError: unable to open database file let me give…
-2
votes
1 answer

Print two inline buttons in a row

I have a Python code where on start I can print one inline button per row. I want to modify to print 2 inline buttons in a row. How can I modify the code? @app.on_message(filters.command("start")) async def mute_user(_, message): group_id =…
Rinku
  • 81
  • 2
  • 14
-2
votes
1 answer

How to sign in in Pyrogram only by phone number Telgram

app = Client.sign_in("phone_number") How to sign in in Pyrogram only by phone number without api_hash and api_id
-2
votes
1 answer

Trying to handle an error but cannot do it! Telegram

I have made a telegram bot using pyrogram to upload a large video and the the progress bar is shown, however the progress bar is repeatedly edited message with new values. This error message is shown frequently: Waiting for 3 seconds before…
ADITYA DAS
  • 340
  • 2
  • 6
1 2 3
18
19