4
0
mirror of https://github.com/cwinfo/matterbridge.git synced 2025-06-25 18:49:23 +00:00

Trim nick whitespace when looking up the guild members (discord) (#2072)

this fixes the matching to attempt to find avatars

fixes #2059
This commit is contained in:
Brian S. Stephan
2024-05-23 17:19:31 -05:00
committed by GitHub
parent 2e9db32a83
commit 6edd5de3b7

View File

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