Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type EventHandler ¶
type EventHandler interface { HandleMessage(*discordgo.MessageCreate) HandleReactionAdd(*discordgo.MessageReaction) HandleReactionRemove(*discordgo.MessageReaction) }
EventHandler is a struct which can handle all the events the discord listener generates.
type EventSource ¶
type EventSource struct {
// contains filtered or unexported fields
}
EventSource represents a connection to the Discord gateway
func StartDiscordListener ¶
func StartDiscordListener(handler EventHandler) (*EventSource, error)
StartDiscordListener initializes an EventSource and starts listening for events from the discord gateway
func (*EventSource) BotAddURL ¶
func (d *EventSource) BotAddURL() (*url.URL, error)
BotAddURL generates a URL that can be used to add the bot to a server
func (*EventSource) Close ¶
func (d *EventSource) Close()
Close cleanly terminates the Discord connection
func (*EventSource) GuildMembersIter ¶
func (e *EventSource) GuildMembersIter(guildID string) chan GuildMemberResult
GuildMembersIter returns a new iterator through the members in a given discord guild
func (*EventSource) Session ¶
func (d *EventSource) Session() *discordgo.Session
Session returns a handle to the underlying discordgo session
type GuildMemberResult ¶
GuildMemberResult represents an item fetched using the a GuildMembersIter.
Click to show internal directories.
Click to hide internal directories.