Documentation ¶
Index ¶
- Constants
- Variables
- func ResolvePresence(p Presence) *gateway.MessageDataPresenceUpdate
- func WriteConfig(filename string) error
- type AutocompleteCtx
- type AutocompleteHandle
- type ComponentCtx
- type ComponentHandle
- type Config
- type JAutocomplete
- type JCommand
- type JComponent
- type JContext
- func (e *JContext) CreateFollowupMessage(messageCreate discord.MessageCreate, opts ...rest.RequestOpt) (*discord.Message, error)
- func (e *JContext) DeleteFollowupMessage(messageID snowflake.ID, opts ...rest.RequestOpt) error
- func (e *JContext) DeleteInteractionResponse(opts ...rest.RequestOpt) error
- func (e *JContext) GetFollowupMessage(messageID snowflake.ID, opts ...rest.RequestOpt) (*discord.Message, error)
- func (e *JContext) GetInteractionResponse(opts ...rest.RequestOpt) (*discord.Message, error)
- func (e *JContext) UpdateFollowupMessage(messageID snowflake.ID, messageUpdate discord.MessageUpdate, ...) (*discord.Message, error)
- func (e *JContext) UpdateInteractionResponse(messageUpdate discord.MessageUpdate, opts ...rest.RequestOpt) (*discord.Message, error)
- type JHRegister
- type JIHandler
- func (h *JIHandler) Autocomplete(p string, handle AutocompleteHandle)
- func (h *JIHandler) Component(customID string, handle ComponentHandle)
- func (h *JIHandler) Modal(customID string, handle ModalHandle)
- func (h *JIHandler) OnEvent(event bot.Event)
- func (h *JIHandler) SetupCommands(client bot.Client, commands []JCommand)
- func (h *JIHandler) WithConfig(c Config) *JIHandler
- func (h *JIHandler) WithLogger(l *log.Logger) *JIHandler
- type JModal
- type ModalCtx
- type ModalHandle
- type PUpdater
- type Presence
Constants ¶
View Source
const ( BOLD = "**" CODEBLOCK = "```" CODESTRING = "`" CODESTRING_DOUBLE = "``" ESCAPE = "\\" ITALICS = "_" SPOILER = "||" STRIKE = "~~" UNDERLINE = "__" )
View Source
const ( Green = 0x00ff00 Red = 0xff0000 Yellow = 0xffff00 Blue = 0x0000ff Purple = 0x7d00ff Pink = 0xff00ff Magenta = 0xff007d DDark = 0x2b2d31 DBlurple = 0x5865f2 )
View Source
const DEFAULT_CONTENT = `` /* 416-byte string literal not displayed */
Variables ¶
View Source
var ComponentInteractionType = map[discord.ComponentType]string{ discord.ComponentTypeActionRow: `action_row`, discord.ComponentTypeButton: `button`, discord.ComponentTypeStringSelectMenu: `string_select_menu`, discord.ComponentTypeTextInput: `text_input`, discord.ComponentTypeUserSelectMenu: `user_select_menu`, discord.ComponentTypeRoleSelectMenu: `role_select_menu`, discord.ComponentTypeMentionableSelectMenu: `mentionable_select_menu`, discord.ComponentTypeChannelSelectMenu: `channel_select_menu`, }
Debug purposes
View Source
var InteractionTypeString = map[discord.InteractionType]string{ discord.InteractionTypeComponent: `component`, discord.InteractionTypeAutocomplete: `autocomplete`, discord.InteractionTypeModalSubmit: `modal`, discord.InteractionTypeApplicationCommand: `command`, discord.InteractionTypePing: `ping`, }
Debug purposes
Functions ¶
func ResolvePresence ¶
func ResolvePresence(p Presence) *gateway.MessageDataPresenceUpdate
func WriteConfig ¶
Types ¶
type AutocompleteCtx ¶
type AutocompleteCtx struct { events.AutocompleteInteractionCreate Log *log.Logger }
type AutocompleteHandle ¶
type AutocompleteHandle func(ctx *AutocompleteCtx) error
return the result?
type ComponentCtx ¶
type ComponentCtx struct { events.ComponentInteractionCreate Log *log.Logger }
type ComponentHandle ¶
type ComponentHandle func(ctx *ComponentCtx) error
type Config ¶
type Config struct { Bot struct { Token string `validate:"required"` GuildId snowflake.ID `fig:"guild" default:"0"` SetupCommands bool `fig:"setup-commands"` GlobalCommands bool `fig:"global-commands"` MobileOs bool `fig:"use-mobile-os"` DebugLog bool `fig:"debug-log"` } PresenceUpdater struct { Enabled bool `fig:"enabled"` Delay time.Duration `fig:"delay" default:"10s"` Presences []Presence } `fig:"presence-updater"` }
type JAutocomplete ¶
type JAutocomplete struct{}
type JCommand ¶
type JCommand interface { discord.ApplicationCommandCreate Init(JHRegister) Run(ctx *JContext) error Error(ctx *JContext, err error) }
type JComponent ¶
type JComponent struct{}
type JContext ¶
type JContext struct { events.ApplicationCommandInteractionCreate Log *log.Logger }
func (*JContext) CreateFollowupMessage ¶
func (e *JContext) CreateFollowupMessage(messageCreate discord.MessageCreate, opts ...rest.RequestOpt) (*discord.Message, error)
func (*JContext) DeleteFollowupMessage ¶
func (e *JContext) DeleteFollowupMessage(messageID snowflake.ID, opts ...rest.RequestOpt) error
func (*JContext) DeleteInteractionResponse ¶
func (e *JContext) DeleteInteractionResponse(opts ...rest.RequestOpt) error
func (*JContext) GetFollowupMessage ¶
func (*JContext) GetInteractionResponse ¶
func (*JContext) UpdateFollowupMessage ¶
func (e *JContext) UpdateFollowupMessage(messageID snowflake.ID, messageUpdate discord.MessageUpdate, opts ...rest.RequestOpt) (*discord.Message, error)
func (*JContext) UpdateInteractionResponse ¶
func (e *JContext) UpdateInteractionResponse(messageUpdate discord.MessageUpdate, opts ...rest.RequestOpt) (*discord.Message, error)
type JHRegister ¶
type JHRegister interface { Component(customID string, handle ComponentHandle) Modal(customID string, handle ModalHandle) Autocomplete(p string, handle AutocompleteHandle) }
type JIHandler ¶
func NewIHandler ¶
func NewIHandler() *JIHandler
func (*JIHandler) Autocomplete ¶
func (h *JIHandler) Autocomplete(p string, handle AutocompleteHandle)
func (*JIHandler) Component ¶
func (h *JIHandler) Component(customID string, handle ComponentHandle)
func (*JIHandler) Modal ¶
func (h *JIHandler) Modal(customID string, handle ModalHandle)
func (*JIHandler) SetupCommands ¶
func (*JIHandler) WithConfig ¶
type ModalHandle ¶
type PUpdater ¶
func (*PUpdater) Next ¶
func (pu *PUpdater) Next() (data *gateway.MessageDataPresenceUpdate)
func (*PUpdater) StartUpdater ¶
Click to show internal directories.
Click to hide internal directories.