forked from an/flokati
markov: dont learn own messages
This commit is contained in:
parent
520f62eaa2
commit
ede74c275f
1
main.go
1
main.go
|
@ -36,6 +36,7 @@ func main() {
|
||||||
xlog.Info("%s started", SoftwareInfo())
|
xlog.Info("%s started", SoftwareInfo())
|
||||||
modules.Init(say, *mods)
|
modules.Init(say, *mods)
|
||||||
modules.BotNick = strings.ToLower(*nick)
|
modules.BotNick = strings.ToLower(*nick)
|
||||||
|
modules.BotName = strings.ToLower(*name)
|
||||||
switch *protocol {
|
switch *protocol {
|
||||||
case "irc":
|
case "irc":
|
||||||
Irc(say)
|
Irc(say)
|
||||||
|
|
|
@ -55,7 +55,10 @@ func markovHandleMessage(m *Message) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fmt.Println(m.From, BotName)
|
||||||
|
if m.From != BotName {
|
||||||
markovChain.Write(text)
|
markovChain.Write(text)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func markovRun() {
|
func markovRun() {
|
||||||
|
|
|
@ -16,6 +16,7 @@ var (
|
||||||
MsgFuncs = make(map[string]func(*Message))
|
MsgFuncs = make(map[string]func(*Message))
|
||||||
RunFuncs = make(map[string]func())
|
RunFuncs = make(map[string]func())
|
||||||
BotNick string
|
BotNick string
|
||||||
|
BotName string
|
||||||
)
|
)
|
||||||
|
|
||||||
type Message struct {
|
type Message struct {
|
||||||
|
|
Loading…
Reference in New Issue