This commit is contained in:
2021-05-06 08:31:53 -04:00
parent 62738d8a88
commit 160625396c
3 changed files with 9 additions and 9 deletions

View File

@ -50,7 +50,7 @@ func setupCommands() {
snap := Command{
Name: "Snap",
Help: "Trigger a purge!",
Help: "Trigger a purge!",
RequiresAdmin: false,
Keywords: []string{"snap", "purge", "sn"},
Exec: Snap,
@ -60,7 +60,7 @@ func setupCommands() {
status := Command{
Name: "Status",
RequiresAdmin: true,
Help: "Show the current status of Thanos/Verifications and probations",
Help: "Show the current status of Thanos/Verifications and probations",
Keywords: []string{"st", "status", "stats"},
Exec: Status,
}
@ -75,11 +75,11 @@ func setupCommands() {
commands = append(commands, listCommands)
debugLevel := Command{
Name: "Debug Level",
Name: "Debug Level",
RequiresAdmin: true,
Keywords: []string{"debug"},
Exec: Debug,
Help: "Set the log level for loggy",
Keywords: []string{"debug"},
Exec: Debug,
Help: "Set the log level for loggy",
}
commands = append(commands, debugLevel)
}

View File

@ -82,7 +82,7 @@ func bumpTimer(s *discordgo.Session) {
bump = false
config.BumpTime = time.Now()
time.Sleep(2 * time.Hour)
if time.Since(lastActiveTime) < (5*time.Minute) {
if time.Since(lastActiveTime) < (5 * time.Minute) {
s.ChannelMessageSend(lastActiveChan, "!d bump is ready, please use it. (say \"!d bump\" without the quotes)")
}
s.ChannelMessageSend(config.AdminChannel, "!d bump is ready.")

View File

@ -52,14 +52,14 @@ func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) {
log.LogDebug("%+v found!", keyword)
b.Command = keyword
if !cmd.RequiresAdmin {
log.LogDebug("%+v does not require admin, running!")
log.LogDebug("%+v does not require admin, running!", cmd.Name)
if !cmd.Exec(b) {
s.ChannelMessageSend(config.AdminChannel, fmt.Sprintf("There was an error running %+v\n%+v", cmd.Name, cmd.Help))
} else {
log.LogInfo("Ran command %+v for %+v", cmd.Name, m.Author.Username)
}
} else {
log.LogDebug("%+v does require admin, checking!")
log.LogDebug("%+v does require admin, checking!", cmd.Name)
if isAdmin(m.Member) {
if !cmd.Exec(b) {
s.ChannelMessageSend(config.AdminChannel, fmt.Sprintf("There was an error running %+v\n%+v", cmd.Name, cmd.Help))