是否有可能通过Telethon向组发送交互式地图?



我在Ubuntu 18.04上使用telethon 1.23.0,我想发送一个交互式谷歌地图到一个组(作为一个机器人)。我有可用的经纬度。

我在文档中搜索像"地图"这样的术语。或";location"我还尝试了SendLocation或send_location方法,但没有成功。

唯一的提示我发现在哪里方法发送客户端的地理位置到机器人(通过按钮按下),但这不是我要找的。

是否有任何包装方法?

感谢安迪

多亏了Marcel的提示,我终于找到了一个可行的解决方案:

from telethon.tl import types, functions
geoPoint = types.InputGeoPoint(gps_x, gps_y)
async with bot.action(channel, 'location') as action:
await bot.send_file(channel, types.InputMediaGeoPoint(geoPoint))

我不知道,如果这是最好的解决方案,但它适用于我:-)

最新更新