mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
change banphrase api
This commit is contained in:
parent
61fc2fb652
commit
a842cc012e
|
@ -42,7 +42,7 @@ func CheckMessage(text string) (bool, string) {
|
||||||
|
|
||||||
log.Info(reqBody)
|
log.Info(reqBody)
|
||||||
|
|
||||||
resp, err := http.Post("https://forsen.tv/api/v1/banphrases/test", "application/json", bytes.NewBuffer(reqBody))
|
resp, err := http.Post("https://pajlada.pajbot.com/api/v1/banphrases/test", "application/json", bytes.NewBuffer(reqBody))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Error(err)
|
log.Error(err)
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,14 @@ func (b *Bot) Send(target, text string) {
|
||||||
// if text[0] == '.' || text[0] == '/' {
|
// if text[0] == '.' || text[0] == '/' {
|
||||||
// text = ". " + text
|
// text = ". " + text
|
||||||
// }
|
// }
|
||||||
|
banned, reason := CheckMessage(text)
|
||||||
|
if banned {
|
||||||
|
b.TwitchClient.Say(target, reason)
|
||||||
|
return
|
||||||
|
} else {
|
||||||
|
b.TwitchClient.Say(target, text)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
|
||||||
if len(text) > 500 {
|
if len(text) > 500 {
|
||||||
firstMessage := text[0:499]
|
firstMessage := text[0:499]
|
||||||
|
@ -32,11 +40,4 @@ func (b *Bot) Send(target, text string) {
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
banned, reason := CheckMessage(text)
|
|
||||||
if banned {
|
|
||||||
b.TwitchClient.Say(target, reason)
|
|
||||||
} else {
|
|
||||||
b.TwitchClient.Say(target, text)
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue