pogobot.py 文件源码

python
阅读 24 收藏 0 点赞 0 评论 0

项目:PogomBOT 作者: eugenio412 项目源码 文件源码
def cmd_location(bot, update):
    chat_id = update.message.chat_id
    pref = prefs.get(chat_id)

    if chat_id not in jobs:
        bot.sendMessage(chat_id, text='You have no active scanner.')
        return

    user_location = update.message.location

    # We set the location from the users sent location.
    pref.set('location', [user_location.latitude, user_location.longitude, location_radius])

    logger.info('[%s] Setting scan location to Lat %s, Lon %s, R %s' % (chat_id,
        pref['location'][0], pref['location'][1], pref['location'][2]))

    # Send confirmation nessage
    bot.sendMessage(chat_id, text="Setting scan location to: %f / %f with radius %.2f m" %
        (pref['location'][0], pref['location'][1], 1000*pref['location'][2]))
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号