Skip to content

Commit

Permalink
Trim nick whitespace when looking up the guild members (discord) (#2072)
Browse files Browse the repository at this point in the history
this fixes the matching to attempt to find avatars

fixes #2059
  • Loading branch information
bsstephan authored May 23, 2024
1 parent 2e9db32 commit 6edd5de
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bridge/discord/helpers.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ func (b *Bdiscord) getGuildMemberByNick(nick string) (*discordgo.Member, error)
b.membersMutex.RLock()
defer b.membersMutex.RUnlock()

if member, ok := b.nickMemberMap[nick]; ok {
if member, ok := b.nickMemberMap[strings.TrimSpace(nick)]; ok {
return member, nil
}
return nil, errors.New("Couldn't find guild member with nick " + nick) // This will most likely get ignored by the caller
Expand Down

0 comments on commit 6edd5de

Please sign in to comment.