Fixed himbucks
This commit is contained in:
parent
9a1b3723bc
commit
022686e14f
1 changed files with 8 additions and 0 deletions
|
@ -3,6 +3,7 @@ package lib
|
|||
import (
|
||||
"database/sql"
|
||||
"fmt"
|
||||
"log"
|
||||
"time"
|
||||
|
||||
"github.com/bwmarrin/discordgo"
|
||||
|
@ -39,6 +40,13 @@ func ProcessMessage(s *discordgo.Session, m *discordgo.MessageCreate) error {
|
|||
var userID int
|
||||
err := DBClient.QueryRow("SELECT id FROM users WHERE discord_id = ?", m.Author.ID).Scan(&userID)
|
||||
if err != nil {
|
||||
// Store user in database
|
||||
dbErr := StoreUser(m.Author.ID, m.Author.Username)
|
||||
if dbErr != nil {
|
||||
// Log the error but don't stop command execution
|
||||
log.Printf("Error storing user: %v", dbErr)
|
||||
}
|
||||
|
||||
return fmt.Errorf("failed to get user: %w", err)
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue