diff --git a/GoBot/discord/backend/members.go b/GoBot/discord/backend/members.go index 0a4af6c..754b6e2 100644 --- a/GoBot/discord/backend/members.go +++ b/GoBot/discord/backend/members.go @@ -6,6 +6,7 @@ import ( "github.com/bwmarrin/discordgo" + "TerraOceanBot/db" "TerraOceanBot/discord/config" ) @@ -59,5 +60,17 @@ func GetMemberFromUserFriendlyName(s *discordgo.Session, user string) (*discordg return v, nil } } + for _, v := range allMembers { + mcUsername, err := db.GetMinecraftUsername(v.User.ID) + if err == db.ErrNotFound { + continue + } + if err != nil { + return nil, err + } + if mcUsername == user { + return v, nil + } + } return nil, ErrMemberNotFound }