Surrender-Bot 文件源码

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

项目:Surrender-Bot 作者: Radeox 项目源码 文件源码
def handle(msg):
    """
    This function handle all messages incoming from users
    """

    content_type, chat_type, chat_id = telepot.glance(msg)
    command_input = msg['text']

    if command_input == '/start':
        # Check if already registred
        if register_user(chat_id):
            bot.sendMessage(chat_id, start_msg)
            feed = feedparser.parse(feed_url)

            # Send all news from older to newest
            for entry in reversed(feed.entries):
                msg = entry.title + '\n' + entry.link
                bot.sendMessage(chat_id, msg)

    if command_input == '/stop':
        bot.sendMessage(chat_id, stop_msg)
        remove_user(chat_id)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号