簡體   English   中英

如何使用 Telethon 在電報中發送壓縮照片(以便以全尺寸顯示)

[英]How to send a photo with compressing (in order to show in full size) in telegram using telethon

如何發送帶有壓縮的照片。
我有代碼:

client = TelegramClient(
    "session", 
    api_id=CONFIG["client_api_id"], 
    api_hash=CONFIG["client_api_hash"]
)

client.connect()
if not client.is_user_authorized():
    phone = input("Your phone: ")
    code = client.send_code_request(phone)
    myself = client.sign_in(phone, input("Your code: "))

# Sending a photo with description
client.send_message(
    777000, 
    "test",
    file="https://avatars.mds.yandex.net/get-zen_doc/5295210/pub_60dd6ea6828fb32711ebfc76_60dd7130df4f6532136de7b1/scale_1200"
)

當我運行此代碼時,我得到:
圖片

但我想要這個:
圖片

我試圖將force_document=False添加到方法.send_message的參數中,但它沒有用

我很矮。 force_document=False正在工作 xD

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM