|
|
|
@ -13,12 +13,14 @@ import (
|
|
|
|
|
var ErrMemberNotFound = errors.New("discord/backend: the requested member was not found")
|
|
|
|
|
|
|
|
|
|
func GetAllMembers(s *discordgo.Session) ([]*discordgo.Member, error) {
|
|
|
|
|
for _, guild := range s.State.Guilds {
|
|
|
|
|
if guild.ID == config.GuildID {
|
|
|
|
|
return guild.Members, nil
|
|
|
|
|
guild, err := s.State.Guild(config.GuildID)
|
|
|
|
|
if err != nil {
|
|
|
|
|
guild, err = s.Guild(config.GuildID)
|
|
|
|
|
}
|
|
|
|
|
if err != nil {
|
|
|
|
|
return nil, err
|
|
|
|
|
}
|
|
|
|
|
return nil, ErrMemberNotFound
|
|
|
|
|
return guild.Members, nil
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
func GetMemberFromUserFriendlyName(s *discordgo.Session, user string) (*discordgo.Member, error) {
|
|
|
|
|