def add_note(self, cardinal, user, channel, msg):
        if not self.conn:
            cardinal.sendMsg("Unable to access notes database.")
            return

        message = msg.split('=', 1)
        title_message = message[0].split(' ', 1)
        if len(message) < 2 or len(title_message) < 2:
            cardinal.sendMsg(channel, "Syntax: .addnote <title>=<content>")
            return

        title = title_message[1].strip()
        content = message[1].strip()
        if len(title) == 0 or len(content) == 0:
            cardinal.sendMsg(channel, "Syntax: .addnote <title>=<content>")
            return

        c = self.conn.cursor()
        c.execute("INSERT OR REPLACE INTO notes (title, content) VALUES(?, ?)",
                  (title, content))
        self.conn.commit()

        cardinal.sendMsg(channel, "Saved note '%s'." % title)
dataset/ETHPy150Open JohnMaguire/Cardinal/plugins/notes/plugin.py/NotesPlugin.add_note/original