restrict echo

This commit is contained in:
lyx0 2021-11-02 19:48:44 +01:00
parent 3a8cf5c97c
commit eb674712e0
3 changed files with 14 additions and 10 deletions

View file

@ -62,14 +62,10 @@ func CheckMessage(text string) (bool, string) {
var responseObject banphraseResponse
json.Unmarshal(body, &responseObject)
// Bad Message
//
// {"phrase": "No gyazo allowed"}
// reason := responseObject.BanphraseData.Name
// log.Info("Bancheck: ", responseObject.Banned)
// log.Info("Reason: ", reason)
// log.Info("Bancheck: ", responseObject.Banned)
// Bad message
if responseObject.Banned {
return true, "[Banphrased]"
} else if !responseObject.Banned {

View file

@ -8,7 +8,7 @@ import (
// Pingme pings a user.
func Pingme(channel, user string, nb *bot.Bot) {
response := fmt.Sprintf("@%s", user)
response := fmt.Sprintf("🔔 @%s 🔔", user)
nb.Send(channel, response)
}

View file

@ -128,8 +128,13 @@ func Command(message twitch.PrivateMessage, nb *bot.Bot) {
return
case "echo":
commands.Echo(target, message.Message[7:len(message.Message)], nb)
return
if message.User.ID != "31437432" {
nb.Send(target, "You're not authorized to do this.")
return
} else {
commands.Echo(target, message.Message[7:len(message.Message)], nb)
return
}
case "emote":
commands.EmoteLookup(target, cmdParams[1], nb)
@ -152,7 +157,10 @@ func Command(message twitch.PrivateMessage, nb *bot.Bot) {
// return
case "fill":
if msgLen == 1 {
if message.User.ID != "31437432" {
nb.Send(target, "You're not authorized to do this.")
return
} else if msgLen == 1 {
nb.Send(target, "Usage: ()fill [emote]")
return
} else {