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

How to make a bot talk conversationally using Pyrogram on Telegram

I wrote a bot using Python Telegram Bot. Then, i wanted to write some automatic tests for it. And that's the problem: i needed a way to send messages, wait for my bot to reply, and then react to those messages (either sending more text or clicking…
0
votes
0 answers

Any way to send media group with keyboard?

I'm trying to send a media group with a keyboard, but I don't understand how to do it. Here is the doc: https://docs.pyrogram.org/api/methods/send_media_group#pyrogram.Client.send_media_group There is no function or arg to implement a keyboard. is…
MaHarder
  • 11
  • 6
0
votes
0 answers

Error in the method call request_callback_answer()

I am getting the following error when I try to use client.request_callback_answer(...) pyrogram.errors.exceptions.bad_request_400.BotMethodInvalid: Telegram says: [400 BOT_METHOD_INVALID] - The method can't be used by bots (caused by…
0
votes
2 answers

pyrogram: Client produce KeyError while starting the bot

When I am starting my telegram bot by Pyrogram using the latest version v2.0.103 app = Client("BillyKaiChengBot",api_id="apiid",api_hash=os.environ['API'],bot_token=os.environ['TOKEN']) with app: #error produces here loginapp =…
0
votes
2 answers

Meaning of `saved_from_peer` and `saved_from_msg_id` inside `MessageFwdHeader` type

The message in telegram can be forwarded from users/chats/channels to other users/chats/channels. The message type has a fwd_from field with type messageFwdHeader - the from_id field inside of this object describes where the message comes from (user…
winwin
  • 958
  • 7
  • 25
0
votes
0 answers

My telegram Jojo bot user's data gets changed everytime the program is re-run

user_data = {} # Load user data from the JSON file with open("user_data.json", "r") as f: user_data = json.load(f) # Save user data to the JSON file def save_user_data(): with open("user_data.json", "w") as f: json.dump(user_data,…
LotousMan
  • 1
  • 1
0
votes
1 answer

How do I scrape photos and videos with Pyrogram or Telethon?

How do I scrape photos or videos from a group on Telegram using either Pyrogram or Telethon? I know how to make a client and so forth, but not sure which functions to call (I have already read the documentation). I want the videos as mp4 files, and…
0
votes
1 answer

How to get chat history since a particular date in pyrogram

I know that the get_chat_history() method has a parameter "offset_date" but it gets all messages older than a particular date, and I need to get all messages that are "newer". Please help. I've tried googleing the problem, but nothing has helped.
matveygal
  • 1
  • 2
0
votes
1 answer

Why doesn't pyrogram see the chat description?

pyrogram doesn't see the chat description I write to my chat with a description and @app.on_message() async def handler(_, msg: types.Message): print(msg.chat.bio) print(msg.chat.description) this /\ outputs this \/ None None
0
votes
0 answers

Copy message without URL(Link) pyrogram

How to delete any link (text_link, url) from message that i want to copy (copy_message function)? I imagine it like this: We have original message from some telegram channel enter image description here And I want to copy this message to my telegram…
dyrb
  • 3
  • 1
0
votes
1 answer

how to scrape telegram members about/bio information

I tried this code to scrape telegram's username, userids. I need to scrape user's about/bio info too but after trying many codes from telethon, pyrogram etc, it didnt't worked. I recently started learning python basics. I have mentioned below the…
0
votes
1 answer

How to edit a message and add a image to it using pyrogram?

I'm developing a Telegram bot that will send a text message, and then after a while will change it by adding an image to it. I use Pyrogram, here's the small snippet: @app.on_message(filters.command(["start"])) async def start(client, message): …
Denking
  • 31
  • 1
  • 4
0
votes
0 answers

Run code without need to stop and re-run it (Telegram Bot)

I have a telegram bot and I need to update it without stopping it. Something like uvicorn when we were running an app. ( uvirorn filename:appname --reload ) I need such a thing for pyrogram. from pyrogram import Client app =…
S. Jacson
  • 33
  • 6
0
votes
1 answer

How to log in to telegram using pyrogram?

Please help, on the first run, I executed the send_code() function and saved the phone_code_hash, on the second run, I executed main() with the code received from the telegram and the hash code saved from the send_code function, but when sign_in I…
valeX
  • 3
  • 1
0
votes
0 answers

python: Transfer of Objects for their further exploitation

[python] AYOGRAM and PYROGRAM How could I account save to: waiting state.update_data(account=account) account = Client(name=f'{phone}', api_id=api_id, api_hash=api_hash, in_memory=True) sc = pending account.send code(phone) standby…