-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
41 lines (34 loc) · 818 Bytes
/
main.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
// Adapted from https://github.com/bwmarrin/discordgo/blob/master/examples/pingpong/main.go
package main
import (
"flag"
"os"
"time"
"github.com/SheepTester/baby-moofy/bot"
)
var token string
var path string
var order int
var delay time.Duration
var prefix string
func init() {
flag.StringVar(&token, "t", "", "Bot token")
flag.StringVar(&path, "p", "", "Markov chain frequencies JSON file path")
flag.IntVar(&order, "o", 3, "Markov chain order")
flag.DurationVar(&delay, "d", 30 * time.Second, "Default delay per channel between contributions")
flag.StringVar(&prefix, "P", ":", "Prefix")
flag.Parse()
if token == "" {
flag.Usage()
os.Exit(1)
}
}
func main() {
bot.Start(&bot.BotOptions{
MarkovPath: path,
Token: token,
MarkovOrder: order,
DefaultDelay: delay,
Prefix: prefix,
})
}