Files
trbot/utils/plugin_utils/handler_chosen_inline.go
Hubert Chen 7b29429492 channel saved message sort by used and id desc
handlers:
    add `chosenInlineHandler` function to match `ChosenInlineResult` handlers
plugin_utils:
    add ChosenInlineResult type handlers
2026-05-14 00:51:16 +08:00

21 lines
559 B
Go

package plugin_utils
import "trle5.xyz/trbot/utils/handler_params"
type ChosenInlineResult struct {
ResultIDPrefix string
ChosenInlineResultHandler func(*handler_params.ChosenInlineResult) error
}
func AddChosenInlineResultHandlers(handlers ...ChosenInlineResult) int {
if AllPlugins.ChosenInlineResult == nil { AllPlugins.ChosenInlineResult = []ChosenInlineResult{} }
var handlerCount int
for _, handler := range handlers {
AllPlugins.ChosenInlineResult = append(AllPlugins.ChosenInlineResult, handler)
handlerCount++
}
return handlerCount
}