def addFactoid(self, irc, msg, tokens):
        # First, check and see if the entire message matches a factoid key
        channel = plugins.getChannel(msg.args[0])
        id = self._getUserId(irc, msg.prefix)
        try:
            (key, fact) = self._getKeyAndFactoid(tokens)
        except __HOLE__ as e:
            irc.error(str(e), Raise=True)
        # Check and make sure it's not in the DB already
        if self.db.getFactoid(channel, key):
            irc.error(format(_('Factoid %q already exists.'), key), Raise=True)
        self.db.addFactoid(channel, key, fact, id)
        irc.replySuccess()
dataset/ETHPy150Open ProgVal/Limnoria/plugins/MoobotFactoids/plugin.py/MoobotFactoids.addFactoid