我正在使用python-telegram-bot图书馆。我想跟踪用户的实时位置,但我不知道该怎么做。我尝试使用作业队列:
def notification(bot, job):
updates = bot.get_updates()
print([u.message.location for u in updates])
# Add job to queue
job = job_queue.run_repeating(notification, 10, 1, context=chat_id)
chat_data['job'] = job
Run Code Online (Sandbox Code Playgroud)
但更新无效。我想每 1 分钟跟踪一次位置。