Browse Source

go vet

master
Gregory Rudolph 3 years ago
parent
commit
160625396c
Signed by: rudi
GPG Key ID: EF64F3CBD1A1EBDD
  1. 12
      commands.go
  2. 2
      config.go
  3. 4
      discordMessage.go

12
commands.go

@ -50,7 +50,7 @@ func setupCommands() { @@ -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() { @@ -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() { @@ -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)
}

2
config.go

@ -82,7 +82,7 @@ func bumpTimer(s *discordgo.Session) { @@ -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.")

4
discordMessage.go

@ -52,14 +52,14 @@ func messageCreate(s *discordgo.Session, m *discordgo.MessageCreate) { @@ -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))

Loading…
Cancel
Save