|
|
|
@ -18,20 +18,12 @@ import (
@@ -18,20 +18,12 @@ import (
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
var ( |
|
|
|
|
// Logging Setup
|
|
|
|
|
logOpts = loggy.LogOpts{ |
|
|
|
|
UseStdout: true, |
|
|
|
|
Level: 5, |
|
|
|
|
KBTeam: "nightmarehaus.logs.fetiche", |
|
|
|
|
KBChann: "general", |
|
|
|
|
ProgName: "disgord-thanos", |
|
|
|
|
} |
|
|
|
|
log = loggy.NewLogger(logOpts) |
|
|
|
|
startupTime time.Time |
|
|
|
|
setupToken = fmt.Sprintf("!setup %+v", rand.Intn(9999)+1000) |
|
|
|
|
rebootToken = fmt.Sprintf("!reboot %+v", rand.Intn(9999)+1000) |
|
|
|
|
bump = true |
|
|
|
|
config Config |
|
|
|
|
log = loggy.NewLogger(config.LogOpts) |
|
|
|
|
lastActiveChan string |
|
|
|
|
lastActiveTime time.Time |
|
|
|
|
token string |
|
|
|
@ -49,17 +41,19 @@ func init() {
@@ -49,17 +41,19 @@ func init() {
|
|
|
|
|
|
|
|
|
|
func main() { |
|
|
|
|
defer log.PanicSafe() |
|
|
|
|
if configFile == "" { |
|
|
|
|
configFile = "config.json" |
|
|
|
|
} else { |
|
|
|
|
loadConfig() |
|
|
|
|
} |
|
|
|
|
log = loggy.NewLogger(config.LogOpts) |
|
|
|
|
startupTime = time.Now() |
|
|
|
|
lastActiveTime = time.Now() |
|
|
|
|
lastActiveChan = config.AdminChannel |
|
|
|
|
if token == "" { |
|
|
|
|
log.LogPanic("No token provided. Please run: disgord-thanos -t <bot token>") |
|
|
|
|
} |
|
|
|
|
if configFile == "" { |
|
|
|
|
configFile = "config.json" |
|
|
|
|
} else { |
|
|
|
|
loadConfig() |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
log.LogCritical(fmt.Sprintf("SetupToken: %+v\nRebootToken: %+v", setupToken, rebootToken)) |
|
|
|
|
dg, err := discordgo.New("Bot " + token) |
|
|
|
|
if err != nil { |
|
|
|
|