Browse Source

Fix RetrieveVerification

master
Gregory Rudolph 3 years ago
parent
commit
80746f5bff
Signed by: rudi
GPG Key ID: EF64F3CBD1A1EBDD
  1. 8
      commands.go

8
commands.go

@ -135,14 +135,12 @@ func BumpSet(b BotCommand) bool {
func RetrieveVerification(b BotCommand) bool { func RetrieveVerification(b BotCommand) bool {
defer log.PanicSafe() defer log.PanicSafe()
s := b.Session
m := b.Message
discordId := b.Parts[0] discordId := b.Parts[0]
_, err := strconv.Atoi(discordId) _, err := strconv.Atoi(discordId)
if err != nil { if err != nil {
discordId = idFromUsername(discordId) discordId = idFromUsername(discordId)
} }
user, err := s.GuildMember(config.GuildID, discordId) user, err := b.Session.GuildMember(config.GuildID, discordId)
if err != nil { if err != nil {
log.LogErrorType(err) log.LogErrorType(err)
return false return false
@ -154,7 +152,7 @@ func RetrieveVerification(b BotCommand) bool {
return false return false
} }
if len(matches) != 1 { 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 return false
} }
@ -164,7 +162,7 @@ func RetrieveVerification(b BotCommand) bool {
return false return false
} }
msg := fmt.Sprintf("``` %+v\nJoined: %+v\n```", user.User.Username, user.JoinedAt) 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 return true
} }

Loading…
Cancel
Save