Documentation
¶
Index ¶
- Constants
- type CommandCommonContext
- type CommandContext
- func (ctx *CommandContext) ContextHandler(Command string, parameters ...string)
- func (ctx *CommandContext) ErrorSenderHandler(err error)
- func (ctx *CommandContext) ErrorSenderHandlerNew(ctxFunc interface{}, parameters ...string)
- func (ctx *CommandContext) Init(khlCtx *kook.EventHandlerCommonContext) *CommandContext
- func (ctx *CommandContext) InitContext(baseCtx context.Context) *CommandContext
- func (ctx *CommandContext) InitExtra(khlCtx interface{}) *CommandContext
- func (ctx *CommandContext) IsAdmin() bool
- type CommandContextFunc
- type CommandContextWithGuildIDFunc
- type CommandExtraContext
Constants ¶
View Source
const ( CommandContextTypeAddAdmin = "ADDADMIN" CommandContextTypeRemoveAdmin = "REMOVEADMIN" CommandContextTypeShowAdmin = "SHOWADMIN" CommandContextTypeDeleteAll = "DELETEALL" CommandContextReconnect = "RECONNECT" CommandContextTypeCal = "SHOWCAL" CommandContextTypeCalLocal = "SHOWCALLOCAL" CommandContextTypeHelper = "HELP" CommandContextTypeHitokoto = "ONEWORD" CommandContextTypeMusic = "SEARCHMUSIC" CommandContextTypeRoll = "ROLL" CommandContextTypePing = "PING" CommandContextTypeUser = "GETUSER" CommandContextTypeTryPanic = "TRYPANIC" CommandContextTypeRestart = "RESTART" CommandContextTypeDailyRate = "RATE" CommandContextTypeGPT = "GPT" CommandContextTypeNews = "NEWS" CommandContextTypeNotify = "NOTI" )
const 长命令组
@param CommandContextTypeAddAdmin
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type CommandCommonContext ¶
CommandCommonContext is a context for command.
type CommandContext ¶
type CommandContext struct { Common *CommandCommonContext Extra *CommandExtraContext Ctx context.Context // contains filtered or unexported fields }
CommandContext is a context for command.
func GetNewCommandCtx ¶
func GetNewCommandCtx() *CommandContext
GetNewCommandCtx is a function for command.
@return *CommandContext
func (*CommandContext) ContextHandler ¶
func (ctx *CommandContext) ContextHandler(Command string, parameters ...string)
ContextHandler is a function for command.
@receiver ctx @param Command @param parameters
func (*CommandContext) ErrorSenderHandler ¶
func (ctx *CommandContext) ErrorSenderHandler(err error)
ErrorSenderHandler is a function for command.
@receiver ctx @param err
func (*CommandContext) ErrorSenderHandlerNew ¶
func (ctx *CommandContext) ErrorSenderHandlerNew(ctxFunc interface{}, parameters ...string)
ErrorSenderHandlerNew is a function for command.
@receiver ctx @param err
func (*CommandContext) Init ¶
func (ctx *CommandContext) Init(khlCtx *kook.EventHandlerCommonContext) *CommandContext
Init is a init function for command.
@receiver ctx
func (*CommandContext) InitContext ¶
func (ctx *CommandContext) InitContext(baseCtx context.Context) *CommandContext
InitContext 1
@receiver ctx @param baseCtx @return *CommandContext
func (*CommandContext) InitExtra ¶
func (ctx *CommandContext) InitExtra(khlCtx interface{}) *CommandContext
InitExtra is a init function for command.
@receiver ctx @param khlCtx @return *CommandContext
func (*CommandContext) IsAdmin ¶
func (ctx *CommandContext) IsAdmin() bool
IsAdmin is a function for command.
@receiver ctx @return bool
type CommandContextFunc ¶
type CommandContextFunc func(ctx context.Context, TargetID, MsgID, AuthorID string, parameters ...string) error
CommandContextFunc is a function for command.
@param TargetID @param MsgID @param AuthorID @param parameters @return error
type CommandContextWithGuildIDFunc ¶
type CommandContextWithGuildIDFunc func(ctx context.Context, targetID, quoteID, authorID string, guildID string, args ...string) error
CommandContextWithGuildIDFunc is a function for command.
@param targetID @param quoteID @param authorID @param guildID @param args @return error
type CommandExtraContext ¶
type CommandExtraContext struct {
GuildID string
}
CommandExtraContext is a context for command.
Click to show internal directories.
Click to hide internal directories.