mirror of https://github.com/velour/catbase.git
discord: cripple but fix the who function
This commit is contained in:
parent
5773141b1c
commit
9585ac6c23
|
@ -154,15 +154,12 @@ func (d *Discord) GetEmojiList() map[string]string {
|
||||||
return emojis
|
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 {
|
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{}
|
users := []string{}
|
||||||
for _, u := range ch.Recipients {
|
for name, _ := range d.uidCache {
|
||||||
users = append(users, u.Username)
|
users = append(users, name)
|
||||||
}
|
}
|
||||||
return users
|
return users
|
||||||
}
|
}
|
||||||
|
@ -182,7 +179,6 @@ func (d *Discord) Profile(id string) (user.User, error) {
|
||||||
}
|
}
|
||||||
user := d.convertUser(u)
|
user := d.convertUser(u)
|
||||||
d.uidCache[user.Name] = user.ID
|
d.uidCache[user.Name] = user.ID
|
||||||
d.uidCache[user.ID] = user.Name
|
|
||||||
return *user, nil
|
return *user, nil
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue