telebot.py 文件源码

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

项目:PGO-mapscan-opt 作者: seikur0 项目源码 文件源码
def do_settings():
    global radius_by_default,radius_step,radius_max,messages, POKEMONS, POKEMON_NUM,about,bot,log_queue,log_to_file,ignored_default,log_notifications,max_notis_per_user_and_cycle,time_between_cycles
    with open('{}/res/telebotsettings.json'.format(workdir)) as f:
        telecfg = json.load(f)

    language = telecfg["language"]
    radius_by_default = int(telecfg["radius_by_default"])
    radius_step = telecfg["radius_step"]
    radius_max = telecfg["radius_max"]
    max_notis_per_user_and_cycle = telecfg["max_notis_per_user_and_cycle"]
    time_between_cycles = telecfg["time_between_cycles"]
    log_notifications = telecfg["log_notifications"]

    log_to_file = telecfg["log_to_file"]

    bot = telepot.Bot(str(telecfg["TELEGRAM_BOT_TOKEN"]))
    about = telecfg["info_about"]

    ignored_default = telecfg["ignored_by_default"]
    if type(ignored_default) == unicode:
        print(time.strftime('[%H:%M:%S] ' + '[!] Warning, the ignored_by_default setting in telebotsettings.json should be now a array like [1,2,3] instead of a string like "1,2,3"'))
        sys.exit()

    with open('{}/res/languages/{}.json'.format(workdir, language)) as f:
        messages = json.load(f)

    with open('{}/webres/static/{}.json'.format(workdir, language)) as f:
        POKEMONS = json.load(f)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号