handlers:
add `chosenInlineHandler` function to match `ChosenInlineResult` handlers
plugin_utils:
add ChosenInlineResult type handlers
21 lines
559 B
Go
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
|
|
}
|