From 45e4e0bd9fb4378b4aa31109968bc0434e210177 Mon Sep 17 00:00:00 2001 From: c9s Date: Wed, 19 Jan 2022 18:22:54 +0800 Subject: [PATCH] add slack callback file --- pkg/interact/slack_callbacks.go | 27 +++++++++++++++++++++++++++ 1 file changed, 27 insertions(+) create mode 100644 pkg/interact/slack_callbacks.go diff --git a/pkg/interact/slack_callbacks.go b/pkg/interact/slack_callbacks.go new file mode 100644 index 000000000..eaa9bd987 --- /dev/null +++ b/pkg/interact/slack_callbacks.go @@ -0,0 +1,27 @@ +// Code generated by "callbackgen -type Slack"; DO NOT EDIT. + +package interact + +import ( + "github.com/slack-go/slack/slackevents" +) + +func (s *Slack) OnAuthorized(cb func(userSession *SlackSession)) { + s.authorizedCallbacks = append(s.authorizedCallbacks, cb) +} + +func (s *Slack) EmitAuthorized(userSession *SlackSession) { + for _, cb := range s.authorizedCallbacks { + cb(userSession) + } +} + +func (s *Slack) OnEventsApi(cb func(slackevents.EventsAPIEvent)) { + s.eventsApiCallbacks = append(s.eventsApiCallbacks, cb) +} + +func (s *Slack) EmitEventsApi(slackevents.EventsAPIEvent) { + for _, cb := range s.eventsApiCallbacks { + cb() + } +}