【发布时间】: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