forked from abourget/slick
-
Notifications
You must be signed in to change notification settings - Fork 0
/
conf.go
39 lines (34 loc) · 887 Bytes
/
conf.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
package slick
import (
"errors"
"os"
)
type SlackConfig struct {
Username string
Password string
Nickname string
JoinChannels []string `json:"join_channels"`
GeneralChannel string `json:"general_channel"`
TeamDomain string `json:"team_domain"`
TeamID string `json:"team_id"`
ApiToken string `json:"api_token"`
WebBaseURL string `json:"web_base_url"`
DBPath string `json:"db_path"`
Debug bool
}
type ChatPluginConfig struct {
// Whether to handle the bot's own messages
EchoMessages bool
// Whether to handle messages that are not destined to me
OnlyMentions bool
}
func checkPermission(file string) error {
fi, err := os.Stat(file)
if err != nil {
return err
}
if fi.Mode()&0077 != 0 {
return errors.New("Config file is permitted to group/other. Do chmod 600 " + file)
}
return nil
}