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 GuildMemberJoinHandler
- type GuildMemberLeaveHandler
- type Handler
- func (h *Handler) AddCommands(commands ...Command)
- func (h *Handler) AddComponent(component Component) func()
- func (h *Handler) AddComponents(components ...Component)
- func (h *Handler) AddExclude(ids ...snowflake.ID)
- func (h *Handler) AddMemberJoin(memberJoin MemberJoin) func()
- func (h *Handler) AddMemberJoins(memberJoins ...MemberJoin)
- func (h *Handler) AddMemberLeave(memberLeave MemberLeave) func()
- func (h *Handler) AddMemberLeaves(memberLeaves ...MemberLeave)
- func (h *Handler) AddMessage(message Message) func()
- 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 MemberJoin
- type MemberLeave
- type Message
- type MessageHandler
- type Modal
- type ModalHandler
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] AutocompleteCheck 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] Handler map[string]ComponentHandler }
type ComponentHandler ¶
type ComponentHandler func(event *events.ComponentInteractionCreate) error
type GuildMemberJoinHandler ¶
type GuildMemberJoinHandler func(event *events.GuildMemberJoin) error
type GuildMemberLeaveHandler ¶
type GuildMemberLeaveHandler func(event *events.GuildMemberLeave) error
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 Ready []func(*events.Ready) MemberJoin map[uuid.UUID]MemberJoin MemberLeave map[uuid.UUID]MemberLeave ExcludeID map[snowflake.ID]struct{} DevGuildID []snowflake.ID IsDebug bool }
func (*Handler) AddCommands ¶
func (*Handler) AddComponent ¶
func (*Handler) AddComponents ¶
func (*Handler) AddExclude ¶
func (h *Handler) AddExclude(ids ...snowflake.ID)
func (*Handler) AddMemberJoin ¶
func (h *Handler) AddMemberJoin(memberJoin MemberJoin) func()
func (*Handler) AddMemberJoins ¶
func (h *Handler) AddMemberJoins(memberJoins ...MemberJoin)
func (*Handler) AddMemberLeave ¶
func (h *Handler) AddMemberLeave(memberLeave MemberLeave) func()
func (*Handler) AddMemberLeaves ¶
func (h *Handler) AddMemberLeaves(memberLeaves ...MemberLeave)
func (*Handler) AddMessage ¶
func (*Handler) SyncCommands ¶
type MemberJoin ¶
type MemberJoin struct { UUID uuid.UUID Check Check[*events.GuildMemberJoin] Handler GuildMemberJoinHandler }
type MemberLeave ¶
type MemberLeave struct { UUID uuid.UUID Check Check[*events.GuildMemberLeave] Handler GuildMemberLeaveHandler }
type Message ¶
type Message struct { UUID uuid.UUID ChannelID snowflake.ID AuthorID *snowflake.ID Check Check[*events.MessageCreate] Handler MessageHandler }
type MessageHandler ¶
type MessageHandler func(event *events.MessageCreate) error
type Modal ¶
type Modal struct { Name string Check Check[*events.ModalSubmitInteractionCreate] Handler map[string]ModalHandler }
type ModalHandler ¶
type ModalHandler func(event *events.ModalSubmitInteractionCreate) error
Click to show internal directories.
Click to hide internal directories.