Documentation
¶
Index ¶
- Constants
- type Api
- func (a *Api) Client() *maxbot.Api
- func (a *Api) Handle(endpoint string, h HandlerFunc, m ...MiddlewareFunc)
- func (a *Api) HandleCallback(endpoint string, h HandlerFunc, m ...MiddlewareFunc)
- func (a *Api) OnError(err error, c Context)
- func (a *Api) ProcessContext(c Context)
- func (a *Api) ProcessUpdate(_ context.Context, u model.Update)
- func (a *Api) Start()
- func (a *Api) Stop()
- func (a *Api) Use(middleware ...MiddlewareFunc)
- func (a *Api) WebhookHandler() http.HandlerFunc
- type Context
- type Group
- type HandlerFunc
- type MiddlewareFunc
- type Opt
- type Option
Constants ¶
View Source
const ( OnMessageCreated = "message_created" OnMessageCallback = "message_callback" OnMessageEdited = "message_edited" OnMessageRemoved = "message_removed" OnBotAdded = "bot_added" OnBotRemoved = "bot_removed" OnUserAdded = "user_added" OnUserRemoved = "user_removed" OnBotStarted = "bot_started" OnBotStopped = "bot_stopped" OnDialogCleared = "dialog_cleared" OnDialogRemoved = "dialog_removed" OnDialogMuted = "dialog_muted" OnDialogUnmuted = "dialog_unmuted" OnChatTitleChangedEvent = "chat_title_changed" OnText = "text" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Api ¶
func (*Api) Handle ¶
func (a *Api) Handle(endpoint string, h HandlerFunc, m ...MiddlewareFunc)
func (*Api) HandleCallback ¶
func (a *Api) HandleCallback(endpoint string, h HandlerFunc, m ...MiddlewareFunc)
func (*Api) ProcessContext ¶
func (*Api) Use ¶
func (a *Api) Use(middleware ...MiddlewareFunc)
func (*Api) WebhookHandler ¶
func (a *Api) WebhookHandler() http.HandlerFunc
type Context ¶
type Group ¶
type Group struct {
// contains filtered or unexported fields
}
func (*Group) Handle ¶
func (g *Group) Handle(endpoint string, h HandlerFunc, m ...MiddlewareFunc)
func (*Group) Use ¶
func (g *Group) Use(middleware ...MiddlewareFunc)
type HandlerFunc ¶
type MiddlewareFunc ¶
type MiddlewareFunc func(HandlerFunc) HandlerFunc
type Opt ¶
type Opt func(cli *Api)
func WithBaseURL ¶
func WithErrorHandle ¶
func WithHTTPClient ¶
func WithHTTPClient(cli maxbot.HttpClient) Opt
func WithPollingPause ¶
func WithPollingTimeout ¶
func WithWebhook ¶
Click to show internal directories.
Click to hide internal directories.