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

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

        title = msg[1]
        c = self.conn.cursor()
        c.execute("SELECT COUNT(title) FROM notes WHERE title=?", (title,))
        result = c.fetchone()

        if not result[0]:
            cardinal.sendMsg(channel, "No note found under '%s'." % title)
            return

        c.execute("DELETE FROM notes WHERE title = ?", (title,))
        self.conn.commit()

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