From 80746f5bffe091d818ad0beb12ff0f2a5b7afb25 Mon Sep 17 00:00:00 2001 From: Gregory Rudolph Date: Fri, 7 May 2021 08:00:20 -0400 Subject: [PATCH] Fix RetrieveVerification --- commands.go | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/commands.go b/commands.go index c41bba4..e86a51d 100644 --- a/commands.go +++ b/commands.go @@ -135,14 +135,12 @@ func BumpSet(b BotCommand) bool { func RetrieveVerification(b BotCommand) bool { defer log.PanicSafe() - s := b.Session - m := b.Message discordId := b.Parts[0] _, err := strconv.Atoi(discordId) if err != nil { discordId = idFromUsername(discordId) } - user, err := s.GuildMember(config.GuildID, discordId) + user, err := b.Session.GuildMember(config.GuildID, discordId) if err != nil { log.LogErrorType(err) return false @@ -154,7 +152,7 @@ func RetrieveVerification(b BotCommand) bool { return false } if len(matches) != 1 { - s.ChannelMessageSend(m.ChannelID, fmt.Sprintf("Error finding verification for ID %+v", discordId)) + b.Session.ChannelMessageSend(b.Message.ChannelID, fmt.Sprintf("Error finding verification for ID %+v", discordId)) return false } @@ -164,7 +162,7 @@ func RetrieveVerification(b BotCommand) bool { return false } msg := fmt.Sprintf("``` %+v\nJoined: %+v\n```", user.User.Username, user.JoinedAt) - s.ChannelFileSendWithMessage(m.ChannelID, msg, matches[0], verificationImage) + b.Session.ChannelFileSendWithMessage(b.Message.ChannelID, msg, matches[0], verificationImage) return true }