Documentation
¶
Overview ¶
Copyright (C) 2022-2023 sabafly
This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with this program. If not, see <https://www.gnu.org/licenses/>.
Index ¶
- type AutocompleteHandler
- type Check
- type Command
- type CommandHandler
- type Component
- type ComponentHandler
- type Event
- type Generics
- type GenericsHandler
- type Handler
- func (h *Handler) AddCommands(commands ...Command)
- func (h *Handler) AddComponent(component Component) func()
- func (h *Handler) AddComponents(components ...Component)
- func (h *Handler) AddEvent(events ...Event)
- func (h *Handler) AddExclude(ids ...snowflake.ID)
- func (h *Handler) AddMessage(message Message) func()
- func (h *Handler) AddMessageDelete(messageDelete MessageDelete) func()
- func (h *Handler) AddMessageDeletes(messageDeletes ...MessageDelete)
- func (h *Handler) AddMessageUpdate(messageUpdate MessageUpdate) func()
- func (h *Handler) AddMessageUpdates(messageUpdates ...MessageUpdate)
- func (h *Handler) AddMessages(messages ...Message)
- func (h *Handler) AddModals(modals ...Modal)
- func (h *Handler) AddReady(ready func(*events.Ready))
- func (h *Handler) OnEvent(event bot.Event)
- func (h *Handler) SyncCommands(client bot.Client, guildIDs ...snowflake.ID)
- type Message
- type MessageDelete
- type MessageDeleteHandler
- type MessageHandler
- type MessageUpdate
- type MessageUpdateHandler
- type Modal
- type ModalHandler
- type RawHandler
- type StaticHandler
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AutocompleteHandler ¶
type AutocompleteHandler func(event *events.AutocompleteInteractionCreate) error
type Command ¶
type Command struct { Create discord.ApplicationCommandCreate Check Check[*events.ApplicationCommandInteractionCreate] Checks map[string]Check[*events.ApplicationCommandInteractionCreate] AutocompleteCheck Check[*events.AutocompleteInteractionCreate] AutocompleteChecks map[string]Check[*events.AutocompleteInteractionCreate] CommandHandlers map[string]CommandHandler AutocompleteHandlers map[string]AutocompleteHandler DevOnly bool }
type CommandHandler ¶
type CommandHandler func(event *events.ApplicationCommandInteractionCreate) error
type Component ¶
type Component struct { Name string Check Check[*events.ComponentInteractionCreate] Checks map[string]Check[*events.ComponentInteractionCreate] Handler map[string]ComponentHandler }
type ComponentHandler ¶
type ComponentHandler func(event *events.ComponentInteractionCreate) error
type Generics ¶ added in v2.4.1
type Generics[T any] struct { ID *uuid.UUID Check Check[*T] Handler GenericsHandler[T] }
type GenericsHandler ¶ added in v2.4.1
type Handler ¶
type Handler struct { Logger log.Logger Commands map[string]Command Components map[string]Component Modals map[string]Modal Message map[uuid.UUID]Message MessageUpdate map[uuid.UUID]MessageUpdate MessageDelete map[uuid.UUID]MessageDelete Ready []func(*events.Ready) MemberJoin genericsList[events.GuildMemberJoin] MemberLeave genericsList[events.GuildMemberLeave] MemberUpdate genericsList[events.GuildMemberUpdate] MessageReactionAdd genericsList[events.GuildMessageReactionAdd] MessageReactionRemove genericsList[events.GuildMessageReactionRemove] MessageReactionRemoveAll genericsList[events.GuildMessageReactionRemoveAll] MessageReactionRemoveEmoji genericsList[events.GuildMessageReactionRemoveEmoji] Event []Event Static StaticHandler ExcludeID map[snowflake.ID]struct{} DevGuildID []snowflake.ID IsDebug bool ASync bool IsLogEvent bool }
func (*Handler) AddCommands ¶
func (*Handler) AddComponent ¶
func (*Handler) AddComponents ¶
func (*Handler) AddExclude ¶
func (h *Handler) AddExclude(ids ...snowflake.ID)
func (*Handler) AddMessage ¶
func (*Handler) AddMessageDelete ¶ added in v2.4.0
func (h *Handler) AddMessageDelete(messageDelete MessageDelete) func()
func (*Handler) AddMessageDeletes ¶ added in v2.4.0
func (h *Handler) AddMessageDeletes(messageDeletes ...MessageDelete)
func (*Handler) AddMessageUpdate ¶ added in v2.4.0
func (h *Handler) AddMessageUpdate(messageUpdate MessageUpdate) func()
func (*Handler) AddMessageUpdates ¶ added in v2.4.0
func (h *Handler) AddMessageUpdates(messageUpdates ...MessageUpdate)
func (*Handler) AddMessages ¶ added in v2.1.0
func (*Handler) SyncCommands ¶
type Message ¶
type Message struct { UUID *uuid.UUID ChannelID *snowflake.ID AuthorID *snowflake.ID Check Check[*events.GuildMessageCreate] Handler MessageHandler }
type MessageDelete ¶ added in v2.4.0
type MessageDelete struct { UUID *uuid.UUID ChannelID *snowflake.ID AuthorID *snowflake.ID Check Check[*events.GuildMessageDelete] Handler MessageDeleteHandler }
type MessageDeleteHandler ¶ added in v2.4.0
type MessageDeleteHandler func(event *events.GuildMessageDelete) error
type MessageHandler ¶
type MessageHandler func(event *events.GuildMessageCreate) error
type MessageUpdate ¶ added in v2.4.0
type MessageUpdate struct { UUID *uuid.UUID ChannelID *snowflake.ID AuthorID *snowflake.ID Check Check[*events.GuildMessageUpdate] Handler MessageUpdateHandler }
type MessageUpdateHandler ¶ added in v2.4.0
type MessageUpdateHandler func(event *events.GuildMessageUpdate) error
type Modal ¶
type Modal struct { Name string Check Check[*events.ModalSubmitInteractionCreate] Checks map[string]Check[*events.ModalSubmitInteractionCreate] Handler map[string]ModalHandler }
type ModalHandler ¶
type ModalHandler func(event *events.ModalSubmitInteractionCreate) error
type RawHandler ¶ added in v2.4.0
type StaticHandler ¶ added in v2.4.0
type StaticHandler struct { Message []Message MessageUpdate []MessageUpdate MessageDelete []MessageDelete }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.