handlers

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CmdHelp       = "help"
	CmdMule       = "mule"
	CmdRouteAdd   = "route-add"
	CmdRoutePrint = "route-print"
	CmdRouteClear = "route-clear"
	CmdRouteMark  = "route-mark"
	CmdRouteList  = "route-list"
	CmdActReqMsg  = "message"

	FuncMessageCreateSayHello       = "message-create/say-hello"
	FuncMessageCreateReplyHello     = "message-create/reply-hello"
	FuncReactionAddReactionStats    = "reaction-add/reaction-stats"
	FuncReactionAddReactionRequired = "reaction-add/reaction-required"
)
View Source
const (
	EmojiConbu01 = "icon_conbu01"
	EmojiConbu02 = "icon_conbu02" // not used
	EmojiTest01  = "ma"
)

Variables

View Source
var (
	AppCmdHelp = &discordgo.ApplicationCommand{
		Name:        CmdHelp,
		Description: "こんぶくんについて知る",
	}

	AppCmdMule = &discordgo.ApplicationCommand{
		Name:        CmdMule,
		Description: "こんぶくんがラバ教の経典から引用してくれる(30秒後に自動削除)",
	}
)
View Source
var (
	DefaultROANavHandlerSuggestionsLimit = 5
)
View Source
var (
	EmojisReactionAddReactionRequired = []string{"🤖", EmojiConbu01, EmojiTest01}
)
View Source
var Version = "dev" // main.go injects this value

Functions

func HandleCmdHelp added in v1.4.0

func HandleCmdHelp(s *discordgo.Session, i *discordgo.InteractionCreate)

func HandleCmdMule added in v1.4.0

func HandleCmdMule(s *discordgo.Session, i *discordgo.InteractionCreate)

func HandleReactionAddReactionRequired added in v1.4.0

func HandleReactionAddReactionRequired(s *discordgo.Session, r *discordgo.MessageReactionAdd)

func InitializeApplicationCommands added in v1.4.0

func InitializeApplicationCommands(cmds ...*discordgo.ApplicationCommand) []*discordgo.ApplicationCommand

func InitializeCommandHandlers added in v1.4.0

func InitializeCommandHandlers(handlers map[string]func(s *discordgo.Session, i *discordgo.InteractionCreate)) map[string]func(s *discordgo.Session, i *discordgo.InteractionCreate)

func InitializeOnReadyHandler added in v1.4.0

func InitializeOnReadyHandler() func(s *discordgo.Session, r *discordgo.Ready)

func NewOnInteractionCreateHandler added in v1.4.0

func NewOnInteractionCreateHandler(
	commandHandlers map[string]func(s *discordgo.Session, i *discordgo.InteractionCreate),
) func(s *discordgo.Session, i *discordgo.InteractionCreate)

func NewOnMessageCreateHandler added in v1.4.0

func NewOnMessageCreateHandler() func(s *discordgo.Session, m *discordgo.MessageCreate)

func NewOnMessageReactionAddHandler added in v1.4.0

func NewOnMessageReactionAddHandler(
	reactionAddHandlers map[string]func(s *discordgo.Session, r *discordgo.MessageReactionAdd),
) func(s *discordgo.Session, r *discordgo.MessageReactionAdd)

func Ptr added in v1.3.0

func Ptr[T any](v T) *T

Types

type MapNameCompleter added in v1.3.0

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

func NewMapNameCompleter added in v1.3.0

func NewMapNameCompleter(lim int) *MapNameCompleter

func (*MapNameCompleter) GetChoices added in v1.3.0

func (*MapNameCompleter) GetSuggestions added in v1.3.0

func (c *MapNameCompleter) GetSuggestions(input string) []string

type ROANavHandler added in v1.4.0

type ROANavHandler struct {
	MapNameCompleter *MapNameCompleter
	// contains filtered or unexported fields
}

func NewROANavHandler added in v1.4.0

func NewROANavHandler(saveFile string, suggestionsLimit int) (*ROANavHandler, error)

func (*ROANavHandler) CommandRouteAdd added in v1.4.0

func (*ROANavHandler) CommandRouteAdd() *discordgo.ApplicationCommand

func (*ROANavHandler) CommandRouteClear added in v1.4.0

func (*ROANavHandler) CommandRouteClear() *discordgo.ApplicationCommand

func (*ROANavHandler) CommandRouteList added in v1.8.0

func (*ROANavHandler) CommandRouteList() *discordgo.ApplicationCommand

func (*ROANavHandler) CommandRouteMark added in v1.4.0

func (*ROANavHandler) CommandRouteMark() *discordgo.ApplicationCommand

func (*ROANavHandler) CommandRoutePrint added in v1.4.0

func (*ROANavHandler) CommandRoutePrint() *discordgo.ApplicationCommand

func (*ROANavHandler) DeleteNavigation added in v1.4.0

func (h *ROANavHandler) DeleteNavigation(name string)

func (*ROANavHandler) ExportNavigations added in v1.4.0

func (h *ROANavHandler) ExportNavigations(w io.Writer) error

func (*ROANavHandler) GetOrCreateNavigation added in v1.4.0

func (h *ROANavHandler) GetOrCreateNavigation(name string) *roanav.Navigation

GetOrCreateNavigation always returns a non-nil value.

func (*ROANavHandler) HandleCmdRouteAdd added in v1.4.0

func (h *ROANavHandler) HandleCmdRouteAdd(s *discordgo.Session, i *discordgo.InteractionCreate)

func (*ROANavHandler) HandleCmdRouteAddAutocomplete added in v1.4.0

func (h *ROANavHandler) HandleCmdRouteAddAutocomplete(s *discordgo.Session, i *discordgo.InteractionCreate)

func (*ROANavHandler) HandleCmdRouteAddCommand added in v1.4.0

func (h *ROANavHandler) HandleCmdRouteAddCommand(s *discordgo.Session, i *discordgo.InteractionCreate)

func (*ROANavHandler) HandleCmdRouteClear added in v1.4.0

func (h *ROANavHandler) HandleCmdRouteClear(s *discordgo.Session, i *discordgo.InteractionCreate)

func (*ROANavHandler) HandleCmdRouteList added in v1.8.0

func (h *ROANavHandler) HandleCmdRouteList(s *discordgo.Session, i *discordgo.InteractionCreate)

func (*ROANavHandler) HandleCmdRouteMark added in v1.4.0

func (h *ROANavHandler) HandleCmdRouteMark(s *discordgo.Session, i *discordgo.InteractionCreate)

func (*ROANavHandler) HandleCmdRouteMarkAutocomplete added in v1.4.0

func (h *ROANavHandler) HandleCmdRouteMarkAutocomplete(s *discordgo.Session, i *discordgo.InteractionCreate)

func (*ROANavHandler) HandleCmdRouteMarkCommand added in v1.4.0

func (h *ROANavHandler) HandleCmdRouteMarkCommand(s *discordgo.Session, i *discordgo.InteractionCreate)

func (*ROANavHandler) HandleCmdRoutePrint added in v1.4.0

func (h *ROANavHandler) HandleCmdRoutePrint(s *discordgo.Session, i *discordgo.InteractionCreate)

func (*ROANavHandler) ImportNavigations added in v1.4.0

func (h *ROANavHandler) ImportNavigations(r io.Reader) error

func (*ROANavHandler) Load added in v1.4.0

func (h *ROANavHandler) Load() error

func (*ROANavHandler) Save added in v1.4.0

func (h *ROANavHandler) Save() error

Jump to

Keyboard shortcuts

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