Documentation
¶
Index ¶
- type DMMessageDeleteEvent
- type DMMessageReceivedEvent
- type DMMessageUpdateEvent
- type GenericCategoryEvent
- type GenericChannelEvent
- type GenericDMChannelEvent
- type GenericDMEvent
- type GenericDMMessageEvent
- type GenericGuildEvent
- type GenericGuildMemberEvent
- type GenericGuildMessageEvent
- type GenericGuildRoleEvent
- type GenericInteractionEvent
- func (e GenericInteractionEvent) DMChannel() *api.DMChannel
- func (e GenericInteractionEvent) Guild() *api.Guild
- func (e GenericInteractionEvent) GuildChannel() *api.GuildChannel
- func (e GenericInteractionEvent) MessageChannel() *api.MessageChannel
- func (e GenericInteractionEvent) TextChannel() *api.TextChannel
- type GenericMessageChannelEvent
- type GenericMessageEvent
- type GenericStoreChannelEvent
- type GenericTextChannelEvent
- type GenericVoiceChannelEvent
- type GuildAvailableEvent
- type GuildJoinEvent
- type GuildLeaveEvent
- type GuildMemberJoinEvent
- type GuildMemberLeaveEvent
- type GuildMemberUpdateEvent
- type GuildMessageDeleteEvent
- type GuildMessageReceivedEvent
- type GuildMessageUpdateEvent
- type GuildRoleCreateEvent
- type GuildRoleDeleteEvent
- type GuildRoleUpdateEvent
- type GuildUnavailableEvent
- type GuildUpdateEvent
- type ListenerAdapter
- type MessageDeleteEvent
- type MessageReceivedEvent
- type MessageUpdateEvent
- type Option
- func (o Option) Bool() bool
- func (o Option) Category() *api.Category
- func (o Option) Channel() *api.Channel
- func (o Option) GuildChannel() *api.GuildChannel
- func (o Option) Member() *api.Member
- func (o Option) MessageChannel() *api.MessageChannel
- func (o Option) Role() *api.Role
- func (o Option) Snowflake() api.Snowflake
- func (o Option) StoreChannel() *api.StoreChannel
- func (o Option) String() string
- func (o Option) TextChannel() *api.TextChannel
- func (o Option) User() *api.User
- func (o Option) VoiceChannel() *api.VoiceChannel
- type ReadyEvent
- type SlashCommandEvent
- func (e SlashCommandEvent) CommandPath() string
- func (e SlashCommandEvent) OptionByName(name string) *Option
- func (e SlashCommandEvent) OptionsByName(name string) []*Option
- func (e SlashCommandEvent) OptionsByType(optionType api.SlashCommandOptionType) []*Option
- func (e *SlashCommandEvent) Reply(response api.InteractionResponse) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type DMMessageDeleteEvent ¶
type DMMessageDeleteEvent struct {
GenericDMMessageEvent
}
DMMessageDeleteEvent called upon deleting a api.Message in a api.DMChannel
type DMMessageReceivedEvent ¶
type DMMessageReceivedEvent struct {
GenericDMMessageEvent
Message *api.Message
}
DMMessageReceivedEvent called upon receiving a api.Message in a api.DMChannel
type DMMessageUpdateEvent ¶
type DMMessageUpdateEvent struct {
GenericDMMessageEvent
Message *api.Message
}
DMMessageUpdateEvent called upon editing a api.Message in a api.DMChannel
type GenericCategoryEvent ¶
type GenericCategoryEvent struct {
GenericChannelEvent
}
GenericCategoryEvent is called upon receiving an event in a api.Category
func (GenericCategoryEvent) Category ¶
func (e GenericCategoryEvent) Category() *api.Category
Category returns the api.Category from the api.Cache
type GenericChannelEvent ¶
GenericChannelEvent is called upon receiving an event in a api.Channel
func (GenericChannelEvent) Channel ¶
func (e GenericChannelEvent) Channel() *api.Channel
Channel returns the api.Channel from the api.Cache
type GenericDMChannelEvent ¶
type GenericDMChannelEvent struct {
GenericChannelEvent
}
GenericDMChannelEvent is called upon receiving an event in a api.DMChannel
func (GenericDMChannelEvent) DMChannel ¶
func (e GenericDMChannelEvent) DMChannel() *api.DMChannel
DMChannel returns the api.DMChannel from the api.Cache
type GenericDMEvent ¶
GenericDMEvent is a generic dm channel event
func (GenericDMEvent) DMChannel ¶
func (e GenericDMEvent) DMChannel() *api.DMChannel
DMChannel returns the api.DMChannel from the api.Cache
func (GenericDMEvent) User ¶
func (e GenericDMEvent) User() *api.DMChannel
User gets the user from the api.Cache
type GenericDMMessageEvent ¶
type GenericDMMessageEvent struct {
GenericDMEvent
GenericMessageEvent
}
GenericDMMessageEvent generic api.DMChannel api.Message api.Event
type GenericGuildEvent ¶
GenericGuildEvent generic api.Guild api.Event
func (GenericGuildEvent) Guild ¶
func (e GenericGuildEvent) Guild() *api.Guild
Guild returns the api.Guild from the api.Cache
type GenericGuildMemberEvent ¶
type GenericGuildMemberEvent struct {
GenericGuildEvent
UserID api.Snowflake
}
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 {
GenericGuildEvent
GenericMessageEvent
}
GenericGuildMessageEvent indicates that we received a api.Message api.Event in a api.Guild
type GenericGuildRoleEvent ¶
type GenericGuildRoleEvent struct {
GenericGuildEvent
Role *api.Role
RoleID api.Snowflake
}
GenericGuildRoleEvent generic api.Role event
type GenericInteractionEvent ¶
type GenericInteractionEvent struct {
api.Event
Interaction api.Interaction
}
GenericInteractionEvent generic api.Interaction event
func (GenericInteractionEvent) DMChannel ¶
func (e GenericInteractionEvent) DMChannel() *api.DMChannel
DMChannel returns the api.DMChannel from the api.Cache
func (GenericInteractionEvent) Guild ¶
func (e GenericInteractionEvent) Guild() *api.Guild
Guild returns the api.Guild from the api.Cache
func (GenericInteractionEvent) GuildChannel ¶
func (e GenericInteractionEvent) GuildChannel() *api.GuildChannel
GuildChannel returns the api.GuildChannel from the api.Cache
func (GenericInteractionEvent) MessageChannel ¶
func (e GenericInteractionEvent) MessageChannel() *api.MessageChannel
MessageChannel returns the api.MessageChannel from the api.Cache
func (GenericInteractionEvent) TextChannel ¶
func (e GenericInteractionEvent) TextChannel() *api.TextChannel
TextChannel returns the api.TextChannel from the api.Cache
type GenericMessageChannelEvent ¶
type GenericMessageChannelEvent struct {
GenericChannelEvent
}
GenericMessageChannelEvent is called upon receiving an event in a api.MessageChannel
func (GenericMessageChannelEvent) MessageChannel ¶
func (e GenericMessageChannelEvent) MessageChannel() *api.MessageChannel
MessageChannel returns the api.MessageChannel from the api.Cache
type GenericMessageEvent ¶
type GenericMessageEvent struct {
api.Event
MessageID api.Snowflake
MessageChannelID api.Snowflake
}
GenericMessageEvent generic api.Message event
func (*GenericMessageEvent) MessageChannel ¶
func (e *GenericMessageEvent) MessageChannel() *api.MessageChannel
MessageChannel returns the api.MessageChannel where this api.message got received
type GenericStoreChannelEvent ¶
type GenericStoreChannelEvent struct {
GenericChannelEvent
}
GenericStoreChannelEvent is called upon receiving an event in a api.StoreChannel
func (GenericStoreChannelEvent) StoreChannel ¶
func (e GenericStoreChannelEvent) StoreChannel() *api.StoreChannel
StoreChannel returns the api.StoreChannel from the api.Cache
type GenericTextChannelEvent ¶
type GenericTextChannelEvent struct {
GenericChannelEvent
}
GenericTextChannelEvent is called upon receiving an event in a api.TextChannel
func (GenericTextChannelEvent) TextChannel ¶
func (e GenericTextChannelEvent) TextChannel() *api.TextChannel
TextChannel returns the api.TextChannel from the api.Cache
type GenericVoiceChannelEvent ¶
type GenericVoiceChannelEvent struct {
GenericChannelEvent
}
GenericVoiceChannelEvent is called upon receiving an event in a api.VoiceChannel
func (GenericVoiceChannelEvent) VoiceChannel ¶
func (e GenericVoiceChannelEvent) VoiceChannel() *api.VoiceChannel
VoiceChannel returns the api.VoiceChannel from the api.Cache
type GuildAvailableEvent ¶
type GuildAvailableEvent struct {
GenericGuildEvent
Guild *api.Guild
}
GuildAvailableEvent called when an unavailable api.Guild becomes available
type GuildJoinEvent ¶
type GuildJoinEvent struct {
GenericGuildEvent
Guild *api.Guild
}
GuildJoinEvent called when the bot joins a api.Guild
type GuildLeaveEvent ¶
type GuildLeaveEvent struct {
GenericGuildEvent
Guild *api.Guild
}
GuildLeaveEvent called when the bot leaves a api.Guild
type GuildMemberJoinEvent ¶
type GuildMemberJoinEvent struct {
GenericGuildMemberEvent
Member *api.Member
}
GuildMemberJoinEvent indicates that a api.Member joined the api.Guild
type GuildMemberLeaveEvent ¶
type GuildMemberLeaveEvent struct {
GenericGuildMemberEvent
Member *api.Member
}
GuildMemberLeaveEvent indicates that a api.Member left the api.Guild
type GuildMemberUpdateEvent ¶
type GuildMemberUpdateEvent struct {
GenericGuildMemberEvent
OldMember *api.Member
NewMember *api.Member
}
GuildMemberUpdateEvent indicates that a api.Member updated
type GuildMessageDeleteEvent ¶
type GuildMessageDeleteEvent struct {
GenericGuildMessageEvent
Message *api.Message
}
GuildMessageDeleteEvent indicates that a api.Message was deleted in a api.Guild
type GuildMessageReceivedEvent ¶
type GuildMessageReceivedEvent struct {
GenericGuildMessageEvent
Message api.Message
}
GuildMessageReceivedEvent indicates that we received a api.Message in a api.Guild
type GuildMessageUpdateEvent ¶
type GuildMessageUpdateEvent struct {
GenericGuildMessageEvent
Message api.Message
}
GuildMessageUpdateEvent indicates that a api.Message was updated in a api.Guild
type GuildRoleCreateEvent ¶
type GuildRoleCreateEvent struct {
GenericGuildEvent
}
GuildRoleCreateEvent indicates that a api.Role got created
type GuildRoleDeleteEvent ¶
type GuildRoleDeleteEvent struct {
GenericGuildEvent
}
GuildRoleDeleteEvent indicates that a api.Role got deleted
type GuildRoleUpdateEvent ¶
type GuildRoleUpdateEvent struct {
GenericGuildEvent
OldRole *api.Role
}
GuildRoleUpdateEvent indicates that a api.Role got updated
type GuildUnavailableEvent ¶
type GuildUnavailableEvent struct {
}
GuildUnavailableEvent called when an available api.Guild becomes unavailable
type GuildUpdateEvent ¶
type GuildUpdateEvent struct {
GenericGuildEvent
Guild *api.Guild
OldGuild *api.Guild
}
GuildUpdateEvent called upon receiving api.Guild updates
type ListenerAdapter ¶
type ListenerAdapter struct {
OnGenericEvent func(*api.GenericEvent)
// Guild Events
OnGenericGuildEvent func(*GenericGuildEvent)
OnGuildJoin func(*GuildJoinEvent)
OnGuildUpdate func(*GuildUpdateEvent)
OnGuildLeave func(*GuildLeaveEvent)
OnGuildAvailable func(*GuildAvailableEvent)
// Guild Role Events
OnGenericGuildRole func(*GenericGuildRoleEvent)
OnGuildRoleCreate func(*GuildRoleCreateEvent)
OnGuildRoleUpdate func(*GuildRoleUpdateEvent)
OnGuildRoleDelete func(*GuildRoleDeleteEvent)
// Message Events
OnMessageReceived func(*MessageReceivedEvent)
OnGuildMessageReceived func(*GuildMessageReceivedEvent)
// Interaction Events
OnGenericInteraction func(*GenericInteractionEvent)
OnSlashCommand func(*SlashCommandEvent)
}
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 MessageDeleteEvent ¶
type MessageDeleteEvent struct {
GenericMessageEvent
Message api.Message
}
MessageDeleteEvent indicates a api.Message got deleted
type MessageReceivedEvent ¶
type MessageReceivedEvent struct {
GenericMessageEvent
Message api.Message
}
MessageReceivedEvent indicates a api.Message got received
type MessageUpdateEvent ¶
type MessageUpdateEvent struct {
GenericMessageEvent
Message api.Message
}
MessageUpdateEvent indicates a api.Message got update
type Option ¶
type Option struct {
Resolved *api.Resolved
Name string
Type api.SlashCommandOptionType
Value interface{}
}
Option holds info about an Option.Value
func (Option) GuildChannel ¶
func (o Option) GuildChannel() *api.GuildChannel
GuildChannel returns the Option.Value as api.GuildChannel
func (Option) MessageChannel ¶
func (o Option) MessageChannel() *api.MessageChannel
MessageChannel returns the Option.Value as api.MessageChannel
func (Option) StoreChannel ¶
func (o Option) StoreChannel() *api.StoreChannel
StoreChannel returns the Option.Value as api.StoreChannel
func (Option) TextChannel ¶
func (o Option) TextChannel() *api.TextChannel
TextChannel returns the Option.Value as api.TextChannel
func (Option) VoiceChannel ¶
func (o Option) VoiceChannel() *api.VoiceChannel
VoiceChannel returns the Option.Value as api.VoiceChannel
type ReadyEvent ¶
type ReadyEvent struct {
api.Event
api.ReadyEventData
}
ReadyEvent indicates we received the ReadyEvent from the api.Gateway
type SlashCommandEvent ¶
type SlashCommandEvent struct {
GenericInteractionEvent
ResponseChannel chan interface{}
FromWebhook bool
CommandID api.Snowflake
Name string
SubCommandName *string
SubCommandGroup *string
Options []*Option
Replied bool
}
SlashCommandEvent indicates a slash api.SlashCommand was ran in a api.Guild
func (SlashCommandEvent) CommandPath ¶
func (e SlashCommandEvent) CommandPath() string
CommandPath returns the api.SlashCommand path
func (SlashCommandEvent) OptionByName ¶
func (e SlashCommandEvent) OptionByName(name string) *Option
OptionByName returns an Option by name
func (SlashCommandEvent) OptionsByName ¶
func (e SlashCommandEvent) OptionsByName(name string) []*Option
OptionsByName returns Option(s) by name
func (SlashCommandEvent) OptionsByType ¶
func (e SlashCommandEvent) OptionsByType(optionType api.SlashCommandOptionType) []*Option
OptionsByType returns Option(s) by api.SlashCommandOptionType
func (*SlashCommandEvent) Reply ¶
func (e *SlashCommandEvent) Reply(response api.InteractionResponse) error
Reply replies to the api.Interaction with the provided api.InteractionResponse