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

Send a sticker with text added through pyrogram

I've discovered @Vulcybot on telegram which allows people to add text to a furry 'sign' sticker like so... example The user allows the submition of your own furry sticker to the bot.. However I don't want people to be able to use it.. I'd rather it…
0
votes
1 answer

I need a forward function code which forward the original message (pyrogram)

@bot.on_message(filters.chat(INPUT_CHANNELS) & filters.text) def forward_message(client, message: Message): text = message.text client.send_message(chat_id=DESTINATION_CHANNEL, text=text) I got this code here, but it just forwards text from…
0
votes
1 answer

How to catch a command after "start" when a new user connects to a bot?

I want to be able to handle a command like this: https://t.me/MyBot?start=aff_1234 How will I do it? I've tried this and it hasn't worked: from pyrogram import Client, filters # ...... # ...... c = Client("bot"...) hd =…
Kon
  • 33
  • 1
  • 5
0
votes
0 answers

Pyrogram bot freezes after using too much "asyncio.sleep"

In my bot made with pyrogram, I wrote a code that asks the user to answer the messages after 60 seconds with asyncio sleep, but if too many people trigger this code, my bot does not receive any command until any of these waiting processes are over,…
Dark
  • 25
  • 4
0
votes
0 answers

How to get the code in the pyrogram library outside the console environment

c = Client(f"sessions/{added[2]}", api_id=added[0], api_hash=added[1]) await c.connect() result = SendCode(phone_number=added[2]) if result: phoneCode = await query.message.chat.ask(text="Enter code") await c.sign_in(added[2],result.phone_code_hash,…
amir
  • 1
  • 1
0
votes
2 answers

Problem starting Telegram bot with pyrogram

Hi i am receiving an error starting a bot with nothing on it yet I am using Pyrogram (2.0.97) and Python (3.9.6) I didn't developed more code for this bot yet, but i want to use this library (pyrogram) and not other library, because of this…
Roberto Junior
  • 115
  • 1
  • 1
  • 9
0
votes
1 answer

Pyrogram, How to send /start with params

I have url https://t.me/Bot_name?start=mc_dSs8EMrECY1Jvwk How can I follow this link using Program. Or how to send a telegram message to the bot /start with param mc_dSs8EMrECY1Jvwk I tried using client.join_chat(url) the telegram server gives an…
0
votes
0 answers

How to send one or several documents in telegram, through a bot or user using url by pyrogram

I am trying to send one or more documents on telegram which are available in url via pyrogram. Looking in the documentation, I discovered that there is a reply_media_group method, but when I use it, I always get the error…
tavo
  • 54
  • 4
0
votes
1 answer

Why can't I run this python telegram bot&

When I running the Telegram bot, issues this error: TgCrypto is missing! Pyrogram will work the same, but at a much slower speed. More info: https://docs.pyrogram.org/topics/speedups Traceback (most recent call last): File…
0
votes
1 answer

Waiting for 20 seconds before continuing (permanent error)

the get_chat_history and egt_chat_members methods throw a permanent waiting error -Waiting for 20 (23,21,22,18) seconds before continuing. get_chat works fine. This error appeared a couple of days ago. async with tg_cl: while True: …
listcool
  • 5
  • 1
0
votes
1 answer

how to get answers of a ReplyKeyboardMarkup in pyrogram?

I want when someone choose an ReplyKeyboardMarkup keys Program do a job for example: @Client.on_message(filters.command('start')) async def start(client: Client, message: Message): await message.reply_text('Click an option', …
Sepehr
  • 3
  • 4
0
votes
0 answers

Get Account Telegram bot telethon

Can I get information about a user in telegrams by phone number? That is, the logic is as follows: Send the phone number to the bot for processing, it will check if there is an account, if yes, it will display the message "yes", if not, then no. I…
krausser
  • 11
  • 2
0
votes
0 answers

Send Discussion Message Pyrogram

How to send message to chat discussion group? I want to know, how to send message to chat discussion group I think its: app.send_message(channelDiscussId, text, {reply_to_message_id: msgId}) but how to get 'channelDiscussId' ?
dyrb
  • 3
  • 1
0
votes
1 answer

Pyrogram raw method DeleteChatUser not working

This code: usr = await app.resolve_peer(uid) udata = InputUser(user_id=usr.user_id, access_hash=usr.access_hash) r = await app.invoke(functions.messages.DeleteChatUser(chat_id=chan, user_id=udata)) print(r) Returns: AttributeError:…
0
votes
1 answer

Username check Pyrogram IF username =

How can I implement a check for a user? That is, if the message was sent from this user, then: let's send the reaction "❤️" on his message [pyrogram] I tried to: @app.on_message(filters.user.id="...") def reaction(client,message): …
dyrb
  • 3
  • 1