mirror of
https://github.com/c9s/bbgo.git
synced 2024-11-10 09:11:55 +00:00
add slack callback file
This commit is contained in:
parent
b6f05cf772
commit
45e4e0bd9f
27
pkg/interact/slack_callbacks.go
Normal file
27
pkg/interact/slack_callbacks.go
Normal file
|
@ -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()
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user