mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
comment out spammy commands
This commit is contained in:
parent
bc931a185a
commit
fca2f93e20
|
@ -3,7 +3,6 @@ package bot
|
||||||
import (
|
import (
|
||||||
"bytes"
|
"bytes"
|
||||||
"encoding/json"
|
"encoding/json"
|
||||||
"fmt"
|
|
||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"net/http"
|
"net/http"
|
||||||
|
|
||||||
|
@ -64,7 +63,7 @@ func CheckMessage(text string) (bool, string) {
|
||||||
json.Unmarshal(body, &responseObject)
|
json.Unmarshal(body, &responseObject)
|
||||||
|
|
||||||
// {"phrase": "No gyazo allowed"}
|
// {"phrase": "No gyazo allowed"}
|
||||||
reason := responseObject.BanphraseData.Name
|
// reason := responseObject.BanphraseData.Name
|
||||||
|
|
||||||
// log.Info("Bancheck: ", responseObject.Banned)
|
// log.Info("Bancheck: ", responseObject.Banned)
|
||||||
// log.Info("Reason: ", reason)
|
// log.Info("Reason: ", reason)
|
||||||
|
@ -72,7 +71,7 @@ func CheckMessage(text string) (bool, string) {
|
||||||
|
|
||||||
// Bad message
|
// Bad message
|
||||||
if responseObject.Banned {
|
if responseObject.Banned {
|
||||||
return true, fmt.Sprintf("Banphrased, reason: %s", reason)
|
return true, "[Banphrased]"
|
||||||
} else if !responseObject.Banned {
|
} else if !responseObject.Banned {
|
||||||
// Good message
|
// Good message
|
||||||
return false, "okay"
|
return false, "okay"
|
||||||
|
|
|
@ -38,7 +38,7 @@ func main() {
|
||||||
handlers.PrivateMessage(message, nb)
|
handlers.PrivateMessage(message, nb)
|
||||||
})
|
})
|
||||||
|
|
||||||
nb.TwitchClient.Join("nouryqt", "nourybot")
|
nb.TwitchClient.Join("nouryqt", "nourybot", "pajlada")
|
||||||
nb.Send("nourybot", "HeyGuys")
|
nb.Send("nourybot", "HeyGuys")
|
||||||
nb.TwitchClient.Connect()
|
nb.TwitchClient.Connect()
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
package commands
|
package commands
|
||||||
|
|
||||||
import (
|
// import (
|
||||||
"fmt"
|
// "fmt"
|
||||||
|
|
||||||
"github.com/lyx0/nourybot/cmd/bot"
|
// "github.com/lyx0/nourybot/cmd/bot"
|
||||||
"github.com/lyx0/nourybot/pkg/api/aiden"
|
// "github.com/lyx0/nourybot/pkg/api/aiden"
|
||||||
log "github.com/sirupsen/logrus"
|
// log "github.com/sirupsen/logrus"
|
||||||
)
|
// )
|
||||||
|
|
||||||
func BttvEmotes(channel string, nb *bot.Bot) {
|
// func BttvEmotes(channel string, nb *bot.Bot) {
|
||||||
resp, err := aiden.ApiCall(fmt.Sprintf("api/v1/emotes/%s/bttv", channel))
|
// resp, err := aiden.ApiCall(fmt.Sprintf("api/v1/emotes/%s/bttv", channel))
|
||||||
|
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
log.Error(err)
|
// log.Error(err)
|
||||||
nb.Send(channel, "Something went wrong FeelsBadMan")
|
// nb.Send(channel, "Something went wrong FeelsBadMan")
|
||||||
}
|
// }
|
||||||
|
|
||||||
nb.Send(channel, string(resp))
|
// nb.Send(channel, string(resp))
|
||||||
}
|
// }
|
||||||
|
|
|
@ -1,20 +1,20 @@
|
||||||
package commands
|
package commands
|
||||||
|
|
||||||
import (
|
// import (
|
||||||
"fmt"
|
// "fmt"
|
||||||
|
|
||||||
"github.com/lyx0/nourybot/cmd/bot"
|
// "github.com/lyx0/nourybot/cmd/bot"
|
||||||
"github.com/lyx0/nourybot/pkg/api/aiden"
|
// "github.com/lyx0/nourybot/pkg/api/aiden"
|
||||||
log "github.com/sirupsen/logrus"
|
// log "github.com/sirupsen/logrus"
|
||||||
)
|
// )
|
||||||
|
|
||||||
func FfzEmotes(channel string, nb *bot.Bot) {
|
// func FfzEmotes(channel string, nb *bot.Bot) {
|
||||||
resp, err := aiden.ApiCall(fmt.Sprintf("api/v1/emotes/%s/ffz", channel))
|
// resp, err := aiden.ApiCall(fmt.Sprintf("api/v1/emotes/%s/ffz", channel))
|
||||||
|
|
||||||
if err != nil {
|
// if err != nil {
|
||||||
log.Error(err)
|
// log.Error(err)
|
||||||
nb.Send(channel, "Something went wrong FeelsBadMan")
|
// nb.Send(channel, "Something went wrong FeelsBadMan")
|
||||||
}
|
// }
|
||||||
|
|
||||||
nb.Send(channel, string(resp))
|
// nb.Send(channel, string(resp))
|
||||||
}
|
// }
|
||||||
|
|
|
@ -3,7 +3,7 @@ package commands
|
||||||
import "github.com/lyx0/nourybot/cmd/bot"
|
import "github.com/lyx0/nourybot/cmd/bot"
|
||||||
|
|
||||||
func Help(target string, nb *bot.Bot) {
|
func Help(target string, nb *bot.Bot) {
|
||||||
reply := "Bot made in Go by @Nouryt, Prefix: (), Commands: https://gist.github.com/lyx0/6e326451ed9602157fcf6b5e40fb1dfd"
|
reply := "Bot made in Go by @Nouryqt, Prefix: (), Commands: https://gist.github.com/lyx0/6e326451ed9602157fcf6b5e40fb1dfd"
|
||||||
|
|
||||||
nb.Send(target, reply)
|
nb.Send(target, reply)
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,7 +10,7 @@ import (
|
||||||
// commands to the command handler.
|
// commands to the command handler.
|
||||||
func PrivateMessage(message twitch.PrivateMessage, nb *bot.Bot) {
|
func PrivateMessage(message twitch.PrivateMessage, nb *bot.Bot) {
|
||||||
// log.Info("fn PrivateMessage")
|
// log.Info("fn PrivateMessage")
|
||||||
log.Info(message.Raw)
|
// log.Info(message.Raw)
|
||||||
|
|
||||||
// roomId is the Twitch UserID of the channel the message
|
// roomId is the Twitch UserID of the channel the message
|
||||||
// was sent in.
|
// was sent in.
|
||||||
|
@ -42,6 +42,6 @@ func PrivateMessage(message twitch.PrivateMessage, nb *bot.Bot) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Message was no command
|
// Message was no command
|
||||||
// log.Info(message)
|
log.Infof("[#%s]:%s: %s", message.Channel, message.User.DisplayName, message.Message)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue