func (r *Resource) VoiceRegions(ctx context.Context) ([]discord.VoiceRegion, error) {
	e := endpoint.GetGuildVoiceRegions(r.guildID)
	resp, err := r.client.Do(ctx, e, nil)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	if resp.StatusCode != http.StatusOK {
		return nil, discord.NewAPIError(resp)
	}
	var regions []discord.VoiceRegion
	if err = json.NewDecoder(resp.Body).Decode(&regions); err != nil {
		return nil, err
	}
	return regions, nil
}
VoiceRegions returns a list of available voice regions for the guild.
Unlike the similar VoiceRegions method of the Client, this returns VIP
servers when the guild is VIP-enabled.
package guild
import (
	"context"
	"encoding/json"
	"net/http"
	"net/url"
	"strconv"
	"github.com/skwair/harmony/discord"
	"github.com/skwair/harmony/internal/endpoint"
	"github.com/skwair/harmony/internal/rest"
)
func (r *Resource) Get(ctx context.Context) (*discord.Guild, error) {
	e := endpoint.GetGuild(r.guildID)
	resp, err := r.client.Do(ctx, e, nil)
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	if resp.StatusCode != http.StatusOK {
		return nil, discord.NewAPIError(resp)
	}
	var g discord.Guild
	if err = json.NewDecoder(resp.Body).Decode(&g); err != nil {
		return nil, err
	}
	return &g, nil
}
func (r *Resource) Modify(ctx context.Context, settings *discord.GuildSettings) (*discord.Guild, error) {
	return r.ModifyWithReason(ctx, settings, "")
}
func (r *Resource) ModifyWithReason(ctx context.Context, settings *discord.GuildSettings, reason string) (*discord.Guild, error) {
	b, err := json.Marshal(settings)
	if err != nil {
		return nil, err
	}
	e := endpoint.ModifyGuild(r.guildID)
	resp, err := r.client.DoWithHeader(ctx, e, rest.JSONPayload(b), rest.ReasonHeader(reason))
	if err != nil {
		return nil, err
	}
	defer resp.Body.Close()
	if resp.StatusCode != http.StatusOK {
		return nil, discord.NewAPIError(resp)
	}
	var g discord.Guild
	if err = json.NewDecoder(resp.Body).Decode(&g); err != nil {
		return nil, err
	}
	return &g, nil
}
func (r *Resource) Delete(ctx context.Context) error {
	e := endpoint.DeleteGuild(r.guildID)
	resp, err := r.client.Do(ctx, e, nil)
	if err != nil {
		return err
	}
	defer resp.Body.Close()
	if resp.StatusCode != http.StatusNoContent {
		return discord.NewAPIError(resp)
	}
	return nil
}
func (r *Resource) ChangeNick(ctx context.Context, name string) (string, error) {
	st := struct {
		Nick string `json:"nick"`
	}{
		Nick: name,
	}
	b, err := json.Marshal(st)
	if err != nil {
		return "", err
	}
	e := endpoint.ModifyCurrentUserNick(r.guildID)
	resp, err := r.client.Do(ctx, e, rest.JSONPayload(b))
	if err != nil {
		return "", err
	}
	defer resp.Body.Close()
	if resp.StatusCode != http.StatusOK {
		return "", discord.NewAPIError(resp)
	}
	return st.Nick, nil
}
func (r *Resource) PruneCount(ctx context.Context, days int) (int, error) {
	if days < 1 {
		days = 1
	}
	q := url.Values{}
	q.Set("days", strconv.Itoa(days))
	e := endpoint.GetGuildPruneCount(r.guildID, q.Encode())
	resp, err := r.client.Do(ctx, e, nil)
	if err != nil {
		return 0, err
	}
	defer resp.Body.Close()
	if resp.StatusCode != http.StatusOK {
		return 0, discord.NewAPIError(resp)
	}
	st := struct {
		Pruned int `json:"pruned"`
	}{}
	if err = json.NewDecoder(resp.Body).Decode(&st); err != nil {
		return 0, err
	}
	return st.Pruned, nil
}
func (r *Resource) BeginPrune(ctx context.Context, days int, computePruneCount bool) (pruneCount int, err error) {
	return r.BeginPruneWithReason(ctx, days, computePruneCount, "")
}
func (r *Resource) BeginPruneWithReason(ctx context.Context, days int, computePruneCount bool, reason string) (pruneCount int, err error) {
	if days < 1 {
		days = 1
	}
	q := url.Values{}
	q.Set("days", strconv.Itoa(days))
	q.Set("compute_prune_count", strconv.FormatBool(computePruneCount))
	e := endpoint.BeginGuildPrune(r.guildID, q.Encode())
	resp, err := r.client.DoWithHeader(ctx, e, nil, rest.ReasonHeader(reason))
	if err != nil {
		return 0, err
	}
	defer resp.Body.Close()
	if resp.StatusCode != http.StatusOK {
		return 0, discord.NewAPIError(resp)
	}
	var st struct {
		Pruned *int `json:"pruned"`
	}
	if err = json.NewDecoder(resp.Body).Decode(&st); err != nil {
		return 0, err
	}
	if st.Pruned != nil {
		pruneCount = *st.Pruned
	}
	return pruneCount, nil
}