Esempio n. 1
0
        public Reaction Modify(ReactionModProperties properties)
        {
            Reaction reaction = Client.ModifyGuildReaction(GuildId, Id, properties);

            Name = reaction.Name;
            return(reaction);
        }
Esempio n. 2
0
        public static Reaction ModifyGuildReaction(this DiscordClient client, long guildId, long reactionId, ReactionModProperties properties)
        {
            var resp = client.HttpClient.Patch($"/guilds/{guildId}/emojis/{reactionId}", JsonConvert.SerializeObject(properties));

            if (resp.StatusCode == HttpStatusCode.NotFound)
            {
                throw new ReactionNotFoundException(client, guildId, reactionId);
            }

            Reaction reaction = JsonConvert.DeserializeObject <Reaction>(resp.Content.ReadAsStringAsync().Result);

            reaction.Client = client;
            return(reaction);
        }