markov: dont learn own messages
continuous-integration/drone/push Build is passing Details

This commit is contained in:
an 2019-08-24 07:37:39 +02:00
parent 520f62eaa2
commit ede74c275f
3 changed files with 6 additions and 1 deletions

View File

@ -36,6 +36,7 @@ func main() {
xlog.Info("%s started", SoftwareInfo())
modules.Init(say, *mods)
modules.BotNick = strings.ToLower(*nick)
modules.BotName = strings.ToLower(*name)
switch *protocol {
case "irc":
Irc(say)

View File

@ -55,7 +55,10 @@ func markovHandleMessage(m *Message) {
}
}
markovChain.Write(text)
fmt.Println(m.From, BotName)
if m.From != BotName {
markovChain.Write(text)
}
}
func markovRun() {

View File

@ -16,6 +16,7 @@ var (
MsgFuncs = make(map[string]func(*Message))
RunFuncs = make(map[string]func())
BotNick string
BotName string
)
type Message struct {