-
Notifications
You must be signed in to change notification settings - Fork 0
/
options_instagram.go
72 lines (64 loc) · 2.47 KB
/
options_instagram.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
package gometawebhooks
// Sets the InstagramMentionHandler, see https://developers.facebook.com/docs/instagram-api/guides/mentions
func (MetaWebhookOptions) InstagramMentionHandler(fn InstagramMentionHandler) Option {
return func(hooks *Webhooks) error {
hooks.instagramMentionHandler = fn
return nil
}
}
// Sets the InstagramStoryInsightsHandler, see https://developers.facebook.com/docs/instagram-api/guides/webhooks#capturing-story-insights
func (MetaWebhookOptions) InstagramStoryInsightsHandler(fn InstagramStoryInsightsHandler) Option {
return func(hooks *Webhooks) error {
hooks.instagramStoryInsightsHandler = fn
return nil
}
}
// Sets the InstagramMessageHandler, see https://developers.facebook.com/docs/messenger-platform/instagram/features/webhook/#messages
func (MetaWebhookOptions) InstagramMessageHandler(fn InstagramMessageHandler) Option {
return func(hooks *Webhooks) error {
hooks.instagramMessageHandler = fn
return nil
}
}
// Sets the InstagramPostbackHandler, see https://developers.facebook.com/docs/messenger-platform/instagram/features/webhook/#messaging-postbacks
func (MetaWebhookOptions) InstagramPostbackHandler(fn InstagramPostbackHandler) Option {
return func(hooks *Webhooks) error {
hooks.instagramPostbackHandler = fn
return nil
}
}
// Sets the InstagramReferralHandler, see https://developers.facebook.com/docs/messenger-platform/instagram/features/webhook/#igme
func (MetaWebhookOptions) InstagramReferralHandler(fn InstagramReferralHandler) Option {
return func(hooks *Webhooks) error {
hooks.instagramReferralHandler = fn
return nil
}
}
// Sets all InstagramMessaging handlers
func (MetaWebhookOptions) InstagramMessagingHandler(fn InstagramMessagingHandler) Option {
return func(hooks *Webhooks) error {
hooks.instagramMessageHandler = fn
hooks.instagramPostbackHandler = fn
hooks.instagramReferralHandler = fn
return nil
}
}
// Sets all InstagramChanges handlers
func (MetaWebhookOptions) InstagramChangesHandler(fn InstagramChangesHandler) Option {
return func(hooks *Webhooks) error {
hooks.instagramMentionHandler = fn
hooks.instagramStoryInsightsHandler = fn
return nil
}
}
// Sets all Instagram handlers
func (MetaWebhookOptions) InstagramHandler(fn InstagramHandler) Option {
return func(hooks *Webhooks) error {
hooks.instagramMessageHandler = fn
hooks.instagramPostbackHandler = fn
hooks.instagramReferralHandler = fn
hooks.instagramMentionHandler = fn
hooks.instagramStoryInsightsHandler = fn
return nil
}
}