events

package
v0.6.6 Latest Latest
Warning

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

Go to latest
Published: Dec 3, 2021 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleRawEvent

func HandleRawEvent(bot *core.Bot, gatewayEventType discord.GatewayEventType, sequenceNumber int, reader io.Reader) io.Reader

Types

type ApplicationCommandInteractionCreateEvent

type ApplicationCommandInteractionCreateEvent struct {
	*GenericEvent
	core.ApplicationCommandInteraction
}

type AutocompleteEvent

type AutocompleteEvent struct {
	*GenericEvent
	*core.AutocompleteInteraction
}

type ButtonClickEvent

type ButtonClickEvent struct {
	*GenericEvent
	*core.ButtonInteraction
}

ButtonClickEvent indicates that a discord.ButtonComponent was clicked

type ComponentInteractionCreateEvent

type ComponentInteractionCreateEvent struct {
	*GenericEvent
	core.ComponentInteraction
}

type DMChannelCreateEvent

type DMChannelCreateEvent struct {
	*GenericDMChannelEvent
}

DMChannelCreateEvent indicates that a new core.DMChannel got created

type DMChannelDeleteEvent

type DMChannelDeleteEvent struct {
	*GenericDMChannelEvent
}

DMChannelDeleteEvent indicates that a core.DMChannel got deleted

type DMChannelPinsUpdateEvent

type DMChannelPinsUpdateEvent struct {
	*GenericEvent
	ChannelID           discord.Snowflake
	NewLastPinTimestamp *discord.Time
	OldLastPinTimestamp *discord.Time
}

type DMChannelUpdateEvent

type DMChannelUpdateEvent struct {
	*GenericDMChannelEvent
	OldChannel *core.DMChannel
}

DMChannelUpdateEvent indicates that a core.DMChannel got updated

type DMChannelUserTypingStartEvent

type DMChannelUserTypingStartEvent struct {
	*GenericEvent
	ChannelID discord.Snowflake
	UserID    discord.Snowflake
	Timestamp time.Time
}

DMChannelUserTypingStartEvent indicates that a core.User started typing in a core.DMChannel(requires discord.GatewayIntentDirectMessageTyping)

func (DMChannelUserTypingStartEvent) Channel

Channel returns the core.DMChannel the DMChannelUserTypingStartEvent happened in

type DMMessageCreateEvent

type DMMessageCreateEvent struct {
	*GenericDMMessageEvent
}

DMMessageCreateEvent is called upon receiving a core.Message in a Channel (requires discord.GatewayIntentsDirectMessage)

type DMMessageDeleteEvent

type DMMessageDeleteEvent struct {
	*GenericDMMessageEvent
}

DMMessageDeleteEvent is called upon deleting a core.Message in a Channel (requires discord.GatewayIntentsDirectMessage)

type DMMessageReactionAddEvent

type DMMessageReactionAddEvent struct {
	*GenericDMMessageReactionEvent
}

DMMessageReactionAddEvent indicates that a core.User added a discord.MessageReaction to a core.Message in a Channel (requires the discord.GatewayIntentDirectMessageReactions)

type DMMessageReactionRemoveAllEvent

type DMMessageReactionRemoveAllEvent struct {
	*GenericEvent
	ChannelID discord.Snowflake
	MessageID discord.Snowflake
}

DMMessageReactionRemoveAllEvent indicates someone removed all discord.MessageReaction(s) from a core.Message in a Channel (requires the discord.GatewayIntentDirectMessageReactions)

type DMMessageReactionRemoveEmojiEvent

type DMMessageReactionRemoveEmojiEvent struct {
	*GenericEvent
	ChannelID discord.Snowflake
	MessageID discord.Snowflake
	Emoji     discord.ReactionEmoji
}

DMMessageReactionRemoveEmojiEvent indicates someone removed all discord.MessageReaction(s) of a specific core.Emoji from a core.Message in a Channel (requires the discord.GatewayIntentDirectMessageReactions)

type DMMessageReactionRemoveEvent

type DMMessageReactionRemoveEvent struct {
	*GenericDMMessageReactionEvent
}

DMMessageReactionRemoveEvent indicates that a core.User removed a discord.MessageReaction from a core.Message in a Channel (requires the discord.GatewayIntentDirectMessageReactions)

type DMMessageUpdateEvent

type DMMessageUpdateEvent struct {
	*GenericDMMessageEvent
	OldMessage *core.Message
}

DMMessageUpdateEvent is called upon editing a core.Message in a Channel (requires discord.GatewayIntentsDirectMessage)

type DisconnectedEvent

type DisconnectedEvent struct {
	*GenericEvent
}

DisconnectedEvent indicates disgo disconnected from the gateway.Gateway

type EmojiCreateEvent

type EmojiCreateEvent struct {
	*GenericEmojiEvent
}

EmojiCreateEvent indicates that a new core.Emoji got created in a core.Guild (requires discord.GatewayIntentGuildEmojisAndStickers)

type EmojiDeleteEvent

type EmojiDeleteEvent struct {
	*GenericEmojiEvent
}

EmojiDeleteEvent indicates that a core.Emoji got deleted in a core.Guild (requires discord.GatewayIntentGuildEmojisAndStickers)

type EmojiUpdateEvent

type EmojiUpdateEvent struct {
	*GenericEmojiEvent
	OldEmoji *core.Emoji
}

EmojiUpdateEvent indicates that a core.Emoji got updated in a core.Guild (requires discord.GatewayIntentGuildEmojisAndStickers)

type GenericDMChannelEvent

type GenericDMChannelEvent struct {
	*GenericEvent
	Channel   *core.DMChannel
	ChannelID discord.Snowflake
}

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

type GenericDMMessageEvent

type GenericDMMessageEvent struct {
	*GenericEvent
	MessageID discord.Snowflake
	Message   *core.Message
	ChannelID discord.Snowflake
}

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

func (GenericDMMessageEvent) Channel

func (e GenericDMMessageEvent) Channel() *core.DMChannel

Channel returns the Channel the GenericDMMessageEvent happened in

type GenericDMMessageReactionEvent

type GenericDMMessageReactionEvent struct {
	*GenericEvent
	UserID    discord.Snowflake
	ChannelID discord.Snowflake
	MessageID discord.Snowflake
	Emoji     discord.ReactionEmoji
}

GenericDMMessageReactionEvent is called upon receiving DMMessageReactionAddEvent or DMMessageReactionRemoveEvent (requires the discord.GatewayIntentDirectMessageReactions)

func (*GenericDMMessageReactionEvent) User

User returns the User who owns the discord.MessageReaction. This will only check cached users!

type GenericEmojiEvent

type GenericEmojiEvent struct {
	*GenericEvent
	GuildID discord.Snowflake
	Emoji   *core.Emoji
}

GenericEmojiEvent is called upon receiving EmojiCreateEvent, EmojiUpdateEvent or EmojiDeleteEvent (requires discord.GatewayIntentGuildEmojisAndStickers)

type GenericEvent

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

GenericEvent the base event structure

func NewGenericEvent

func NewGenericEvent(bot *core.Bot, sequenceNumber int) *GenericEvent

NewGenericEvent constructs a new GenericEvent with the provided Bot instance

func (GenericEvent) Bot

func (e GenericEvent) Bot() *core.Bot

func (GenericEvent) SequenceNumber

func (e GenericEvent) SequenceNumber() int

SequenceNumber returns the sequence number of the gateway event

type GenericGuildChannelEvent

type GenericGuildChannelEvent struct {
	*GenericEvent
	ChannelID discord.Snowflake
	Channel   core.GuildChannel
	GuildID   discord.Snowflake
}

GenericGuildChannelEvent is called upon receiving GuildChannelCreateEvent, GuildChannelUpdateEvent or GuildChannelDeleteEvent

func (GenericGuildChannelEvent) Guild

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

Guild returns the core.Guild the event happened in. This will only check cached guilds!

type GenericGuildEvent

type GenericGuildEvent struct {
	*GenericEvent
	GuildID discord.Snowflake
	Guild   *core.Guild
}

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

type GenericGuildInviteEvent

type GenericGuildInviteEvent struct {
	*GenericEvent
	GuildID   discord.Snowflake
	ChannelID discord.Snowflake
	Code      string
}

GenericGuildInviteEvent is called upon receiving GuildInviteCreateEvent or GuildInviteDeleteEvent (requires discord.GatewayIntentGuildInvites)

func (GenericGuildInviteEvent) Channel

Channel returns the Channel the GenericGuildInviteEvent happened in.

type GenericGuildMemberEvent

type GenericGuildMemberEvent struct {
	*GenericEvent
	GuildID discord.Snowflake
	Member  *core.Member
}

GenericGuildMemberEvent generic core.Member event

type GenericGuildMessageEvent

type GenericGuildMessageEvent struct {
	*GenericEvent
	MessageID discord.Snowflake
	Message   *core.Message
	ChannelID discord.Snowflake
	GuildID   discord.Snowflake
}

GenericGuildMessageEvent is called upon receiving GuildMessageCreateEvent, GuildMessageUpdateEvent or GuildMessageDeleteEvent

func (GenericGuildMessageEvent) Channel

Channel returns the core.DMChannel where the GenericGuildMessageEvent happened

func (GenericGuildMessageEvent) Guild

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

Guild returns the core.Guild the GenericGuildMessageEvent happened in. This will only check cached guilds!

type GenericGuildMessageReactionEvent

type GenericGuildMessageReactionEvent struct {
	*GenericEvent
	UserID    discord.Snowflake
	ChannelID discord.Snowflake
	MessageID discord.Snowflake
	GuildID   discord.Snowflake
	Emoji     discord.ReactionEmoji
}

GenericGuildMessageReactionEvent is called upon receiving GuildMessageReactionAddEvent or GuildMessageReactionRemoveEvent

func (*GenericGuildMessageReactionEvent) Member

func (*GenericGuildMessageReactionEvent) User

type GenericGuildScheduledEventEvent added in v0.6.1

type GenericGuildScheduledEventEvent struct {
	*GenericEvent
	GuildScheduledEvent *core.GuildScheduledEvent
}

type GenericGuildScheduledEventUserEvent added in v0.6.1

type GenericGuildScheduledEventUserEvent struct {
	*GenericEvent
	GuildScheduledEventID discord.Snowflake
	UserID                discord.Snowflake
	GuildID               discord.Snowflake
}

func (*GenericGuildScheduledEventUserEvent) GuildScheduledEvent added in v0.6.1

func (*GenericGuildScheduledEventUserEvent) Member added in v0.6.1

func (*GenericGuildScheduledEventUserEvent) User added in v0.6.1

type GenericGuildVoiceEvent

type GenericGuildVoiceEvent struct {
	*GenericEvent
	VoiceState *core.VoiceState
}

GenericGuildVoiceEvent is called upon receiving GuildVoiceJoinEvent, GuildVoiceMoveEvent, GuildVoiceLeaveEvent

type GenericIntegrationEvent

type GenericIntegrationEvent struct {
	*GenericEvent
	GuildID     discord.Snowflake
	Integration core.Integration
}

func (*GenericIntegrationEvent) Guild

func (e *GenericIntegrationEvent) Guild() *core.Guild

Guild returns the Guild this Integration was created in. This will only check cached guilds!

type GenericMessageEvent

type GenericMessageEvent struct {
	*GenericEvent
	MessageID discord.Snowflake
	Message   *core.Message
	ChannelID discord.Snowflake
	GuildID   *discord.Snowflake
}

GenericMessageEvent generic core.Message event

func (*GenericMessageEvent) Channel

Channel returns the core.Channel where the GenericMessageEvent happened

func (*GenericMessageEvent) Guild

func (e *GenericMessageEvent) Guild() *core.Guild

Guild returns the core.Guild where the GenericMessageEvent happened or nil if it happened in DMs

type GenericReactionEvent

type GenericReactionEvent struct {
	*GenericEvent
	UserID    discord.Snowflake
	ChannelID discord.Snowflake
	MessageID discord.Snowflake
	GuildID   *discord.Snowflake
	Emoji     discord.ReactionEmoji
}

GenericReactionEvent is called upon receiving MessageReactionAddEvent or MessageReactionRemoveEvent

func (*GenericReactionEvent) User

func (e *GenericReactionEvent) User() *core.User

type GenericRoleEvent

type GenericRoleEvent struct {
	*GenericEvent
	GuildID discord.Snowflake
	RoleID  discord.Snowflake
	Role    *core.Role
}

GenericRoleEvent generic core.Role event

type GenericStageInstanceEvent

type GenericStageInstanceEvent struct {
	*GenericEvent
	StageInstanceID discord.Snowflake
	StageInstance   *core.StageInstance
}

GenericStageInstanceEvent generic StageInstance event

type GenericStickerEvent

type GenericStickerEvent struct {
	*GenericEvent
	GuildID discord.Snowflake
	Sticker *core.Sticker
}

GenericStickerEvent is called upon receiving StickerCreateEvent, StickerUpdateEvent or StickerDeleteEvent (requires discord.GatewayIntentGuildEmojisAndStickers)

type GenericThreadEvent

type GenericThreadEvent struct {
	*GenericEvent
	Thread   core.GuildThread
	ThreadID discord.Snowflake
	GuildID  discord.Snowflake
	ParentID discord.Snowflake
}

type GenericThreadMemberEvent

type GenericThreadMemberEvent struct {
	*GenericEvent
	GuildID        discord.Snowflake
	ThreadID       discord.Snowflake
	ThreadMemberID discord.Snowflake
	ThreadMember   *core.ThreadMember
}

type GenericUserActivityEvent

type GenericUserActivityEvent struct {
	*GenericEvent
	UserID   discord.Snowflake
	GuildID  discord.Snowflake
	Activity discord.Activity
}

GenericUserActivityEvent generic Activity event

func (*GenericUserActivityEvent) Guild

func (g *GenericUserActivityEvent) Guild() *core.Guild

Guild returns the Guild that changed their Activity. This will only check cached guilds!

func (*GenericUserActivityEvent) Member

func (g *GenericUserActivityEvent) Member() *core.Member

Member returns the Member that changed their Activity. This will only check cached members!

func (*GenericUserActivityEvent) User

func (g *GenericUserActivityEvent) User() *core.User

User returns the User that changed their Activity. This will only check cached users!

type GenericUserEvent

type GenericUserEvent struct {
	*GenericEvent
	UserID discord.Snowflake
	User   *core.User
}

GenericUserEvent is called upon receiving UserUpdateEvent or UserTypingStartEvent

type GuildAvailableEvent

type GuildAvailableEvent struct {
	*GenericGuildEvent
}

GuildAvailableEvent is called when an unavailable core.Guild becomes available

type GuildBanEvent

type GuildBanEvent struct {
	*GenericEvent
	GuildID discord.Snowflake
	User    *core.User
}

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

type GuildChannelCreateEvent

type GuildChannelCreateEvent struct {
	*GenericGuildChannelEvent
}

GuildChannelCreateEvent indicates that a new Channel got created in a core.Guild

type GuildChannelDeleteEvent

type GuildChannelDeleteEvent struct {
	*GenericGuildChannelEvent
}

GuildChannelDeleteEvent indicates that a Channel got deleted in a core.Guild

type GuildChannelPinsUpdateEvent

type GuildChannelPinsUpdateEvent struct {
	*GenericEvent
	GuildID             discord.Snowflake
	ChannelID           discord.Snowflake
	NewLastPinTimestamp *discord.Time
	OldLastPinTimestamp *discord.Time
}

type GuildChannelUpdateEvent

type GuildChannelUpdateEvent struct {
	*GenericGuildChannelEvent
	OldChannel core.GuildChannel
}

GuildChannelUpdateEvent indicates that a Channel got updated in a core.Guild

type GuildIntegrationsUpdateEvent

type GuildIntegrationsUpdateEvent struct {
	*GenericEvent
	GuildID discord.Snowflake
}

type GuildInviteCreateEvent

type GuildInviteCreateEvent struct {
	*GenericGuildInviteEvent
	Invite *core.Invite
}

GuildInviteCreateEvent is called upon creation of a new core.Invite in a core.Guild (requires discord.GatewayIntentGuildInvites)

type GuildInviteDeleteEvent

type GuildInviteDeleteEvent struct {
	*GenericGuildInviteEvent
}

GuildInviteDeleteEvent is called upon deletion of a core.Invite in a core.Guild (requires discord.GatewayIntentGuildInvites)

type GuildJoinEvent

type GuildJoinEvent struct {
	*GenericGuildEvent
}

GuildJoinEvent is called when the bot joins a core.Guild

type GuildLeaveEvent

type GuildLeaveEvent struct {
	*GenericGuildEvent
}

GuildLeaveEvent is called when the bot leaves a core.Guild

type GuildMemberJoinEvent

type GuildMemberJoinEvent struct {
	*GenericGuildMemberEvent
}

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

type GuildMemberLeaveEvent

type GuildMemberLeaveEvent struct {
	*GenericEvent
	GuildID discord.Snowflake
	User    *core.User
	Member  *core.Member
}

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

type GuildMemberTypingStartEvent

type GuildMemberTypingStartEvent struct {
	*GenericEvent
	ChannelID discord.Snowflake
	UserID    discord.Snowflake
	GuildID   discord.Snowflake
	Timestamp time.Time
	Member    *core.Member
}

GuildMemberTypingStartEvent indicates that a core.Member started typing in a core.BaseGuildMessageChannel(requires discord.GatewayIntentGuildMessageTyping)

func (GuildMemberTypingStartEvent) Channel

Channel returns the core.BaseGuildMessageChannel the GuildMemberTypingStartEvent happened in

type GuildMemberUpdateEvent

type GuildMemberUpdateEvent struct {
	*GenericGuildMemberEvent
	OldMember *core.Member
}

GuildMemberUpdateEvent indicates that a core.Member updated

type GuildMessageCreateEvent

type GuildMessageCreateEvent struct {
	*GenericGuildMessageEvent
}

GuildMessageCreateEvent is called upon receiving a core.Message in a Channel

type GuildMessageDeleteEvent

type GuildMessageDeleteEvent struct {
	*GenericGuildMessageEvent
}

GuildMessageDeleteEvent is called upon deleting a core.Message in a Channel

type GuildMessageReactionAddEvent

type GuildMessageReactionAddEvent struct {
	*GenericGuildMessageReactionEvent
	Member *core.Member
}

GuildMessageReactionAddEvent indicates that a core.Member added a discord.ReactionEmoji to a core.Message in a core.GuildMessageChannel(requires the discord.GatewayIntentGuildMessageReactions)

type GuildMessageReactionRemoveAllEvent

type GuildMessageReactionRemoveAllEvent struct {
	*GenericEvent
	ChannelID discord.Snowflake
	MessageID discord.Snowflake
	GuildID   discord.Snowflake
}

GuildMessageReactionRemoveAllEvent indicates someone removed all discord.MessageReaction(s) from a core.Message in a Channel (requires the discord.GatewayIntentGuildMessageReactions)

type GuildMessageReactionRemoveEmojiEvent

type GuildMessageReactionRemoveEmojiEvent struct {
	*GenericEvent
	ChannelID discord.Snowflake
	MessageID discord.Snowflake
	GuildID   discord.Snowflake
	Emoji     discord.ReactionEmoji
}

GuildMessageReactionRemoveEmojiEvent indicates someone removed all discord.MessageReaction of a specific core.Emoji from a core.Message in a Channel (requires the discord.GatewayIntentGuildMessageReactions)

type GuildMessageReactionRemoveEvent

type GuildMessageReactionRemoveEvent struct {
	*GenericGuildMessageReactionEvent
}

GuildMessageReactionRemoveEvent indicates that a core.Member removed a discord.MessageReaction from a core.Message in a Channel (requires the discord.GatewayIntentGuildMessageReactions)

type GuildMessageUpdateEvent

type GuildMessageUpdateEvent struct {
	*GenericGuildMessageEvent
	OldMessage *core.Message
}

GuildMessageUpdateEvent is called upon editing a core.Message in a Channel

type GuildReadyEvent

type GuildReadyEvent struct {
	*GenericGuildEvent
}

GuildReadyEvent is called when a core.Guild becomes loaded for the first time

type GuildScheduledEventCreateEvent added in v0.6.1

type GuildScheduledEventCreateEvent struct {
	*GenericGuildScheduledEventEvent
}

type GuildScheduledEventDeleteEvent added in v0.6.1

type GuildScheduledEventDeleteEvent struct {
	*GenericGuildScheduledEventEvent
}

type GuildScheduledEventUpdateEvent added in v0.6.1

type GuildScheduledEventUpdateEvent struct {
	*GenericGuildScheduledEventEvent
	OldGuildScheduledEvent *core.GuildScheduledEvent
}

type GuildScheduledEventUserAddEvent added in v0.6.1

type GuildScheduledEventUserAddEvent struct {
	*GenericGuildScheduledEventUserEvent
}

type GuildScheduledEventUserRemoveEvent added in v0.6.1

type GuildScheduledEventUserRemoveEvent struct {
	*GenericGuildScheduledEventUserEvent
}

type GuildUnavailableEvent

type GuildUnavailableEvent struct {
	*GenericGuildEvent
}

GuildUnavailableEvent is called when an available core.Guild becomes unavailable

type GuildUnbanEvent

type GuildUnbanEvent struct {
	*GenericEvent
	GuildID discord.Snowflake
	User    *core.User
}

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

type GuildUpdateEvent

type GuildUpdateEvent struct {
	*GenericGuildEvent
	OldGuild *core.Guild
}

GuildUpdateEvent is called upon receiving core.Guild updates

type GuildVoiceJoinEvent

type GuildVoiceJoinEvent struct {
	*GenericGuildVoiceEvent
}

GuildVoiceJoinEvent indicates that a core.Member joined a core.Channel(requires core.GatewayIntentsGuildVoiceStates)

type GuildVoiceLeaveEvent

type GuildVoiceLeaveEvent struct {
	*GenericGuildVoiceEvent
	OldVoiceState *core.VoiceState
}

GuildVoiceLeaveEvent indicates that a core.Member left a core.Channel(requires core.GatewayIntentsGuildVoiceStates)

type GuildVoiceMoveEvent

type GuildVoiceMoveEvent struct {
	*GenericGuildVoiceEvent
	OldVoiceState *core.VoiceState
}

GuildVoiceMoveEvent indicates that a core.Member moved a core.Channel(requires core.GatewayIntentsGuildVoiceStates)

type GuildVoiceStateUpdateEvent

type GuildVoiceStateUpdateEvent struct {
	*GenericGuildVoiceEvent
	OldVoiceState *core.VoiceState
}

GuildVoiceStateUpdateEvent indicates that the core.VoiceState of a core.Member has updated(requires core.GatewayIntentsGuildVoiceStates)

type GuildsReadyEvent

type GuildsReadyEvent struct {
	*GenericEvent
	ShardID int
}

GuildsReadyEvent is called when all core.Guild(s) are loaded after logging in

type HTTPRequestEvent

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

type HeartbeatEvent

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

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

type IntegrationCreateEvent

type IntegrationCreateEvent struct {
	*GenericIntegrationEvent
}

IntegrationCreateEvent indicates that a new Integration was created in a Guild

type IntegrationDeleteEvent

type IntegrationDeleteEvent struct {
	*GenericEvent
	ID            discord.Snowflake
	GuildID       discord.Snowflake
	ApplicationID *discord.Snowflake
}

IntegrationDeleteEvent indicates that an Integration was deleted from a Guild

type IntegrationUpdateEvent

type IntegrationUpdateEvent struct {
	*GenericIntegrationEvent
}

IntegrationUpdateEvent indicates that an integration was updated in a Guild

type InteractionCreateEvent

type InteractionCreateEvent struct {
	*GenericEvent
	core.Interaction
}

type InvalidSessionEvent

type InvalidSessionEvent struct {
	*GenericEvent
	MayResume bool
}

type ListenerAdapter

type ListenerAdapter struct {
	// Other events
	OnHeartbeat   func(event *HeartbeatEvent)
	OnHTTPRequest func(event *HTTPRequestEvent)
	OnRaw         func(event *RawEvent)

	// Thread Events
	OnThreadCreate func(event *ThreadCreateEvent)
	OnThreadUpdate func(event *ThreadUpdateEvent)
	OnThreadDelete func(event *ThreadDeleteEvent)
	OnThreadShow   func(event *ThreadShowEvent)
	OnThreadHide   func(event *ThreadHideEvent)

	// ThreadMember Events
	OnThreadMemberAdd    func(event *ThreadMemberAddEvent)
	OnThreadMemberUpdate func(event *ThreadMemberUpdateEvent)
	OnThreadMemberRemove func(event *ThreadMemberRemoveEvent)

	// Channel Events
	OnGuildChannelCreate func(event *GuildChannelCreateEvent)
	OnGuildChannelUpdate func(event *GuildChannelUpdateEvent)
	OnGuildChannelDelete func(event *GuildChannelDeleteEvent)

	// DM Channel Events
	OnDMChannelCreate func(event *DMChannelCreateEvent)
	OnDMChannelUpdate func(event *DMChannelUpdateEvent)
	OnDMChannelDelete func(event *DMChannelDeleteEvent)

	// Channel Message Events
	OnDMMessageCreate func(event *DMMessageCreateEvent)
	OnDMMessageUpdate func(event *DMMessageUpdateEvent)
	OnDMMessageDelete func(event *DMMessageDeleteEvent)

	// Channel Reaction Events
	OnDMMessageReactionAdd         func(event *DMMessageReactionAddEvent)
	OnDMMessageReactionRemove      func(event *DMMessageReactionRemoveEvent)
	OnDMMessageReactionRemoveEmoji func(event *DMMessageReactionRemoveEmojiEvent)
	OnDMMessageReactionRemoveAll   func(event *DMMessageReactionRemoveAllEvent)

	// Emoji Events
	OnEmojiCreate func(event *EmojiCreateEvent)
	OnEmojiUpdate func(event *EmojiUpdateEvent)
	OnEmojiDelete func(event *EmojiDeleteEvent)

	// Sticker Events
	OnStickerCreate func(event *StickerCreateEvent)
	OnStickerUpdate func(event *StickerUpdateEvent)
	OnStickerDelete func(event *StickerDeleteEvent)

	// gateway status Events
	OnReady          func(event *ReadyEvent)
	OnResumed        func(event *ResumedEvent)
	OnInvalidSession func(event *InvalidSessionEvent)
	OnDisconnected   func(event *DisconnectedEvent)

	// Guild Events
	OnGuildJoin        func(event *GuildJoinEvent)
	OnGuildUpdate      func(event *GuildUpdateEvent)
	OnGuildLeave       func(event *GuildLeaveEvent)
	OnGuildAvailable   func(event *GuildAvailableEvent)
	OnGuildUnavailable func(event *GuildUnavailableEvent)
	OnGuildReady       func(event *GuildReadyEvent)
	OnGuildsReady      func(event *GuildsReadyEvent)
	OnGuildBan         func(event *GuildBanEvent)
	OnGuildUnban       func(event *GuildUnbanEvent)

	// Guild Invite Events
	OnGuildInviteCreate func(event *GuildInviteCreateEvent)
	OnGuildInviteDelete func(event *GuildInviteDeleteEvent)

	// Guild Member Events
	OnGuildMemberJoin   func(event *GuildMemberJoinEvent)
	OnGuildMemberUpdate func(event *GuildMemberUpdateEvent)
	OnGuildMemberLeave  func(event *GuildMemberLeaveEvent)

	// Guild Message Events
	OnGuildMessageCreate func(event *GuildMessageCreateEvent)
	OnGuildMessageUpdate func(event *GuildMessageUpdateEvent)
	OnGuildMessageDelete func(event *GuildMessageDeleteEvent)

	// Guild Message Reaction Events
	OnGuildMessageReactionAdd         func(event *GuildMessageReactionAddEvent)
	OnGuildMessageReactionRemove      func(event *GuildMessageReactionRemoveEvent)
	OnGuildMessageReactionRemoveEmoji func(event *GuildMessageReactionRemoveEmojiEvent)
	OnGuildMessageReactionRemoveAll   func(event *GuildMessageReactionRemoveAllEvent)

	// Guild Voice Events
	OnVoiceServerUpdate     func(event *VoiceServerUpdateEvent)
	OnGuildVoiceStateUpdate func(event *GuildVoiceStateUpdateEvent)
	OnGuildVoiceJoin        func(event *GuildVoiceJoinEvent)
	OnGuildVoiceMove        func(event *GuildVoiceMoveEvent)
	OnGuildVoiceLeave       func(event *GuildVoiceLeaveEvent)

	// Guild StageInstance Events
	OnStageInstanceCreate func(event *StageInstanceCreateEvent)
	OnStageInstanceUpdate func(event *StageInstanceUpdateEvent)
	OnStageInstanceDelete func(event *StageInstanceDeleteEvent)

	// Guild Role Events
	OnRoleCreate func(event *RoleCreateEvent)
	OnRoleUpdate func(event *RoleUpdateEvent)
	OnRoleDelete func(event *RoleDeleteEvent)

	// Guild Scheduled Events
	OnGuildScheduledEventCreate     func(event *GuildScheduledEventCreateEvent)
	OnGuildScheduledEventUpdate     func(event *GuildScheduledEventUpdateEvent)
	OnGuildScheduledEventDelete     func(event *GuildScheduledEventDeleteEvent)
	OnGuildScheduledEventUserAdd    func(event *GuildScheduledEventUserAddEvent)
	OnGuildScheduledEventUserRemove func(event *GuildScheduledEventUserRemoveEvent)

	// Interaction Events
	OnInteractionCreate                   func(event *InteractionCreateEvent)
	OnApplicationCommandInteractionCreate func(event *ApplicationCommandInteractionCreateEvent)
	OnSlashCommand                        func(event *SlashCommandEvent)
	OnUserCommand                         func(event *UserCommandEvent)
	OnMessageCommand                      func(event *MessageCommandEvent)
	OnComponentInteractionCreate          func(event *ComponentInteractionCreateEvent)
	OnButtonClick                         func(event *ButtonClickEvent)
	OnSelectMenuSubmit                    func(event *SelectMenuSubmitEvent)
	OnAutocomplete                        func(event *AutocompleteEvent)

	// Message Events
	OnMessageCreate func(event *MessageCreateEvent)
	OnMessageUpdate func(event *MessageUpdateEvent)
	OnMessageDelete func(event *MessageDeleteEvent)

	// Message Reaction Events
	OnMessageReactionAdd         func(event *MessageReactionAddEvent)
	OnMessageReactionRemove      func(event *MessageReactionRemoveEvent)
	OnMessageReactionRemoveEmoji func(event *MessageReactionRemoveEmojiEvent)
	OnMessageReactionRemoveAll   func(event *MessageReactionRemoveAllEvent)

	// Self Events
	OnSelfUpdate func(event *SelfUpdateEvent)

	// User Events
	OnUserUpdate      func(event *UserUpdateEvent)
	OnUserTyping      func(event *UserTypingStartEvent)
	OnGuildUserTyping func(event *GuildMemberTypingStartEvent)
	OnDMUserTyping    func(event *DMChannelUserTypingStartEvent)

	// User Activity Events
	OnUserActivityStart  func(event *UserActivityStartEvent)
	OnUserActivityUpdate func(event *UserActivityUpdateEvent)
	OnUserActivityStop   func(event *UserActivityStopEvent)

	OnUserStatusUpdate       func(event *UserStatusUpdateEvent)
	OnUserClientStatusUpdate func(event *UserClientStatusUpdateEvent)

	OnIntegrationCreate       func(event *IntegrationCreateEvent)
	OnIntegrationUpdate       func(event *IntegrationUpdateEvent)
	OnIntegrationDelete       func(event *IntegrationDeleteEvent)
	OnGuildIntegrationsUpdate func(event *GuildIntegrationsUpdateEvent)

	OnGuildWebhooksUpdate func(event *WebhooksUpdateEvent)
}

ListenerAdapter lets you override the handles for receiving events

func (ListenerAdapter) OnEvent

func (l ListenerAdapter) OnEvent(event core.Event)

OnEvent is getting called everytime we receive an event

type MessageCommandEvent

type MessageCommandEvent struct {
	*GenericEvent
	*core.MessageCommandInteraction
}

type MessageCreateEvent

type MessageCreateEvent struct {
	*GenericMessageEvent
}

MessageCreateEvent indicates that a core.Message got received

type MessageDeleteEvent

type MessageDeleteEvent struct {
	*GenericMessageEvent
}

MessageDeleteEvent indicates that a core.Message got deleted

type MessageReactionAddEvent

type MessageReactionAddEvent struct {
	*GenericReactionEvent
	Member *core.Member
}

MessageReactionAddEvent indicates that a core.User added a discord.MessageReaction to a core.Message in a core.Channel(this+++ requires the discord.GatewayIntentGuildMessageReactions and/or discord.GatewayIntentDirectMessageReactions)

type MessageReactionRemoveAllEvent

type MessageReactionRemoveAllEvent struct {
	*GenericEvent
	ChannelID discord.Snowflake
	MessageID discord.Snowflake
	GuildID   *discord.Snowflake
}

MessageReactionRemoveAllEvent indicates someone removed all discord.MessageReaction(s) from a core.Message in a core.Channel(requires the discord.GatewayIntentGuildMessageReactions and/or discord.GatewayIntentDirectMessageReactions)

type MessageReactionRemoveEmojiEvent

type MessageReactionRemoveEmojiEvent struct {
	*GenericEvent
	ChannelID discord.Snowflake
	MessageID discord.Snowflake
	GuildID   *discord.Snowflake
	Emoji     discord.ReactionEmoji
}

MessageReactionRemoveEmojiEvent indicates someone removed all discord.MessageReaction of a specific core.Emoji from a core.Message in a core.Channel(requires the discord.GatewayIntentGuildMessageReactions and/or discord.GatewayIntentDirectMessageReactions)

type MessageReactionRemoveEvent

type MessageReactionRemoveEvent struct {
	*GenericReactionEvent
}

MessageReactionRemoveEvent indicates that a core.User removed a discord.MessageReaction from a core.Message in a core.GetChannel(requires the discord.GatewayIntentGuildMessageReactions and/or discord.GatewayIntentDirectMessageReactions)

type MessageUpdateEvent

type MessageUpdateEvent struct {
	*GenericMessageEvent
	OldMessage *core.Message
}

MessageUpdateEvent indicates that a core.Message got update

type RawEvent

type RawEvent struct {
	*GenericEvent
	Type       discord.GatewayEventType
	RawPayload json.RawMessage
}

RawEvent is called for any discord.GatewayEventType we receive if enabled in the bot.Config

type ReadyEvent

type ReadyEvent struct {
	*GenericEvent
	discord.GatewayEventReady
}

ReadyEvent indicates we received the ReadyEvent from the gateway.Gateway

type ResumedEvent

type ResumedEvent struct {
	*GenericEvent
}

ResumedEvent indicates disgo resumed the gateway.Gateway

type RoleCreateEvent

type RoleCreateEvent struct {
	*GenericRoleEvent
}

RoleCreateEvent indicates that a core.Role got created

type RoleDeleteEvent

type RoleDeleteEvent struct {
	*GenericRoleEvent
}

RoleDeleteEvent indicates that a core.Role got deleted

type RoleUpdateEvent

type RoleUpdateEvent struct {
	*GenericRoleEvent
	OldRole *core.Role
}

RoleUpdateEvent indicates that a core.Role got updated

type SelectMenuSubmitEvent

type SelectMenuSubmitEvent struct {
	*GenericEvent
	*core.SelectMenuInteraction
}

SelectMenuSubmitEvent indicates that a discord.SelectMenuComponent was submitted

type SelfUpdateEvent

type SelfUpdateEvent struct {
	*GenericEvent
	SelfUser    *core.SelfUser
	OldSelfUser *core.SelfUser
}

SelfUpdateEvent is called when something about this core.User updates

type SlashCommandEvent

type SlashCommandEvent struct {
	*GenericEvent
	*core.SlashCommandInteraction
}

SlashCommandEvent indicates that a slash discord.ApplicationCommand was run

type StageInstanceCreateEvent

type StageInstanceCreateEvent struct {
	*GenericStageInstanceEvent
}

StageInstanceCreateEvent indicates that a StageInstance got created

type StageInstanceDeleteEvent

type StageInstanceDeleteEvent struct {
	*GenericStageInstanceEvent
}

StageInstanceDeleteEvent indicates that a StageInstance got deleted

type StageInstanceUpdateEvent

type StageInstanceUpdateEvent struct {
	*GenericStageInstanceEvent
	OldStageInstance *core.StageInstance
}

StageInstanceUpdateEvent indicates that a StageInstance got updated

type StickerCreateEvent

type StickerCreateEvent struct {
	*GenericStickerEvent
}

StickerCreateEvent indicates that a new core.Sticker got created in a core.Guild (requires discord.GatewayIntentGuildEmojisAndStickers)

type StickerDeleteEvent

type StickerDeleteEvent struct {
	*GenericStickerEvent
}

StickerDeleteEvent indicates that a core.Sticker got deleted in a core.Guild (requires discord.GatewayIntentGuildEmojisAndStickers)

type StickerUpdateEvent

type StickerUpdateEvent struct {
	*GenericStickerEvent
	OldSticker *core.Sticker
}

StickerUpdateEvent indicates that a core.Sticker got updated in a core.Guild (requires discord.GatewayIntentGuildEmojisAndStickers)

type ThreadCreateEvent

type ThreadCreateEvent struct {
	*GenericThreadEvent
}

type ThreadDeleteEvent

type ThreadDeleteEvent struct {
	*GenericThreadEvent
}

type ThreadHideEvent

type ThreadHideEvent struct {
	*GenericThreadEvent
}

type ThreadMemberAddEvent

type ThreadMemberAddEvent struct {
	*GenericThreadMemberEvent
}

type ThreadMemberRemoveEvent

type ThreadMemberRemoveEvent struct {
	*GenericThreadMemberEvent
}

type ThreadMemberUpdateEvent

type ThreadMemberUpdateEvent struct {
	*GenericThreadMemberEvent
	OldThreadMember *core.ThreadMember
}

type ThreadShowEvent

type ThreadShowEvent struct {
	*GenericThreadEvent
}

type ThreadUpdateEvent

type ThreadUpdateEvent struct {
	*GenericThreadEvent
	OldThread core.GuildThread
}

type UserActivityStartEvent

type UserActivityStartEvent struct {
	*GenericUserActivityEvent
}

UserActivityStartEvent indicates that a User started an Activity

type UserActivityStopEvent

type UserActivityStopEvent struct {
	*GenericUserActivityEvent
}

UserActivityStopEvent indicates that a User stopped an Activity

type UserActivityUpdateEvent

type UserActivityUpdateEvent struct {
	*GenericUserActivityEvent
	OldActivity discord.Activity
}

UserActivityUpdateEvent indicates that a User updated their Activity

type UserClientStatusUpdateEvent

type UserClientStatusUpdateEvent struct {
	*GenericEvent
	UserID          discord.Snowflake
	OldClientStatus *discord.ClientStatus
	ClientStatus    discord.ClientStatus
}

UserClientStatusUpdateEvent generic client-specific Status event

func (*UserClientStatusUpdateEvent) User

User returns the User that changed their Status. This will only check cached users!

type UserCommandEvent

type UserCommandEvent struct {
	*GenericEvent
	*core.UserCommandInteraction
}

type UserStatusUpdateEvent

type UserStatusUpdateEvent struct {
	*GenericEvent
	UserID    discord.Snowflake
	OldStatus discord.OnlineStatus
	Status    discord.OnlineStatus
}

UserStatusUpdateEvent generic Status event

func (*UserStatusUpdateEvent) User

func (g *UserStatusUpdateEvent) User() *core.User

User returns the User that changed their Status. This will only check cached users!

type UserTypingStartEvent

type UserTypingStartEvent struct {
	*GenericEvent
	ChannelID discord.Snowflake
	GuildID   *discord.Snowflake
	UserID    discord.Snowflake
	Timestamp time.Time
}

UserTypingStartEvent indicates that a core.User started typing in a core.DMChannel or core.MessageChanel(requires the discord.GatewayIntentDirectMessageTyping and/or discord.GatewayIntentGuildMessageTyping)

func (*UserTypingStartEvent) Channel

Channel returns the core.GetChannel the core.User started typing in

type UserUpdateEvent

type UserUpdateEvent struct {
	*GenericUserEvent
	OldUser *core.User
}

UserUpdateEvent indicates that a core.User updated

type VoiceServerUpdateEvent

type VoiceServerUpdateEvent struct {
	*GenericEvent
	VoiceServerUpdate discord.VoiceServerUpdate
}

type WebhooksUpdateEvent

type WebhooksUpdateEvent struct {
	*GenericEvent
	GuildId   discord.Snowflake
	ChannelID discord.Snowflake
}

func (*WebhooksUpdateEvent) Channel

func (*WebhooksUpdateEvent) Guild

func (e *WebhooksUpdateEvent) Guild() *core.Guild

Guild returns the Guild the webhook was updated in. This will only check cached guilds!

Jump to

Keyboard shortcuts

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