events

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2021 License: Apache-2.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 ButtonClickEvent added in v0.4.0

type ButtonClickEvent struct {
	GenericInteractionEvent
	ButtonInteraction *api.ButtonInteraction
}

ButtonClickEvent indicates that a api.Button was clicked

func (*ButtonClickEvent) ComponentType added in v0.4.0

func (e *ButtonClickEvent) ComponentType() string

ComponentType returns the api.ComponentType from the called api.Button

func (*ButtonClickEvent) CustomID added in v0.4.0

func (e *ButtonClickEvent) CustomID() string

CustomID returns the customID from the called api.Button

func (*ButtonClickEvent) DeferEdit added in v0.4.0

func (e *ButtonClickEvent) DeferEdit() error

DeferEdit replies to the api.ButtonInteraction with api.InteractionResponseTypeDeferredUpdateMessage and cancels the loading state

func (*ButtonClickEvent) Edit added in v0.4.3

func (e *ButtonClickEvent) Edit(messageCreate api.MessageCreate) error

Edit replies to the api.ButtonInteraction with api.InteractionResponseTypeUpdateMessage & api.MessageCreate which edits the original api.Message

func (*ButtonClickEvent) Message added in v0.4.0

func (e *ButtonClickEvent) Message() *api.Message

Message returns the api.Message the api.Button is called from

type CategoryCreateEvent added in v0.2.0

type CategoryCreateEvent struct {
	GenericCategoryEvent
}

CategoryCreateEvent indicates that a new api.Category got created in a api.Guild

type CategoryDeleteEvent added in v0.2.0

type CategoryDeleteEvent struct {
	GenericCategoryEvent
}

CategoryDeleteEvent indicates that a api.Category got deleted in a api.Guild

type CategoryUpdateEvent added in v0.2.0

type CategoryUpdateEvent struct {
	GenericCategoryEvent
	OldCategory *api.Category
}

CategoryUpdateEvent indicates that a api.Category got updated in a api.Guild

type CommandCreateEvent added in v0.4.0

type CommandCreateEvent struct {
	GenericCommandEvent
}

CommandCreateEvent indicates that a new api.Command got created(this can come from any bot!)

type CommandDeleteEvent added in v0.4.0

type CommandDeleteEvent struct {
	GenericCommandEvent
}

CommandDeleteEvent indicates that a api.Command got deleted(this can come from any bot!)

type CommandEvent added in v0.4.0

type CommandEvent struct {
	GenericInteractionEvent
	CommandInteraction  *api.CommandInteraction
	CommandID           api.Snowflake
	CommandName         string
	SubCommandName      *string
	SubCommandGroupName *string
	Options             []*api.Option
}

CommandEvent indicates that a slash api.Command was ran

func (CommandEvent) CommandPath added in v0.4.0

func (e CommandEvent) CommandPath() string

CommandPath returns the api.Command path

func (CommandEvent) Option added in v0.4.0

func (e CommandEvent) Option(name string) *api.Option

Option returns an Option by name

func (CommandEvent) OptionN added in v0.4.0

func (e CommandEvent) OptionN(name string) []*api.Option

OptionN returns Option(s) by name

func (CommandEvent) OptionsT added in v0.4.0

func (e CommandEvent) OptionsT(optionType api.CommandOptionType) []*api.Option

OptionsT returns Option(s) by api.CommandOptionType

type CommandUpdateEvent added in v0.4.0

type CommandUpdateEvent struct {
	GenericCommandEvent
	OldCommand *api.Command
}

CommandUpdateEvent indicates that a api.Command got updated(this can come from any bot!)

type ConnectedEvent added in v0.2.0

type ConnectedEvent struct {
	GenericGatewayStatusEvent
}

ConnectedEvent indicates disgo connected to the api.Gateway

type DMChannelCreateEvent added in v0.2.0

type DMChannelCreateEvent struct {
	GenericDMChannelEvent
}

DMChannelCreateEvent indicates that a new api.DMChannel got created

type DMChannelDeleteEvent added in v0.2.0

type DMChannelDeleteEvent struct {
	GenericDMChannelEvent
}

DMChannelDeleteEvent indicates that a api.DMChannel got deleted

type DMChannelUpdateEvent added in v0.2.0

type DMChannelUpdateEvent struct {
	GenericDMChannelEvent
	OldDMChannel *api.DMChannel
}

DMChannelUpdateEvent indicates that a api.DMChannel got updated

type DMMessageCreateEvent added in v0.2.0

type DMMessageCreateEvent struct {
	GenericDMMessageEvent
}

DMMessageCreateEvent is called upon receiving a api.Message in a api.DMChannel(requires api.GatewayIntentsDirectMessages)

type DMMessageDeleteEvent

type DMMessageDeleteEvent struct {
	GenericDMMessageEvent
}

DMMessageDeleteEvent is called upon deleting a api.Message in a api.DMChannel(requires api.GatewayIntentsDirectMessages)

type DMMessageReactionAddEvent added in v0.2.0

type DMMessageReactionAddEvent struct {
	GenericDMMessageReactionEvent
}

DMMessageReactionAddEvent indicates that a api.User added a api.MessageReaction to a api.Message in a api.DMChannel(requires the api.GatewayIntentsDirectMessageReactions)

type DMMessageReactionRemoveAllEvent added in v0.2.0

type DMMessageReactionRemoveAllEvent struct {
	GenericDMMessageEvent
}

DMMessageReactionRemoveAllEvent indicates someone removed all api.MessageReaction(s) from a api.Message in a api.DMChannel(requires the api.GatewayIntentsDirectMessageReactions)

type DMMessageReactionRemoveEmojiEvent added in v0.4.3

type DMMessageReactionRemoveEmojiEvent struct {
	GenericDMMessageEvent
	MessageReaction api.MessageReaction
}

DMMessageReactionRemoveEmojiEvent indicates someone removed all api.MessageReaction of a specific api.Emoji from a api.Message in a api.DMChannel(requires the api.GatewayIntentsDirectMessageReactions)

type DMMessageReactionRemoveEvent added in v0.2.0

type DMMessageReactionRemoveEvent struct {
	GenericDMMessageReactionEvent
}

DMMessageReactionRemoveEvent indicates that a api.User removed a api.MessageReaction from a api.Message in a api.DMChannel(requires the api.GatewayIntentsDirectMessageReactions)

type DMMessageUpdateEvent

type DMMessageUpdateEvent struct {
	GenericDMMessageEvent
	OldMessage *api.Message
}

DMMessageUpdateEvent is called upon editing a api.Message in a api.DMChannel(requires api.GatewayIntentsDirectMessages)

type DMUserTypingEvent added in v0.2.0

type DMUserTypingEvent struct {
	GenericDMChannelEvent
}

DMUserTypingEvent indicates that a api.User started typing in a api.DMChannel(requires api.GatewayIntentsDirectMessageTyping)

type DisconnectedEvent added in v0.2.0

type DisconnectedEvent struct {
	GenericGatewayStatusEvent
}

DisconnectedEvent indicates disgo disconnected to the api.Gateway

type EmoteCreateEvent added in v0.2.0

type EmoteCreateEvent struct {
	GenericEmoteEvent
}

EmoteCreateEvent indicates that a new api.Emoji got created in a api.Guild(requires api.GatewayIntentsGuildEmojis)

type EmoteDeleteEvent added in v0.2.0

type EmoteDeleteEvent struct {
	GenericEmoteEvent
}

EmoteDeleteEvent indicates that a api.Emoji got deleted in a api.Guild(requires api.GatewayIntentsGuildEmojis)

type EmoteUpdateEvent added in v0.2.0

type EmoteUpdateEvent struct {
	GenericEmoteEvent
	OldEmote *api.Emoji
}

EmoteUpdateEvent indicates that a api.Emoji got updated in a api.Guild(requires api.GatewayIntentsGuildEmojis)

type GenericCategoryEvent

type GenericCategoryEvent struct {
	GenericGuildChannelEvent
	Category *api.Category
}

GenericCategoryEvent is called upon receiving CategoryCreateEvent, CategoryUpdateEvent or CategoryDeleteEvent

type GenericChannelEvent

type GenericChannelEvent struct {
	GenericEvent
	ChannelID api.Snowflake
	Channel   *api.Channel
}

GenericChannelEvent is called upon receiving any api.Channel api.Event

type GenericCommandEvent added in v0.4.0

type GenericCommandEvent struct {
	GenericEvent
	CommandID api.Snowflake
	Command   *api.Command
	GuildID   *api.Snowflake
}

GenericCommandEvent is called upon receiving either CommandCreateEvent, CommandUpdateEvent or CommandDeleteEvent

func (GenericCommandEvent) Guild added in v0.4.0

func (e GenericCommandEvent) Guild() *api.Guild

Guild returns the api.Guild the api.Event got called or nil for global api.Command(s)

type GenericDMChannelEvent

type GenericDMChannelEvent struct {
	GenericChannelEvent
	DMChannel *api.DMChannel
}

GenericDMChannelEvent is called upon receiving DMChannelCreateEvent, DMChannelUpdateEvent, DMChannelDeleteEvent or DMUserTypingEvent

type GenericDMMessageEvent

type GenericDMMessageEvent struct {
	GenericMessageEvent
}

GenericDMMessageEvent is called upon receiving DMMessageCreateEvent, DMMessageUpdateEvent, DMMessageDeleteEvent, GenericDMMessageReactionEvent, DMMessageReactionAddEvent, DMMessageReactionRemoveEvent, DMMessageReactionRemoveEmojiEvent or DMMessageReactionRemoveAllEvent(requires api.GatewayIntentsDirectMessages)

func (GenericDMMessageEvent) DMChannel added in v0.2.0

func (e GenericDMMessageEvent) DMChannel() *api.DMChannel

DMChannel returns the api.DMChannel where the GenericDMMessageEvent happened

type GenericDMMessageReactionEvent added in v0.2.0

type GenericDMMessageReactionEvent struct {
	GenericGuildMessageEvent
	UserID          api.Snowflake
	User            *api.User
	MessageReaction api.MessageReaction
}

GenericDMMessageReactionEvent is called upon receiving DMMessageReactionAddEvent or DMMessageReactionRemoveEvent(requires the api.GatewayIntentsDirectMessageReactions)

type GenericEmoteEvent added in v0.2.0

type GenericEmoteEvent struct {
	GenericGuildEvent
	Emote *api.Emoji
}

GenericEmoteEvent is called upon receiving EmoteCreateEvent, EmoteUpdateEvent or EmoteDeleteEvent(requires api.GatewayIntentsGuildEmojis)

type GenericEvent added in v0.2.0

type GenericEvent struct {
	// contains filtered or unexported fields
}

GenericEvent the base event structure

func NewEvent added in v0.2.0

func NewEvent(disgo api.Disgo, sequenceNumber int) GenericEvent

NewEvent constructs a new GenericEvent with the provided Disgo instance

func (GenericEvent) Disgo added in v0.2.0

func (d GenericEvent) Disgo() api.Disgo

Disgo returns the Disgo instance for this event

func (GenericEvent) SequenceNumber added in v0.2.0

func (d GenericEvent) SequenceNumber() int

SequenceNumber returns the sequence number of the gateway event

type GenericGatewayStatusEvent added in v0.2.0

type GenericGatewayStatusEvent struct {
	GenericEvent
	Status api.GatewayStatus
}

GenericGatewayStatusEvent is called upon receiving ConnectedEvent, ReconnectedEvent, ResumedEvent, DisconnectedEvent or ShutdownEvent

type GenericGuildChannelEvent added in v0.4.3

type GenericGuildChannelEvent struct {
	GenericChannelEvent
	GuildID      api.Snowflake
	GuildChannel *api.GuildChannel
}

GenericGuildChannelEvent is called upon receiving GuildChannelCreateEvent, GuildChannelUpdateEvent or GuildChannelDeleteEvent

func (GenericGuildChannelEvent) Guild added in v0.4.3

func (e GenericGuildChannelEvent) Guild() *api.Guild

Guild returns the cached api.Guild the event happened in

type GenericGuildEvent

type GenericGuildEvent struct {
	GenericEvent
	GuildID api.Snowflake
	Guild   *api.Guild
}

GenericGuildEvent is called upon receiving GuildUpdateEvent, GuildAvailableEvent, GuildUnavailableEvent, GuildJoinEvent, GuildLeaveEvent, GuildReadyEvent, GuildBanEvent, GuildUnbanEvent

type GenericGuildInviteEvent added in v0.2.0

type GenericGuildInviteEvent struct {
	GenericGuildEvent
	Code      string
	ChannelID api.Snowflake
}

GenericGuildInviteEvent is called upon receiving GuildInviteCreateEvent or GuildInviteDeleteEvent(requires api.GatewayIntentsGuildInvites)

func (GenericGuildInviteEvent) Category added in v0.2.0

func (e GenericGuildInviteEvent) Category() *api.Category

Category returns the api.Category the GenericGuildInviteEvent happened in(returns nil if the api.Category is uncached or api.CacheFlagCategories is disabled)

func (GenericGuildInviteEvent) Channel added in v0.2.0

func (e GenericGuildInviteEvent) Channel() *api.Channel

Channel returns the api.Channel the GenericGuildInviteEvent happened in(returns nil if the api.Channel is uncached or api.Cache is disabled)

func (GenericGuildInviteEvent) GuildChannel added in v0.2.0

func (e GenericGuildInviteEvent) GuildChannel() *api.GuildChannel

GuildChannel returns the api.GuildChannel the GenericGuildInviteEvent happened in(returns nil if the api.GuildChannel is uncached or api.Cache is disabled)

func (GenericGuildInviteEvent) MessageChannel added in v0.2.0

func (e GenericGuildInviteEvent) MessageChannel() *api.TextChannel

MessageChannel returns the api.MessageChannel the GenericGuildInviteEvent happened in(returns nil if the api.MessageChannel is uncached or api.Cache is disabled)

func (GenericGuildInviteEvent) StoreChannel added in v0.2.0

func (e GenericGuildInviteEvent) StoreChannel() *api.StoreChannel

StoreChannel returns the api.StoreChannel the GenericGuildInviteEvent happened in(returns nil if the api.StoreChannel is uncached or api.CacheFlagStoreChannels is disabled)

func (GenericGuildInviteEvent) TextChannel added in v0.2.0

func (e GenericGuildInviteEvent) TextChannel() *api.TextChannel

TextChannel returns the api.TextChannel the GenericGuildInviteEvent happened in(returns nil if the api.TextChannel is uncached or api.CacheFlagTextChannels is disabled)

func (GenericGuildInviteEvent) VoiceChannel added in v0.2.0

func (e GenericGuildInviteEvent) VoiceChannel() *api.VoiceChannel

VoiceChannel returns the api.VoiceChannel the GenericGuildInviteEvent happened in(returns nil if the api.VoiceChannel is uncached or api.CacheFlagVoiceChannels is disabled)

type GenericGuildMemberEvent

type GenericGuildMemberEvent struct {
	GenericGuildEvent
	Member *api.Member
}

GenericGuildMemberEvent generic api.Member event

func (GenericGuildMemberEvent) User

func (e GenericGuildMemberEvent) User() *api.User

User gets the api.User form the api.Cache

type GenericGuildMessageEvent

type GenericGuildMessageEvent struct {
	GenericMessageEvent
	GuildID api.Snowflake
}

GenericGuildMessageEvent is called upon receiving GuildMessageCreateEvent, GuildMessageUpdateEvent or GuildMessageDeleteEvent

func (GenericGuildMessageEvent) Guild added in v0.2.0

func (e GenericGuildMessageEvent) Guild() *api.Guild

Guild returns the api.Guild the GenericGuildMessageEvent happened in

func (GenericGuildMessageEvent) TextChannel added in v0.2.0

func (e GenericGuildMessageEvent) TextChannel() *api.TextChannel

TextChannel returns the api.TextChannel from the api.Cache

type GenericGuildMessageReactionEvent added in v0.2.0

type GenericGuildMessageReactionEvent struct {
	GenericGuildMessageEvent
	UserID          api.Snowflake
	Member          *api.Member
	MessageReaction api.MessageReaction
}

GenericGuildMessageReactionEvent is called upon receiving DMMessageReactionAddEvent or DMMessageReactionRemoveEvent

type GenericGuildVoiceEvent added in v0.2.0

type GenericGuildVoiceEvent struct {
	GenericGuildMemberEvent
	VoiceState *api.VoiceState
}

GenericGuildVoiceEvent is called upon receiving GuildVoiceJoinEvent, GuildVoiceUpdateEvent, GuildVoiceLeaveEvent

type GenericInteractionEvent

type GenericInteractionEvent struct {
	GenericEvent
	Interaction *api.Interaction
}

GenericInteractionEvent generic api.Interaction event

func (*GenericInteractionEvent) DeferReply added in v0.4.3

func (e *GenericInteractionEvent) DeferReply(ephemeral bool) error

DeferReply replies to the api.CommandInteraction with api.InteractionResponseTypeDeferredChannelMessageWithSource and shows a loading state

func (*GenericInteractionEvent) DeleteFollowup added in v0.4.0

func (e *GenericInteractionEvent) DeleteFollowup(messageID api.Snowflake) error

DeleteFollowup used to delete a followup api.Message from an api.Interaction

func (*GenericInteractionEvent) DeleteOriginal added in v0.4.0

func (e *GenericInteractionEvent) DeleteOriginal() error

DeleteOriginal deletes the original api.InteractionResponse

func (*GenericInteractionEvent) EditFollowup added in v0.4.0

func (e *GenericInteractionEvent) EditFollowup(messageID api.Snowflake, messageUpdate api.MessageUpdate) (*api.Message, error)

EditFollowup used to edit a followup api.Message from an api.Interaction

func (*GenericInteractionEvent) EditOriginal added in v0.4.0

func (e *GenericInteractionEvent) EditOriginal(messageUpdate api.MessageUpdate) (*api.Message, error)

EditOriginal edits the original api.InteractionResponse

func (*GenericInteractionEvent) Reply added in v0.4.0

func (e *GenericInteractionEvent) Reply(messageCreate api.MessageCreate) error

Reply replies to the api.Interaction with api.InteractionResponseTypeDeferredChannelMessageWithSource & api.MessageCreate

func (*GenericInteractionEvent) Respond added in v0.4.3

func (e *GenericInteractionEvent) Respond(responseType api.InteractionResponseType, data interface{}) error

Respond replies to the api.Interaction with the provided api.InteractionResponse

func (*GenericInteractionEvent) SendFollowup added in v0.4.0

func (e *GenericInteractionEvent) SendFollowup(messageCreate api.MessageCreate) (*api.Message, error)

SendFollowup used to send a followup api.MessageCreate to an api.Interaction

type GenericMessageEvent

type GenericMessageEvent struct {
	GenericEvent
	MessageID api.Snowflake
	Message   *api.Message
	ChannelID api.Snowflake
}

GenericMessageEvent generic api.Message event

func (*GenericMessageEvent) MessageChannel

func (e *GenericMessageEvent) MessageChannel() *api.MessageChannel

MessageChannel returns the api.MessageChannel where the GenericMessageEvent happened

type GenericReactionEvents added in v0.2.0

type GenericReactionEvents struct {
	GenericMessageEvent
	UserID          api.Snowflake
	User            *api.User
	MessageReaction api.MessageReaction
}

GenericReactionEvents is called upon receiving MessageReactionAddEvent or MessageReactionRemoveEvent

type GenericRoleEvent added in v0.2.0

type GenericRoleEvent struct {
	GenericGuildEvent
	RoleID api.Snowflake
	Role   *api.Role
}

GenericRoleEvent generic api.Role event

type GenericStoreChannelEvent

type GenericStoreChannelEvent struct {
	GenericGuildChannelEvent
	StoreChannel *api.StoreChannel
}

GenericStoreChannelEvent is called upon receiving StoreChannelCreateEvent, StoreChannelUpdateEvent or StoreChannelDeleteEvent

type GenericTextChannelEvent

type GenericTextChannelEvent struct {
	GenericGuildChannelEvent
	TextChannel *api.TextChannel
}

GenericTextChannelEvent is called upon receiving TextChannelCreateEvent, TextChannelUpdateEvent or TextChannelDeleteEvent

type GenericUserActivityEvent added in v0.2.0

type GenericUserActivityEvent struct {
	GenericGuildMemberEvent
	Member *api.Member
}

GenericUserActivityEvent is called upon receiving UserActivityStartEvent, UserActivityUpdateEvent or UserActivityEndEvent(requires the api.GatewayIntentsGuildPresences)

type GenericUserEvent added in v0.2.0

type GenericUserEvent struct {
	GenericEvent
	UserID api.Snowflake
	User   *api.User
}

GenericUserEvent is called upon receiving UserUpdateEvent or UserTypingEvent

type GenericVoiceChannelEvent

type GenericVoiceChannelEvent struct {
	GenericGuildChannelEvent
	VoiceChannel *api.VoiceChannel
}

GenericVoiceChannelEvent is called upon receiving VoiceChannelCreateEvent, VoiceChannelUpdateEvent or VoiceChannelDeleteEvent

type GuildAvailableEvent

type GuildAvailableEvent struct {
	GenericGuildEvent
}

GuildAvailableEvent is called when an unavailable api.Guild becomes available

type GuildBanEvent added in v0.2.0

type GuildBanEvent struct {
	GenericGuildEvent
	User *api.User
}

GuildBanEvent is called when a api.Member/api.User is banned from the api.Guild

type GuildChannelCreateEvent added in v0.4.3

type GuildChannelCreateEvent struct {
	GenericGuildChannelEvent
}

GuildChannelCreateEvent indicates that a new api.GuildChannel got created in a api.Guild

type GuildChannelDeleteEvent added in v0.4.3

type GuildChannelDeleteEvent struct {
	GenericGuildChannelEvent
}

GuildChannelDeleteEvent indicates that a api.GuildChannel got deleted in a api.Guild

type GuildChannelUpdateEvent added in v0.4.3

type GuildChannelUpdateEvent struct {
	GenericGuildChannelEvent
	OldGuildChannel *api.GuildChannel
}

GuildChannelUpdateEvent indicates that a api.GuildChannel got updated in a api.Guild

type GuildInviteCreateEvent added in v0.2.0

type GuildInviteCreateEvent struct {
	GenericGuildInviteEvent
	Invite *api.Invite
}

GuildInviteCreateEvent is called upon creation of a new api.Invite in a api.Guild(requires api.GatewayIntentsGuildInvites)

type GuildInviteDeleteEvent added in v0.2.0

type GuildInviteDeleteEvent struct {
	GenericGuildInviteEvent
}

GuildInviteDeleteEvent is called upon deletion of a new api.Invite in a api.Guild(requires api.GatewayIntentsGuildInvites)

type GuildJoinEvent

type GuildJoinEvent struct {
	GenericGuildEvent
}

GuildJoinEvent is called when the bot joins a api.Guild

type GuildLeaveEvent

type GuildLeaveEvent struct {
	GenericGuildEvent
}

GuildLeaveEvent is called when the bot leaves a api.Guild

type GuildMemberJoinEvent

type GuildMemberJoinEvent struct {
	GenericGuildMemberEvent
}

GuildMemberJoinEvent indicates that a api.Member joined the api.Guild

type GuildMemberLeaveEvent

type GuildMemberLeaveEvent struct {
	GenericGuildMemberEvent
	User *api.User
}

GuildMemberLeaveEvent indicates that a api.Member left the api.Guild

type GuildMemberTypingEvent added in v0.2.0

type GuildMemberTypingEvent struct {
	GenericGuildMemberEvent
	ChannelID api.Snowflake
}

GuildMemberTypingEvent indicates that a api.Member started typing in a api.TextChannel(requires api.GatewayIntentsGuildMessageTyping)

func (GuildMemberTypingEvent) TextChannel added in v0.2.0

func (e GuildMemberTypingEvent) TextChannel() *api.TextChannel

TextChannel returns the api.TextChannel the GuildMemberTypingEvent happened in

type GuildMemberUpdateEvent

type GuildMemberUpdateEvent struct {
	GenericGuildMemberEvent
	OldMember *api.Member
}

GuildMemberUpdateEvent indicates that a api.Member updated

type GuildMessageCreateEvent added in v0.2.0

type GuildMessageCreateEvent struct {
	GenericGuildMessageEvent
}

GuildMessageCreateEvent is called upon receiving a api.Message in a api.DMChannel

type GuildMessageDeleteEvent

type GuildMessageDeleteEvent struct {
	GenericGuildMessageEvent
}

GuildMessageDeleteEvent is called upon deleting a api.Message in a api.DMChannel

type GuildMessageReactionAddEvent added in v0.2.0

type GuildMessageReactionAddEvent struct {
	GenericGuildMessageReactionEvent
}

GuildMessageReactionAddEvent indicates that a api.Member added a api.MessageReaction to a api.Message in a api.TextChannel(requires the api.GatewayIntentsGuildMessageReactions)

type GuildMessageReactionRemoveAllEvent added in v0.2.0

type GuildMessageReactionRemoveAllEvent struct {
	GenericGuildMessageEvent
}

GuildMessageReactionRemoveAllEvent indicates someone removed all api.MessageReaction(s) from a api.Message in a api.TextChannel(requires the api.GatewayIntentsGuildMessageReactions)

type GuildMessageReactionRemoveEmojiEvent added in v0.4.3

type GuildMessageReactionRemoveEmojiEvent struct {
	GenericGuildMessageEvent
	MessageReaction api.MessageReaction
}

GuildMessageReactionRemoveEmojiEvent indicates someone removed all api.MessageReaction of a specific api.Emoji from a api.Message in a api.TextChannel(requires the api.GatewayIntentsGuildMessageReactions)

type GuildMessageReactionRemoveEvent added in v0.2.0

type GuildMessageReactionRemoveEvent struct {
	GenericGuildMessageReactionEvent
}

GuildMessageReactionRemoveEvent indicates that a api.Member removed a api.MessageReaction from a api.Message in a api.TextChannel(requires the api.GatewayIntentsGuildMessageReactions)

type GuildMessageUpdateEvent

type GuildMessageUpdateEvent struct {
	GenericGuildMessageEvent
	OldMessage *api.Message
}

GuildMessageUpdateEvent is called upon editing a api.Message in a api.DMChannel

type GuildReadyEvent added in v0.2.0

type GuildReadyEvent struct {
	GenericGuildEvent
}

GuildReadyEvent is called when the loaded the api.Guild in login phase

type GuildUnavailableEvent

type GuildUnavailableEvent struct {
	GenericGuildEvent
}

GuildUnavailableEvent is called when an available api.Guild becomes unavailable

type GuildUnbanEvent added in v0.2.0

type GuildUnbanEvent struct {
	GenericGuildEvent
	User *api.User
}

GuildUnbanEvent is called when a api.Member/api.User is unbanned from the api.Guild

type GuildUpdateEvent

type GuildUpdateEvent struct {
	GenericGuildEvent
	OldGuild *api.Guild
}

GuildUpdateEvent is called upon receiving api.Guild updates

type GuildVoiceJoinEvent added in v0.2.0

type GuildVoiceJoinEvent struct {
	GenericGuildVoiceEvent
}

GuildVoiceJoinEvent indicates that a api.Member joined a api.VoiceChannel(requires api.GatewayIntentsGuildVoiceStates)

type GuildVoiceLeaveEvent added in v0.2.0

type GuildVoiceLeaveEvent struct {
	GenericGuildVoiceEvent
}

GuildVoiceLeaveEvent indicates that a api.Member left a api.VoiceChannel(requires api.GatewayIntentsGuildVoiceStates)

type GuildVoiceUpdateEvent added in v0.2.0

type GuildVoiceUpdateEvent struct {
	GenericGuildVoiceEvent
	OldVoiceState *api.VoiceState
}

GuildVoiceUpdateEvent indicates that a api.Member moved a api.VoiceChannel(requires api.GatewayIntentsGuildVoiceStates)

type HTTPRequestEvent added in v0.2.0

type HTTPRequestEvent struct {
	GenericEvent
	Request  *http.Request
	Response *http.Response
}

HTTPRequestEvent indicates a new http.Request was made and can be used to collect data of StatusCodes as an example

type HeartbeatEvent added in v0.2.0

type HeartbeatEvent struct {
	GenericEvent
	NewPing time.Duration
	OldPing time.Duration
}

HeartbeatEvent is called upon sending a heartbeat to the api.Gateway

type ListenerAdapter

type ListenerAdapter struct {
	// Other events
	OnGenericEvent func(event GenericEvent)
	OnHeartbeat    func(event HeartbeatEvent)
	OnHTTPRequest  func(event HTTPRequestEvent)
	OnRawGateway   func(event RawGatewayEvent)
	OnReadyEvent   func(event ReadyEvent)

	// api.Command Events
	OnGenericCommandEvent func(event GenericCommandEvent)
	OnCommandCreate       func(event CommandCreateEvent)
	OnCommandUpdate       func(event CommandUpdateEvent)
	OnCommandDelete       func(event CommandDeleteEvent)

	// api.Channel Events
	OnGenericChannelEvent func(event GenericChannelEvent)

	// api.GuildChannel Events
	OnGenericGuildChannelEvent func(event GenericGuildChannelEvent)
	OnGuildChannelCreate       func(event GuildChannelCreateEvent)
	OnGuildChannelUpdate       func(event GuildChannelUpdateEvent)
	OnGuildChannelDelete       func(event GuildChannelDeleteEvent)

	// api.Category Events
	OnGenericCategoryEvent func(event GenericCategoryEvent)
	OnCategoryCreate       func(event CategoryCreateEvent)
	OnCategoryUpdate       func(event CategoryUpdateEvent)
	OnCategoryDelete       func(event CategoryDeleteEvent)

	// api.DMChannel Events
	OnGenericDMChannelEvent func(event GenericDMChannelEvent)
	OnDMChannelCreate       func(event DMChannelCreateEvent)
	OnDMChannelUpdate       func(event DMChannelUpdateEvent)
	OnDMChannelDelete       func(event DMChannelDeleteEvent)

	// api.DMChannel Reaction Events
	OnGenericDMMessageReactionEventEvent func(event GenericDMMessageReactionEvent)
	OnDMMessageReactionAdd               func(event DMMessageReactionAddEvent)
	OnDMMessageReactionRemove            func(event DMMessageReactionRemoveEvent)
	OnDMMessageReactionRemoveEmoji       func(event DMMessageReactionRemoveEmojiEvent)
	OnDMMessageReactionRemoveAll         func(event DMMessageReactionRemoveAllEvent)

	// api.StoreChannel Events
	OnGenericStoreChannelEvent func(event GenericStoreChannelEvent)
	OnStoreChannelCreate       func(event StoreChannelCreateEvent)
	OnStoreChannelUpdate       func(event StoreChannelUpdateEvent)
	OnStoreChannelDelete       func(event StoreChannelDeleteEvent)

	// api.TextChannel Events
	OnGenericTextChannelEvent func(event GenericTextChannelEvent)
	OnTextChannelCreate       func(event TextChannelCreateEvent)
	OnTextChannelUpdate       func(event TextChannelUpdateEvent)
	OnTextChannelDelete       func(event TextChannelDeleteEvent)

	// api.VoiceChannel Events
	OnGenericVoiceChannelEvent func(event GenericVoiceChannelEvent)
	OnVoiceChannelCreate       func(event VoiceChannelCreateEvent)
	OnVoiceChannelUpdate       func(event VoiceChannelUpdateEvent)
	OnVoiceChannelDelete       func(event VoiceChannelDeleteEvent)

	// api.Emoji Events
	OnGenericEmoteEvent func(event GenericEmoteEvent)
	OnEmoteCreate       func(event EmoteCreateEvent)
	OnEmoteUpdate       func(event EmoteUpdateEvent)
	OnEmoteDelete       func(event EmoteDeleteEvent)

	// api.GatewayStatus Events
	OnGenericGatewayStatusEvent func(event GenericGatewayStatusEvent)
	OnConnected                 func(event ConnectedEvent)
	OnReconnected               func(event ReconnectedEvent)
	OnResumed                   func(event ResumedEvent)
	OnDisconnected              func(event DisconnectedEvent)

	// api.Guild Events
	OnGenericGuildEvent func(event GenericGuildEvent)
	OnGuildJoin         func(event GuildJoinEvent)
	OnGuildUpdate       func(event GuildUpdateEvent)
	OnGuildLeave        func(event GuildLeaveEvent)
	OnGuildAvailable    func(event GuildAvailableEvent)
	OnGuildUnavailable  func(event GuildUnavailableEvent)
	OnGuildReady        func(event GuildReadyEvent)
	OnGuildBan          func(event GuildBanEvent)
	OnGuildUnban        func(event GuildUnbanEvent)

	// api.Guild api.Invite Events
	OnGenericGuildInviteEvent func(event GenericGuildInviteEvent)
	OnGuildInviteCreate       func(event GuildInviteCreateEvent)
	OnGuildInviteDelete       func(event GuildInviteDeleteEvent)

	// api.Guild api.Member Events
	OnGenericGuildMemberEvent func(event GenericGuildMemberEvent)
	OnGuildMemberJoin         func(event GuildMemberJoinEvent)
	OnGuildMemberUpdate       func(event GuildMemberUpdateEvent)
	OnGuildMemberLeave        func(event GuildMemberLeaveEvent)

	// api.Guild api.Message Events
	OnGenericGuildMessageEvent func(event GenericGuildMessageEvent)
	OnGuildMessageCreate       func(event GuildMessageCreateEvent)
	OnGuildMessageUpdate       func(event GuildMessageUpdateEvent)
	OnGuildMessageDelete       func(event GuildMessageDeleteEvent)

	// api.Guild api.Message Reaction Events
	OnGenericGuildMessageReactionEvent func(event GenericGuildMessageReactionEvent)
	OnGuildMessageReactionAdd          func(event GuildMessageReactionAddEvent)
	OnGuildMessageReactionRemove       func(event GuildMessageReactionRemoveEvent)
	OnGuildMessageReactionRemoveEmoji  func(event GuildMessageReactionRemoveEmojiEvent)
	OnGuildMessageReactionRemoveAll    func(event GuildMessageReactionRemoveAllEvent)

	// api.Guild Voice Events
	OnGenericGuildVoiceEvent func(event GenericGuildVoiceEvent)
	OnGuildVoiceUpdate       func(event GuildVoiceUpdateEvent)
	OnGuildVoiceJoin         func(event GuildVoiceJoinEvent)
	OnGuildVoiceLeave        func(event GuildVoiceLeaveEvent)

	// api.Guild api.Role Events
	OnGenericRoleEvent func(event GenericRoleEvent)
	OnRoleCreate       func(event RoleCreateEvent)
	OnRoleUpdate       func(event RoleUpdateEvent)
	OnRoleDelete       func(event RoleDeleteEvent)

	// api.Interaction Events
	OnGenericInteractionEvent func(event GenericInteractionEvent)
	OnCommand                 func(event CommandEvent)
	OnButtonClick             func(event ButtonClickEvent)

	// api.Message Events
	OnGenericMessageEvent func(event GenericMessageEvent)
	OnMessageCreate       func(event MessageCreateEvent)
	OnMessageUpdate       func(event MessageUpdateEvent)
	OnMessageDelete       func(event MessageDeleteEvent)

	// api.Message Reaction Events
	OnGenericReactionEvent       func(event GenericReactionEvents)
	OnMessageReactionAdd         func(event MessageReactionAddEvent)
	OnMessageReactionRemove      func(event MessageReactionRemoveEvent)
	OnMessageReactionRemoveEmoji func(event MessageReactionRemoveEmojiEvent)
	OnMessageReactionRemoveAll   func(event MessageReactionRemoveAllEvent)

	// Self Events
	OnSelfUpdate func(event SelfUpdateEvent)

	// api.User Events
	OnGenericUserEvent func(event GenericUserEvent)
	OnUserUpdate       func(event UserUpdateEvent)
	OnUserTyping       func(event UserTypingEvent)
	OnGuildUserTyping  func(event GuildMemberTypingEvent)
	OnDMUserTyping     func(event DMUserTypingEvent)

	// api.User api.Activity Events
	OnGenericUserActivityEvent func(event GenericUserActivityEvent)
	OnUserActivityStart        func(event UserActivityStartEvent)
	OnUserActivityUpdate       func(event UserActivityUpdateEvent)
	OnUserActivityEnd          func(event UserActivityEndEvent)
}

ListenerAdapter lets you override the handles for receiving events

func (ListenerAdapter) OnEvent

func (l ListenerAdapter) OnEvent(event interface{})

OnEvent is getting called everytime we receive an event

type MessageCreateEvent added in v0.2.0

type MessageCreateEvent struct {
	GenericMessageEvent
}

MessageCreateEvent indicates that a api.Message got received

type MessageDeleteEvent

type MessageDeleteEvent struct {
	GenericMessageEvent
}

MessageDeleteEvent indicates that a api.Message got deleted

type MessageReactionAddEvent added in v0.2.0

type MessageReactionAddEvent struct {
	GenericReactionEvents
}

MessageReactionAddEvent indicates that a api.User added a api.MessageReaction to a api.Message in a api.Channel(this+++ requires the api.GatewayIntentsGuildMessageReactions and/or api.GatewayIntentsDirectMessageReactions)

type MessageReactionRemoveAllEvent added in v0.2.0

type MessageReactionRemoveAllEvent struct {
	GenericMessageEvent
}

MessageReactionRemoveAllEvent indicates someone removed all api.MessageReaction(s) from a api.Message in a api.Channel(requires the api.GatewayIntentsGuildMessageReactions and/or api.GatewayIntentsDirectMessageReactionss)

type MessageReactionRemoveEmojiEvent added in v0.4.3

type MessageReactionRemoveEmojiEvent struct {
	GenericMessageEvent
	MessageReaction api.MessageReaction
}

MessageReactionRemoveEmojiEvent indicates someone removed all api.MessageReaction of a specific api.Emoji from a api.Message in a api.Channel(requires the api.GatewayIntentsGuildMessageReactions and/or api.GatewayIntentsDirectMessageReactions)

type MessageReactionRemoveEvent added in v0.2.0

type MessageReactionRemoveEvent struct {
	GenericReactionEvents
}

MessageReactionRemoveEvent indicates that a api.User removed a api.MessageReaction from a api.Message in a api.Channel(requires the api.GatewayIntentsGuildMessageReactions and/or api.GatewayIntentsDirectMessageReactions)

type MessageUpdateEvent

type MessageUpdateEvent struct {
	GenericMessageEvent
	OldMessage *api.Message
}

MessageUpdateEvent indicates that a api.Message got update

type RawGatewayEvent added in v0.2.0

type RawGatewayEvent struct {
	GenericEvent
	Type       api.GatewayEventType
	RawPayload json.RawMessage
	Payload    map[string]interface{}
}

RawGatewayEvent is called for any api.GatewayEventType we receive if enabled in the api.DisgoBuilder/api.Options

type ReadyEvent

type ReadyEvent struct {
	GenericEvent
	*api.ReadyGatewayEvent
}

ReadyEvent indicates we received the ReadyEvent from the api.Gateway

type ReconnectedEvent added in v0.2.0

type ReconnectedEvent struct {
	GenericGatewayStatusEvent
}

ReconnectedEvent indicates disgo reconnected to the api.Gateway

type ResumedEvent added in v0.2.0

type ResumedEvent struct {
	GenericGatewayStatusEvent
}

ResumedEvent indicates disgo resumed to the api.Gateway

type RoleCreateEvent added in v0.2.0

type RoleCreateEvent struct {
	GenericGuildEvent
}

RoleCreateEvent indicates that a api.Role got created

type RoleDeleteEvent added in v0.2.0

type RoleDeleteEvent struct {
	GenericGuildEvent
}

RoleDeleteEvent indicates that a api.Role got deleted

type RoleUpdateEvent added in v0.2.0

type RoleUpdateEvent struct {
	GenericGuildEvent
	OldRole *api.Role
}

RoleUpdateEvent indicates that a api.Role got updated

type SelfUpdateEvent added in v0.2.0

type SelfUpdateEvent struct {
	GenericEvent
	Self    *api.User
	OldSelf *api.User
}

SelfUpdateEvent is called when something about this api.User updates

type StoreChannelCreateEvent added in v0.2.0

type StoreChannelCreateEvent struct {
	GenericStoreChannelEvent
}

StoreChannelCreateEvent indicates that a new api.StoreChannel got created in a api.Guild

type StoreChannelDeleteEvent added in v0.2.0

type StoreChannelDeleteEvent struct {
	GenericStoreChannelEvent
}

StoreChannelDeleteEvent indicates that a api.StoreChannel got deleted in a api.Guild

type StoreChannelUpdateEvent added in v0.2.0

type StoreChannelUpdateEvent struct {
	GenericStoreChannelEvent
	OldStoreChannel *api.StoreChannel
}

StoreChannelUpdateEvent indicates that a api.StoreChannel got updated in a api.Guild

type TextChannelCreateEvent added in v0.2.0

type TextChannelCreateEvent struct {
	GenericTextChannelEvent
}

TextChannelCreateEvent indicates that a new api.TextChannel got created in a api.Guild

type TextChannelDeleteEvent added in v0.2.0

type TextChannelDeleteEvent struct {
	GenericTextChannelEvent
}

TextChannelDeleteEvent indicates that a api.TextChannel got deleted in a api.Guild

type TextChannelUpdateEvent added in v0.2.0

type TextChannelUpdateEvent struct {
	GenericTextChannelEvent
	OldTextChannel *api.TextChannel
}

TextChannelUpdateEvent indicates that a api.TextChannel got updated in a api.Guild

type UserActivityEndEvent added in v0.2.0

type UserActivityEndEvent struct {
	GenericUserActivityEvent
	Activity *api.Activity
}

UserActivityEndEvent indicates that a api.User ended a api.Activity(requires the api.GatewayIntentsGuildPresences)

type UserActivityStartEvent added in v0.2.0

type UserActivityStartEvent struct {
	GenericUserActivityEvent
	Activity *api.Activity
}

UserActivityStartEvent indicates that a api.User started a new api.Activity(requires the api.GatewayIntentsGuildPresences)

type UserActivityUpdateEvent added in v0.2.0

type UserActivityUpdateEvent struct {
	GenericUserActivityEvent
	NewActivities *api.Activity
	OldActivities *api.Activity
}

UserActivityUpdateEvent indicates that a api.User's api.Activity(s) updated(requires the api.GatewayIntentsGuildPresences)

type UserTypingEvent added in v0.2.0

type UserTypingEvent struct {
	GenericUserEvent
	ChannelID api.Snowflake
}

UserTypingEvent indicates that a api.User started typing in a api.DMChannel or api.TextChannel(requires the api.GatewayIntentsDirectMessageTyping and/or api.GatewayIntentsGuildMessageTyping)

func (UserTypingEvent) Channel added in v0.2.0

func (e UserTypingEvent) Channel() *api.Channel

Channel returns the api.Channel the api.User started typing in

func (UserTypingEvent) DMChannel added in v0.2.0

func (e UserTypingEvent) DMChannel() *api.DMChannel

DMChannel returns the api.DMChannel the api.User started typing in

func (UserTypingEvent) TextChannel added in v0.2.0

func (e UserTypingEvent) TextChannel() *api.TextChannel

TextChannel returns the api.TextChannel the api.User started typing in

type UserUpdateEvent added in v0.2.0

type UserUpdateEvent struct {
	GenericUserEvent
	OldUser *api.User
}

UserUpdateEvent indicates that a api.User updated

type VoiceChannelCreateEvent added in v0.2.0

type VoiceChannelCreateEvent struct {
	GenericVoiceChannelEvent
}

VoiceChannelCreateEvent indicates that a new api.VoiceChannel got created in a api.Guild

type VoiceChannelDeleteEvent added in v0.2.0

type VoiceChannelDeleteEvent struct {
	GenericVoiceChannelEvent
}

VoiceChannelDeleteEvent indicates that a api.VoiceChannel got deleted in a api.Guild

type VoiceChannelUpdateEvent added in v0.2.0

type VoiceChannelUpdateEvent struct {
	GenericVoiceChannelEvent
	OldVoiceChannel *api.VoiceChannel
}

VoiceChannelUpdateEvent indicates that a api.VoiceChannel got updated in a api.Guild

type WebhooksUpdateEvent added in v0.4.3

type WebhooksUpdateEvent struct {
	GenericTextChannelEvent
}

WebhooksUpdateEvent indicates that a api.Webhook updated in this api.TextChannel

Jump to

Keyboard shortcuts

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