From 430b8be8f5ee203221cd3cbc00ee69bf4102edf8 Mon Sep 17 00:00:00 2001 From: Luther Wen Xu Date: Fri, 18 Oct 2019 23:56:14 +0800 Subject: [PATCH] go: discord/backend: Use RequestGuildMembers as suggested by the Gopher Discord server --- GoBot/discord/backend/members.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/GoBot/discord/backend/members.go b/GoBot/discord/backend/members.go index 1e1c182..c18e27c 100644 --- a/GoBot/discord/backend/members.go +++ b/GoBot/discord/backend/members.go @@ -13,6 +13,10 @@ import ( var ErrMemberNotFound = errors.New("discord/backend: the requested member was not found") func GetAllMembers(s *discordgo.Session) ([]*discordgo.Member, error) { + err := s.RequestGuildMembers(config.GuildID, "", 0) + if err != nil { + return nil, err + } guild, err := s.State.Guild(config.GuildID) if err != nil { guild, err = s.Guild(config.GuildID)