main.py 文件源码

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

项目:fanbot 作者: rpalo 项目源码 文件源码
def main(greeting=True):

    bot = Fanbot.create_from_modules(secrets, compliments)

    if greeting:
        bot.hello_world()
    try:
        # Initially hardcoding a schedule.  Could be swapped out later
        # PLACE YOUR CUSTOM SCHEDULES HERE.  SEE SCHEDULE MODULE DOCUMENTATION.
        schedule.every(30).minutes.do(bot.respond_to_tweets)
        schedule.every().day.at("10:30").do(bot.post_compliment)
        while True:
            schedule.run_pending()
            # You can tune the sleep length too.  Should be roughly the same
            # as the most frequently scheduled job above
            time.sleep(30*60) # seconds

    except KeyboardInterrupt:
        if greeting:
            bot.goodbye()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号