Beispiel #1
0
        public void SetHypesquad(HypesquadHouse house)
        {
            if (house == HypesquadHouse.None)
            {
                Client.HttpClient.Delete("/hypesquad/online");
            }

            Client.HttpClient.Post("/hypesquad/online",
                                   JsonConvert.SerializeObject(new Hypesquad()
            {
                House = house
            }));
        }
Beispiel #2
0
        public static bool SetHypesquad(this DiscordClient client, HypesquadHouse house)
        {
            //the request protocol is different if we don't want any hypesquad
            if (house == HypesquadHouse.None)
            {
                return(client.HttpClient.Post("/hypesquad/online", JsonConvert.SerializeObject(new Hypesquad()
                {
                    House = house
                })).StatusCode == HttpStatusCode.NoContent);
            }

            return(client.HttpClient.Post("/hypesquad/online", JsonConvert.SerializeObject(new Hypesquad()
            {
                House = house
            })).StatusCode == HttpStatusCode.NoContent);
        }