hooks.py 文件源码

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

项目:Python-IRC-Bot 作者: wolfy1339 项目源码 文件源码
def self_correct(bot, event, irc, args):
    match = re.match(r"^s[/](.*)[/](.*)[/]?$", " ".join(args))
    if match is not None:
        nick = event.source.nick
        channel = event.target
        for i in bot.userdb[channel][nick]['seen']:
            msg = i['message']
            output = msg.replace(match.group(1), match.group(2))
            if msg == output:
                pass
            else:
                break
        irc.reply(event, '<{0}> {1}'.format(nick, output))
        log.info('Changing %s to %s', msg, output)
    else:
        pass
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号