From 9585ac6c2318650f3b0562e9968c29589dcec354 Mon Sep 17 00:00:00 2001 From: Chris Sexton Date: Mon, 23 Aug 2021 13:15:26 -0400 Subject: [PATCH] discord: cripple but fix the who function --- connectors/discord/discord.go | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/connectors/discord/discord.go b/connectors/discord/discord.go index 6e41ef6..c0057e9 100644 --- a/connectors/discord/discord.go +++ b/connectors/discord/discord.go @@ -154,15 +154,12 @@ func (d *Discord) GetEmojiList() map[string]string { return emojis } +// Who gets the users in the guild +// Note that the channel ID does not matter in this particular case func (d *Discord) Who(id string) []string { - ch, err := d.client.Channel(id) - if err != nil { - log.Error().Err(err).Msgf("Error getting users") - return []string{} - } users := []string{} - for _, u := range ch.Recipients { - users = append(users, u.Username) + for name, _ := range d.uidCache { + users = append(users, name) } return users } @@ -182,7 +179,6 @@ func (d *Discord) Profile(id string) (user.User, error) { } user := d.convertUser(u) d.uidCache[user.Name] = user.ID - d.uidCache[user.ID] = user.Name return *user, nil }