mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
restrict echo
This commit is contained in:
parent
3a8cf5c97c
commit
eb674712e0
|
@ -62,14 +62,10 @@ func CheckMessage(text string) (bool, string) {
|
||||||
var responseObject banphraseResponse
|
var responseObject banphraseResponse
|
||||||
json.Unmarshal(body, &responseObject)
|
json.Unmarshal(body, &responseObject)
|
||||||
|
|
||||||
|
// Bad Message
|
||||||
|
//
|
||||||
// {"phrase": "No gyazo allowed"}
|
// {"phrase": "No gyazo allowed"}
|
||||||
// reason := responseObject.BanphraseData.Name
|
// reason := responseObject.BanphraseData.Name
|
||||||
|
|
||||||
// log.Info("Bancheck: ", responseObject.Banned)
|
|
||||||
// log.Info("Reason: ", reason)
|
|
||||||
// log.Info("Bancheck: ", responseObject.Banned)
|
|
||||||
|
|
||||||
// Bad message
|
|
||||||
if responseObject.Banned {
|
if responseObject.Banned {
|
||||||
return true, "[Banphrased]"
|
return true, "[Banphrased]"
|
||||||
} else if !responseObject.Banned {
|
} else if !responseObject.Banned {
|
||||||
|
|
|
@ -8,7 +8,7 @@ import (
|
||||||
|
|
||||||
// Pingme pings a user.
|
// Pingme pings a user.
|
||||||
func Pingme(channel, user string, nb *bot.Bot) {
|
func Pingme(channel, user string, nb *bot.Bot) {
|
||||||
response := fmt.Sprintf("@%s", user)
|
response := fmt.Sprintf("🔔 @%s 🔔", user)
|
||||||
|
|
||||||
nb.Send(channel, response)
|
nb.Send(channel, response)
|
||||||
}
|
}
|
||||||
|
|
|
@ -128,8 +128,13 @@ func Command(message twitch.PrivateMessage, nb *bot.Bot) {
|
||||||
return
|
return
|
||||||
|
|
||||||
case "echo":
|
case "echo":
|
||||||
commands.Echo(target, message.Message[7:len(message.Message)], nb)
|
if message.User.ID != "31437432" {
|
||||||
return
|
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":
|
case "emote":
|
||||||
commands.EmoteLookup(target, cmdParams[1], nb)
|
commands.EmoteLookup(target, cmdParams[1], nb)
|
||||||
|
@ -152,7 +157,10 @@ func Command(message twitch.PrivateMessage, nb *bot.Bot) {
|
||||||
// return
|
// return
|
||||||
|
|
||||||
case "fill":
|
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]")
|
nb.Send(target, "Usage: ()fill [emote]")
|
||||||
return
|
return
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in a new issue