diff --git a/boddle.db b/boddle.db index a59b164..9c6a999 100644 Binary files a/boddle.db and b/boddle.db differ diff --git a/boddle.go b/boddle.go index cbf4873..a9b4603 100644 --- a/boddle.go +++ b/boddle.go @@ -214,6 +214,8 @@ func parsemsg(msg irc_msg, foo bot) bool { if (len(c.suffix) <= 0) { return false; } + c.suffix = strings.Replace(c.suffix,"\"","'", -1) + fmt.Printf(c.suffix) // insert into database statement, err := db.Prepare("insert into line (content, author) values (?,?)") checkErr(err) @@ -222,7 +224,8 @@ func parsemsg(msg irc_msg, foo bot) bool { defer statement.Close() // get ID of content... - task := fmt.Sprintf("select l.id from line l where l.content = \"%s\"", strings.Replace(c.suffix, "'", "''", -1)) + task := fmt.Sprintf("select l.id from line l where l.content = \"%s\"", c.suffix) // strings.Replace(c.suffix, "'", "''", -1)) + fmt.Printf(task) row, err := db.Query(task) checkErr(err) line_id := 0 @@ -231,6 +234,7 @@ func parsemsg(msg irc_msg, foo bot) bool { LOG_INFO.Printf(c.cmd) if line_id == 0 { LOG_WARN.Printf("no entry for adding") + sendmsg(foo.conn, msg.channel, "internal server error.") return false } @@ -252,6 +256,8 @@ func parsemsg(msg irc_msg, foo bot) bool { LOG_INFO.Printf("inserted foo! \n") defer stat.Close() } + sendmsg(foo.conn, msg.channel, fmt.Sprintf("success adding new super funny enjoyable line with ID %d!", line_id)) + sendmsg(foo.conn, "horscchtey", fmt.Sprintf("new line: > %s < (ID %d)", c.suffix, line_id)) return true }