from gozerbot.callbacks import callbacks
from gozerbot.generic import cchar
from gozerbot.users import users

def privmsgcb(bot, ievent):
    if not users.getname(ievent.userhost):
        return
    if not ievent.channel:
        return
    if ievent.origtxt.startswith('\001CC'):
        bot.sendraw('NOTICE %s :\001CC %s %s\001' % (ievent.nick, ievent.channel, cchar(bot, ievent)))

callbacks.add('PRIVMSG', privmsgcb)

