mirror of
https://github.com/lyx0/nourybot.git
synced 2024-11-13 19:49:55 +01:00
monitor forsen bans
This commit is contained in:
parent
7da57dd655
commit
6f28849331
|
@ -16,6 +16,10 @@ import (
|
|||
func (app *application) handleCommand(message twitch.PrivateMessage) {
|
||||
var reply string
|
||||
|
||||
if message.Channel == "forsen" {
|
||||
return
|
||||
}
|
||||
|
||||
// Increments the counter how many commands have been used, called in the ping command.
|
||||
go common.CommandUsed()
|
||||
|
||||
|
|
|
@ -4,6 +4,7 @@ import (
|
|||
"context"
|
||||
"database/sql"
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"time"
|
||||
|
||||
|
@ -134,12 +135,12 @@ func main() {
|
|||
|
||||
// Received a PrivateMessage (normal chat message).
|
||||
app.TwitchClient.OnPrivateMessage(func(message twitch.PrivateMessage) {
|
||||
sugar.Infow("New Twitch PrivateMessage",
|
||||
"message.Channel", message.Channel,
|
||||
"message.User.DisplayName", message.User.DisplayName,
|
||||
"message.User.ID", message.User.ID,
|
||||
"message.Message", message.Message,
|
||||
)
|
||||
// sugar.Infow("New Twitch PrivateMessage",
|
||||
// "message.Channel", message.Channel,
|
||||
// "message.User.DisplayName", message.User.DisplayName,
|
||||
// "message.User.ID", message.User.ID,
|
||||
// "message.Message", message.Message,
|
||||
// )
|
||||
|
||||
// roomId is the Twitch UserID of the channel the message originated from.
|
||||
// If there is no roomId something went really wrong.
|
||||
|
@ -165,6 +166,16 @@ func main() {
|
|||
}
|
||||
})
|
||||
|
||||
app.TwitchClient.OnClearChatMessage(func(message twitch.ClearChatMessage) {
|
||||
if message.BanDuration == 0 && message.Channel == "forsen" {
|
||||
app.TwitchClient.Say("nouryxd", fmt.Sprintf("MODS https://logs.ivr.fi/?channel=forsen&username=%v", message.TargetUsername))
|
||||
}
|
||||
|
||||
if message.BanDuration >= 28700 && message.Channel == "forsen" {
|
||||
app.TwitchClient.Say("nouryxd", fmt.Sprintf("MODS https://logs.ivr.fi/?channel=forsen&username=%v", message.TargetUsername))
|
||||
}
|
||||
|
||||
})
|
||||
app.TwitchClient.OnConnect(func() {
|
||||
common.StartTime()
|
||||
|
||||
|
|
|
@ -91,6 +91,10 @@ func (app *application) SendNoContext(target, message string) {
|
|||
return
|
||||
}
|
||||
|
||||
if target == "forsen" {
|
||||
return
|
||||
}
|
||||
|
||||
identifier := uuid.NewString()
|
||||
go app.Models.SentMessagesLogs.Insert(target, message, "unavailable", "unavailable", "unavailable", "unavailable", identifier, "unavailable")
|
||||
|
||||
|
@ -145,6 +149,10 @@ func (app *application) Send(target, message string, msgContext twitch.PrivateMe
|
|||
return
|
||||
}
|
||||
|
||||
if target == "forsen" {
|
||||
return
|
||||
}
|
||||
|
||||
commandName := strings.ToLower(strings.SplitN(msgContext.Message, " ", 3)[0][2:])
|
||||
identifier := uuid.NewString()
|
||||
go app.Models.SentMessagesLogs.Insert(target, message, commandName, msgContext.User.Name, msgContext.User.ID, msgContext.Message, identifier, msgContext.Raw)
|
||||
|
@ -200,6 +208,10 @@ func (app *application) SendNoBanphrase(target, message string) {
|
|||
return
|
||||
}
|
||||
|
||||
if target == "forsen" {
|
||||
return
|
||||
}
|
||||
|
||||
identifier := uuid.NewString()
|
||||
go app.Models.SentMessagesLogs.Insert(target, message, "unavailable", "unavailable", "unavailable", "unavailable", identifier, "unavailable")
|
||||
|
||||
|
|
Loading…
Reference in a new issue