gpt4 book ai didi

python - 如何使用 Telethon 将照片发送给 Telegram 用户

转载 作者:行者123 更新时间:2023-12-04 03:55:50 26 4
gpt4 key购买 nike

目前我正在使用这种向用户发送文本的方法,但是如何使用 Telethon 模块向用户发送照片

client.send_message(receiver, message.format(user['name'])

最佳答案

正如@vlz 在评论中所说, client.send_file listed in the documentation是正确的使用方法:

# note: local paths work just as well
# note: await is needed if used inside async def
await client.send_file(receiver, '/path/to/photo.jpg')

关于python - 如何使用 Telethon 将照片发送给 Telegram 用户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/63934639/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com