|
|
@ -24,7 +24,17 @@ func GetAllMembers(s *discordgo.Session) ([]*discordgo.Member, error) {
|
|
|
|
if err != nil {
|
|
|
|
if err != nil {
|
|
|
|
return nil, err
|
|
|
|
return nil, err
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return guild.Members, nil
|
|
|
|
//TODO Deduplication hack until discordgo fixes this.
|
|
|
|
|
|
|
|
deduplicationCache := make(map[string]bool)
|
|
|
|
|
|
|
|
dedupedArray := make([]*discordgo.Member, 0)
|
|
|
|
|
|
|
|
for _, v := range guild.Members {
|
|
|
|
|
|
|
|
if deduplicationCache[v.User.ID] {
|
|
|
|
|
|
|
|
continue
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
dedupedArray = append(dedupedArray, v)
|
|
|
|
|
|
|
|
deduplicationCache[v.User.ID] = true
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return dedupedArray, nil
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
func GetMemberFromUserFriendlyName(s *discordgo.Session, user string) (*discordgo.Member, error) {
|
|
|
|
func GetMemberFromUserFriendlyName(s *discordgo.Session, user string) (*discordgo.Member, error) {
|
|
|
|