2021-05-14 11:15:38 +00:00
|
|
|
package twitch
|
2021-05-02 12:29:43 +00:00
|
|
|
|
|
|
|
import (
|
|
|
|
irc "github.com/gempir/go-twitch-irc/v2"
|
|
|
|
)
|
|
|
|
|
|
|
|
type AccessLevelType string
|
|
|
|
|
|
|
|
const (
|
|
|
|
ALTEveryone AccessLevelType = "everyone"
|
|
|
|
ALTVIP AccessLevelType = "vip"
|
|
|
|
ALTModerators AccessLevelType = "moderators"
|
|
|
|
ALTStreamer AccessLevelType = "streamer"
|
|
|
|
)
|
|
|
|
|
2021-05-14 11:15:38 +00:00
|
|
|
type BotCommandHandler func(bot *Bot, message irc.PrivateMessage)
|
2021-05-02 12:29:43 +00:00
|
|
|
|
|
|
|
type BotCommand struct {
|
|
|
|
Description string
|
|
|
|
Usage string
|
|
|
|
AccessLevel AccessLevelType
|
|
|
|
Handler BotCommandHandler
|
2021-09-16 13:55:43 +00:00
|
|
|
Enabled bool
|
2021-05-02 12:29:43 +00:00
|
|
|
}
|
|
|
|
|
2021-09-16 13:55:43 +00:00
|
|
|
type BotCustomCommand struct {
|
|
|
|
Description string
|
|
|
|
AccessLevel AccessLevelType
|
|
|
|
Response string
|
|
|
|
Enabled bool
|
2021-05-12 17:19:09 +00:00
|
|
|
}
|
|
|
|
|
2021-09-16 13:55:43 +00:00
|
|
|
var commands = map[string]BotCommand{}
|
|
|
|
var customCommands = map[string]BotCustomCommand{}
|
2021-05-12 17:19:09 +00:00
|
|
|
|
2021-09-16 13:55:43 +00:00
|
|
|
func cmdCustom(bot *Bot, cmd BotCustomCommand, message irc.PrivateMessage) {
|
|
|
|
// Add future logic (like counters etc) here, for now it's just fixed messages
|
|
|
|
bot.Client.Say(message.Channel, cmd.Response)
|
2021-05-02 12:29:43 +00:00
|
|
|
}
|