-
Notifications
You must be signed in to change notification settings - Fork 2
/
main.go
31 lines (24 loc) · 633 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
package main
import (
"flag"
"log"
"github.com/stjohnjohnson/reddit-watcher/internal/bot"
)
// These variables get set by the build script via the LDFLAGS
var (
version = "0.0.0-dev"
commit = "none"
date = "unknown"
)
func main() {
log.SetPrefix("[MAIN] ")
log.Printf("Version %v, commit %v, built at %v", version, commit, date)
token := flag.String("token", "INVALID", "Bot Token for Telegram")
configPath := flag.String("config", "/config", "Location of user data")
flag.Parse()
bot, err := bot.New(*token, *configPath, version)
if err != nil {
log.Fatalf("Unable to start bot: %v", err)
}
bot.Loop()
}