【问题标题】:Automatically fullscreen display photo after recieving by user in telegram bot mobile用户在电报机器人手机中接收后自动全屏显示照片
【发布时间】:2021-11-30 09:32:56
【问题描述】:

我正在用 python3 编写一个电报机器人。它基于 python-telegram-bot 库。作为游戏概念的一部分,我需要在移动应用中向用户发送一张照片,让用户看不到照片的内容。此时,上传的图片会在 Telegram 应用对话框中打开。而要以全屏模式打开照片,您需要将手指戳在手机屏幕上。我想自动化以原始尺寸显示照片的逻辑。有没有办法在用户收到照片后自动全屏打开照片? 下面是函数的代码sn-p

def send_card(update, context):
    query = update.callback_query
    query_data = update.callback_query.data
    if query_data == "city":
        cards_list = glob('cards/cities/*.png');
    else:
        cards_list = glob('cards/animals/*.png');
    chat_id = update.effective_chat.id
    cardname = choice(cards_list)
    context.bot.send_photo(chat_id=chat_id, photo=open(cardname, "rb"))

【问题讨论】:

    标签: python-3.x mobile automation fullscreen python-telegram-bot


    【解决方案1】:

    没有。这样的事情将取决于客户。

    【讨论】:

      猜你喜欢
      • 2016-06-29
      • 1970-01-01
      • 2016-10-17
      • 2017-08-05
      • 2021-04-20
      • 2021-02-10
      • 2016-08-15
      • 1970-01-01
      • 2018-03-07
      相关资源
      最近更新 更多