Update repository

This commit is contained in:
Eva Dengler 2022-12-21 13:04:36 +01:00
commit df2a986286
7 changed files with 35 additions and 24 deletions

View file

@ -5,10 +5,11 @@ import (
"fmt"
"regexp"
"database/sql"
"math/rand"
_ "github.com/mattn/go-sqlite3"
)
var begin_char = []byte{'-', '<'}
var begin_char = []byte{'-'}
var db *sql.DB
var err error
@ -278,6 +279,18 @@ func parsemsg(msg *irc_msg, foo bot) bool {
return false
}
if c.cmd == "help" {
(*msg).retmsg = "There is no help in this hell..."
return false
}
if c.cmd == "slap" {
who := []string{(*msg).author, "\x01ACTION"}
whom := []string{(*msg).author, foo.Conf.Name}
LOG_WARN.Printf("suffix: " + c.suffix)
if c.suffix != "" {
who = append(who, strings.Split(c.suffix, " ")...)
whom = append(whom, strings.Split(c.suffix, " ")...)
}
(*msg).retmsg = who[rand.Intn(len(who))] + " slaps " + whom[rand.Intn(len(whom))] + " around with a large trout."
return false
}
// hard code 'groups' to add new groups to the groups-table