mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
add reason to message output
This commit is contained in:
parent
a842cc012e
commit
71a1f854cb
1 changed files with 7 additions and 1 deletions
|
@ -3,6 +3,7 @@ package bot
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
@ -57,9 +58,14 @@ func CheckMessage(text string) (bool, string) {
|
||||||
var responseObject banphraseResponse
|
var responseObject banphraseResponse
|
||||||
json.Unmarshal(body, &responseObject)
|
json.Unmarshal(body, &responseObject)
|
||||||
|
|
||||||
|
reason := responseObject.BanphraseData.Name
|
||||||
|
|
||||||
|
log.Info("Bancheck: ", responseObject.Banned)
|
||||||
|
log.Info("Reason: ", reason)
|
||||||
|
|
||||||
log.Info("Bancheck: ", responseObject.Banned)
|
log.Info("Bancheck: ", responseObject.Banned)
|
||||||
if responseObject.Banned {
|
if responseObject.Banned {
|
||||||
return true, "[banphrased] monkaS"
|
return true, fmt.Sprintf("Banphrased, reason: %s", reason)
|
||||||
} else {
|
} else {
|
||||||
return false, "okay"
|
return false, "okay"
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue