Documentation ¶
Index ¶
- func Check(a Action) error
- type Action
- type Actions
- type Event
- func (e *Event) HasPermission(perm Permission) bool
- func (e *Event) Init()
- func (e *Event) IsBot() bool
- func (e *Event) IsBroadcaster() bool
- func (e *Event) IsCoolingDown() bool
- func (e *Event) IsInBotChannel() bool
- func (e *Event) IsModerator() bool
- func (e *Event) IsOwner() bool
- func (e *Event) IsRegular() bool
- func (e *Event) IsSubscriber() bool
- func (e *Event) Say(message string)
- func (e *Event) Skip()
- type Options
- type Permission
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Event ¶
type Event struct { Log zerolog.Logger Twitch *twitch.Client State *state.Client Weather *openweather.Client Location *nominatim.Client ImgurClientID string BotName string Debug bool Msg *twitch.PrivateMessage Match []string Sleeping bool Perm Permission Skipped bool }
func (*Event) HasPermission ¶
func (e *Event) HasPermission(perm Permission) bool
HasPermission compares perm with the permission level of the sender and reports wheather the sender has a permission of at least perm.
func (*Event) Init ¶
func (e *Event) Init()
Init sets some internal values like the permission of the sender.
func (*Event) IsBot ¶
IsBot reports wheather the message was sent by a bot. Currently it compares the name of the sender with a list of know bots. TODO: check in other places eg. badges
func (*Event) IsBroadcaster ¶
IsBroadcaster reports wheather the sender is the owner of the current channel.
func (*Event) IsCoolingDown ¶
IsCoolingDown reports wheather the command is available or if it is cooling down. This could be because of a user, channel or command cooldown. TODO: implement
func (*Event) IsInBotChannel ¶
IsInBotChannel reports wheather the current channel is owned by the bot.
func (*Event) IsModerator ¶
IsModerator reports wheather the sender is a moderator in the current channel.
func (*Event) IsSubscriber ¶
IsSubscriber reports wheather the sender is a subscriber in the current channel.
type Permission ¶
type Permission int
Permission is a int
const ( Everyone Permission = iota Subscriber Regular Moderator Broadcaster Owner )
Possible values for Permission.
func (Permission) String ¶
func (i Permission) String() string
Source Files ¶
- actions.go
- admin.go
- debug.go
- er_dr.go
- errors.go
- event.go
- fill.go
- heart.go
- hello.go
- hello_stirnbot.go
- location.go
- marcs_age.go
- math.go
- maxikings_age.go
- patsch.go
- permission_string.go
- ping.go
- rate.go
- reupload.go
- scambot.go
- state.go
- suicide.go
- time.go
- true.go
- useful.go
- version.go
- voicemail.go
- weather.go