mirror-nourybot/pkg/common/privs.go

27 lines
765 B
Go
Raw Normal View History

package common
import "github.com/gempir/go-twitch-irc/v3"
// ElevatedPrivsMessage is checking a given message twitch.PrivateMessage
// if it came from a moderator/vip/or broadcaster and returns a bool
func ElevatedPrivsMessage(message twitch.PrivateMessage) bool {
if message.User.Badges["moderator"] == 1 ||
message.User.Badges["vip"] == 1 ||
message.User.Badges["broadcaster"] == 1 {
return true
} else {
return false
}
}
// ModPrivsMessage is checking a given message twitch.PrivateMessage
// if it came from a moderator or broadcaster and returns a bool
func ModPrivsMessage(message twitch.PrivateMessage) bool {
if message.User.Badges["moderator"] == 1 ||
message.User.Badges["broadcaster"] == 1 {
return true
} else {
return false
}
}