discord

package
v0.0.0-...-f16325d Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 25, 2021 License: AGPL-3.0 Imports: 5 Imported by: 0

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

type GuildMemberResult struct {
	Member *discordgo.Member
	Error  error
}

GuildMemberResult represents an item fetched using the a GuildMembersIter.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL