-
Notifications
You must be signed in to change notification settings - Fork 49
/
config.go
41 lines (39 loc) · 1.55 KB
/
config.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
package graw
import (
"log"
)
// Config configures a graw run or scan by specifying event sources. Each event
// type has a corresponding handler defined in graw/botfaces. The bot must be
// able to handle requested event types.
type Config struct {
// New posts in all subreddits named here will be forwarded to the bot's
// PostHandler.
Subreddits []string
// New posts in all users' custom feeds named here will be forwarded to the bot's
// PostHandler.
// Key is username, value is list of feeds
CustomFeeds map[string][]string
// New comments in all subreddits named here will be forwarded to the
// bot's CommentHandler.
SubredditComments []string
// New posts and comments made by all users named here will be forwarded
// to the bot's UserHandler. Note that since a separate monitor must be
// construced for every user, unlike subreddits, subscribing to the
// actions of many users can delay updates from other event sources.
Users []string
// When true, replies to posts made by the bot's account will be
// forwarded to the bot's PostReplyHandler.
PostReplies bool
// When true, replies to comments made by the bot's account will be
// forwarded to the bot's CommentReplyHandler.
CommentReplies bool
// When true, mentions of the bot's username will be forwarded to the
// bot's MentionHandler.
Mentions bool
// When true, messages sent to the bot's inbox will be forwarded to the
// bot's MessageHandler.
Messages bool
// If set, internal messages will be logged here. This is a spammy log
// used for debugging graw.
Logger *log.Logger
}