added enhanced DB functions

This commit is contained in:
2025-04-08 18:48:34 -04:00
parent 7599665e4c
commit 18d8b6eee2
4 changed files with 45 additions and 0 deletions
+6
View File
@@ -4,6 +4,7 @@ import (
"encoding/json"
"fmt"
"io"
"log"
"net/http"
"os"
"strings"
@@ -45,6 +46,11 @@ func HandleSuggest(s *discordgo.Session, i *discordgo.InteractionCreate) {
return
}
err = helpers.RemoveUserSubmittions(userID);
if err != nil {
log.Default().Println(fmt.Sprintf("%s", err.Error()))
}
// Store new submission time
if err := helpers.SetLastSubmission(userID); err != nil {
helpers.HandleError(s, i, fmt.Errorf("failed to update cooldown: %w", err))