From dd93758b0e9d2d44bd807123a4a435acdd18538d Mon Sep 17 00:00:00 2001 From: Violet Scheen Date: Tue, 3 Oct 2023 23:59:42 -0400 Subject: [PATCH] Update discord.go --- discord.go | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/discord.go b/discord.go index 2a9029f..fc7a74f 100644 --- a/discord.go +++ b/discord.go @@ -551,8 +551,11 @@ func (d *DiscordDaemon) cmdInvite(s *dg.Session, i *dg.InteractionCreate, lang s // expmin = mins //} // Need to check whether requestor is linked to the admin account *possibly add Admin bool to DiscordUser struct - requestoremail := d.app.storage.GetEmailsKey(requestor.JellyfinID) - if !requestoremail.admin { + requestoremail, ok := d.app.storage.GetEmailsKey(requestor.JellyfinID) + if !ok { + d.app.err.Printf("Failed to verify admin") + } + if !requestoremail.Admin { d.app.err.Printf("User is not admin") } // variation of app.GenerateInvite, some parts commented to potentially add back in later with the other options