bot.py 文件源码

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

项目:TweenRoBot 作者: ThisIsAmir 项目源码 文件源码
def ip(m):
    banlist = redis.sismember('banlist', '{}'.format(m.from_user.id))
    if str(banlist) == 'False':
        text = m.text.split()[1]
        r = requests.get('http://ip-api.com/json/{}?fields=262143'.format(text))
        json_data = r.json()
        country = json_data['country']
        city = json_data['city']
        isp = json_data['isp']
        timezone = json_data['timezone']
        lon = json_data['lon']
        lat = json_data['lat']
        bot.send_location(m.chat.id, lat, lon)
        bot.send_message(m.chat.id, "*Country* : ```{}``` \n *City* : ```{}``` \n *Isp* : ```{}``` \n *Timezone* : ```{}```".format(country,city,isp,timezone), parse_mode="Markdown")

#################################################################################################################################################################################################
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号