Main.py 文件源码

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

项目:grovebot 作者: mrsofia 项目源码 文件源码
def on_chat_message(msg):
    pprint(msg)
    content_type, chat_type, chat_id = telepot.glance(msg)
    # Ignore any messages received over 30s ago
    cur_time = time.time()
    if cur_time - msg.get("date") < 30:
        if content_type == 'text':
            text = msg.get("text")
            for url in URLS:
                if url in text:
                    # This means the message contains a link to some music, let's save it
                    get_fuego(msg)
                    save_link(msg)
                    break
    else:
        print("IGNORING OLD MESSAGE...")
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号