docs, provide genuine existence return for GetCode getter func

This commit is contained in:
2024-06-09 22:25:41 -05:00
parent 6453955d96
commit b964bfc565
2 changed files with 10 additions and 4 deletions

View File

@@ -204,9 +204,9 @@ func RegisterCommandHandler(session *discordgo.Session, interaction *discordgo.I
if !guestCodeProvided && guestCodeCondition == GuestCodeNotRequired {
// A guest code could be stored, so check for it.
log.WithField("location", locationId).Debug("No guest code provided for location, but one is not required. Checking for stored code.")
code = GetCode(int64(locationId), int(userId))
code, ok := GetCode(int64(locationId), int(userId))
if code == "" {
if !ok {
// No code was stored, error out.
HandleError(session, interaction, nil, ":x: This location requires a guest code.")
return