Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Option ¶
type Option struct { // A unicode representation of the emoji option Emoji string // OnSucess is the function to call every time MinClicks has been met on the given emoji OnSucess func(user *discordgo.User, watchContext *WatchContext) // OnError is the function to call when the watcher or poller encounters an error OnError func(err error, watchContext *WatchContext) // ReactionLimit is the cap for the total number of reactions polled ReactionLimit int // Expiration as a Timer Expiration time.Duration }
Option contains a callback and expiration for a given emoji
type WatchContext ¶
type WatchContext struct { // Message is a DiscordGo Message object pointer Message *discordgo.Message // Session is a DiscordGo Session object pointer Session *discordgo.Session // TickRate is how frequently to poll the reactions on the message TickRate time.Duration // Data (for lack of a better name). An interface for storing just about anything Data interface{} }
WatchContext contains the objects and tickrate needed to watch a message
func NewWatcher ¶
func NewWatcher( message *discordgo.Message, session *discordgo.Session, tickRate time.Duration, data interface{}, ) (*WatchContext, error)
NewWatcher creates a new WatchContext
func (*WatchContext) Add ¶
func (ctx *WatchContext) Add(options ...Option) error
Add adds watchers to the given WatchContext corresponding to the given reaction. Reactions are specified as an array of Options.
Click to show internal directories.
Click to hide internal directories.