Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var FlagMap = map[string]Flag{ "channel-mode": FlagChannelMode, }
Functions ¶
This section is empty.
Types ¶
type Channel ¶
type Channel struct { ID string `bson:"id"` Login string `bson:"login"` Mode ChannelMode `bson:"mode"` EventSub *ChannelEventSub `bson:"eventsub"` LastMsg string QueueChannel chan *QueuedMessage Cooldowns map[string]time.Time }
func (*Channel) ChangeMode ¶
func (channel *Channel) ChangeMode(mongo *db.Connection, newMode ChannelMode) error
func (*Channel) VerboseName ¶
type ChannelEventSub ¶
type ChannelEventSub struct { Enabled bool `bson:"enabled"` Subscriptions []*ChannelEventSubSubscription `bson:"subscriptions"` }
ChannelEventSub represents Channel's EventSub settings along with all Subscriptions active in the Channel
type ChannelEventSubSubscription ¶
type ChannelEventSubSubscription struct { Type string `bson:"type"` Version string `bson:"version"` }
ChannelEventSubSubscription represents an EventSub subscription type as stored in database
type ChannelMode ¶
type ChannelMode int
ChannelMode indicates the bot's state in a Channel
const ( ChannelModeNormal ChannelMode = iota ChannelModeInactive ChannelModeVIP ChannelModeModerator ChannelModeBoundary )
func ParseChannelMode ¶
func ParseChannelMode(num int) (err error, mode ChannelMode)
func (ChannelMode) MessageRatelimit ¶
func (mode ChannelMode) MessageRatelimit() time.Duration
MessageRatelimit returns underlying value of messageRatelimit that corresponds to mode
func (ChannelMode) String ¶
func (mode ChannelMode) String() string
String human-readable name of the mode. Meant to be used only in logs and output visible to end-user
type Command ¶
type Command struct { Name string Description string Usage string Permission Permission Cooldown time.Duration Run func(msg twitch.PrivateMessage, args []string) (err CommandError) }
type CommandError ¶
type CommandError int
CommandError is a type for
const ( // CommandErrorNoError command returned successfully CommandErrorNoError CommandError = iota // CommandErrorInvalidArguments user used invalid syntax // Could be caused by providing invalid arguments or too little of them CommandErrorInvalidArguments // CommandErrorInternal something completely unexpected happened, e.g. parsing new http.Req CommandErrorInternal // CommandErrorHTTPRequest executing an HTTP request failed, or any other HTTP request-related action CommandErrorHTTPRequest // CommandErrorReply something related to user's input failed // Response should be sent to the user in the Command.Run right before the return CommandErrorReply // CommandErrorMongo emits when a MongoDB operation failed / couldn't be performed CommandErrorMongo )
func (CommandError) String ¶
func (err CommandError) String() (str string)
type Flag ¶
type Flag int
Flag flags that can be set with the set command and update corresponding properties in the database
type Permission ¶
type Permission int32
const ( PermissionNone Permission = 0 PermissionAdmin Permission = 1 << (iota - 1) PermissionSkipCooldown )
type QueuedMessage ¶
type QueuedMessage struct {
Message string
}
type User ¶
type User struct { ID string `bson:"id"` Permission Permission `bson:"permission"` }
Click to show internal directories.
Click to hide internal directories.