-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
45 lines (35 loc) · 846 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
42
43
44
45
package main
import (
"github.com/Flamingo-OS/upload-bot/core"
"github.com/Flamingo-OS/upload-bot/database"
"github.com/Flamingo-OS/upload-bot/documents"
"github.com/Flamingo-OS/upload-bot/plugins"
)
// various constants. Might me needed to change in future
const FILENAME string = "config.json"
func init() {
// init the logger
core.InitLogger()
// extract config
core.Config = core.NewBotConfig(FILENAME)
// init a map to store and manage cancellable tasks
core.CancelTasks = core.NewCancelCmd()
// connect to db
database.Init()
// GDrive
err := documents.NewGdrive()
if err != nil {
core.Log.Errorln(err)
return
}
}
func main() {
_, updater, err := core.BotInit(core.Config)
if err != nil {
core.Log.Errorln(err)
return
}
// Load up our custom handlers
plugins.Main(updater.Dispatcher)
updater.Idle()
}