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 { @@ -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 { @@ -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 { @@ -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
}

Loading…
Cancel
Save