Skip to content

force_document not work for webp file (send as sticker) #180

Description

@krau

Checklist

  • I am sure the error is coming from Pyrogram's code and not elsewhere
  • I have searched in the issue tracker for similar bug reports, including closed ones
  • I ran pip3 install -U https://github.com/pyrogram/pyrogram/archive/master.zip and reproduced the issue using the latest development version

Description

When sending webp file it will be send as sticker although set force_document=True

Image

Steps to reproduce

  1. Prepare a webp file
  2. Use send_document and set force_document=True

Code example

import pyrogram

@pyrogram.Client.on_message(pyrogram.filters.sticker)
async def handle_sticker(client: pyrogram.Client, message: pyrogram.types.Message):
    sticker = message.sticker
    await message.reply_chat_action(pyrogram.enums.ChatAction.UPLOAD_DOCUMENT)
    file = await client.download_media(sticker, in_memory=True)
    if not file:
        return
    await message.reply_document(
        document=file,
        force_document=True,
        file_name="sticker_file.webp",
    )

Logs

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions