This repository was archived by the owner on May 13, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.go
More file actions
61 lines (46 loc) · 1.2 KB
/
main.go
File metadata and controls
61 lines (46 loc) · 1.2 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
package main
import (
//"github.com/bwmarrin/discordgo"
//"github.com/op/go-logging"
//"github.com/davecgh/go-spew/spew"
"github.com/sethdmoore/digo/api"
"github.com/sethdmoore/digo/config"
"github.com/sethdmoore/digo/conn"
"github.com/sethdmoore/digo/errhandler"
"github.com/sethdmoore/digo/globals"
"github.com/sethdmoore/digo/handler"
"github.com/sethdmoore/digo/logger"
"github.com/sethdmoore/digo/plugins"
)
func main() {
var err error
//p = plugins.Init()
lock := make(chan int)
// set up the config struct
config.Init()
// set the log reference to pass around
log := logger.Init()
errhandler.Init(log)
// set up the plugins struct
p := plugins.Init(log)
//log.Notice()
// handler takes reference to config and plugins structs
handler.Init(p, log)
// login / websocket flow
s := conn.Init(log)
// determine the bot's userID
user, err := s.User("@me")
errhandler.Handle(err)
c := config.Get()
c.UserID = user.ID
// listen for events on Discord
// conn.Listen(s, c, log)
// enable the API, if applicable
if c.DisableAPI {
log.Notice("API explicitly disabled.")
} else {
go api.Listen(c.APIInterface, s, log)
}
log.Noticef("Digo v%s Online", globals.Version)
<-lock
}