|
|
@ -28,8 +28,8 @@ var ( |
|
|
|
} |
|
|
|
} |
|
|
|
log = loggy.NewLogger(logOpts) |
|
|
|
log = loggy.NewLogger(logOpts) |
|
|
|
startupTime time.Time |
|
|
|
startupTime time.Time |
|
|
|
setupToken = "!setup " |
|
|
|
setupToken = fmt.Sprintf("!setup %+v", rand.Intn(9999)+1000) |
|
|
|
rebootToken = "!reboot " |
|
|
|
rebootToken = fmt.Sprintf("!reboot %+v", rand.Intn(9999)+1000) |
|
|
|
bump = true |
|
|
|
bump = true |
|
|
|
config Config |
|
|
|
config Config |
|
|
|
lastActiveChan string |
|
|
|
lastActiveChan string |
|
|
@ -58,13 +58,11 @@ func main() { |
|
|
|
defer log.PanicSafe() |
|
|
|
defer log.PanicSafe() |
|
|
|
if configFile == "" { |
|
|
|
if configFile == "" { |
|
|
|
configFile = "config.json" |
|
|
|
configFile = "config.json" |
|
|
|
setupToken = fmt.Sprintf("!setup %+v", rand.Intn(9999)+1000) |
|
|
|
|
|
|
|
rebootToken = fmt.Sprintf("!reboot %+v", rand.Intn(9999)+1000) |
|
|
|
|
|
|
|
log.LogCritical(fmt.Sprintf("SetupToken: %+v\nRebootToken: %+v", setupToken, rebootToken)) |
|
|
|
log.LogCritical(fmt.Sprintf("SetupToken: %+v\nRebootToken: %+v", setupToken, rebootToken)) |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
loadConfig() |
|
|
|
loadConfig() |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
log.LogCritical(fmt.Sprintf("SetupToken: %+v\nRebootToken: %+v", setupToken, rebootToken)) |
|
|
|
dg, err := discordgo.New("Bot " + token) |
|
|
|
dg, err := discordgo.New("Bot " + token) |
|
|
|
if err != nil { |
|
|
|
if err != nil { |
|
|
|
log.LogErrorType(err) |
|
|
|
log.LogErrorType(err) |
|
|
|