Skip to content

Commit

Permalink
Made the /refresh command respond
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaprit committed Apr 30, 2022
1 parent d3697d2 commit b1bf156
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions discord/DiscordBot.go
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ import (
"github.com/bwmarrin/discordgo"
"log"
"strings"
"time"
)

var commands = []*discordgo.ApplicationCommand{
Expand All @@ -26,15 +27,17 @@ var commandHandlers = map[string]func(s *discordgo.Session, i *discordgo.Interac
return
}
RefreshServerStatus(s)
er2 := s.InteractionRespond(i.Interaction, &discordgo.InteractionResponse{
Type: discordgo.InteractionResponseChannelMessageWithSource,
Data: &discordgo.InteractionResponseData{
Content: "Done!",
},
})

_, er2 := s.InteractionResponseEdit(i.Interaction, &discordgo.WebhookEdit{Content: "Done!"})
if er2 != nil {
return
}
time.AfterFunc(time.Second*5, func() {
err := s.InteractionResponseDelete(i.Interaction)
if err != nil {
return
}
})
},
}

Expand Down

0 comments on commit b1bf156

Please sign in to comment.