示例#1
0
 public Reaction CreateReaction(ReactionCreationProperties properties)
 {
     return(Client.CreateGuildReaction(Id, properties));
 }
示例#2
0
        public static Reaction CreateGuildReaction(this DiscordClient client, long guildId, ReactionCreationProperties properties)
        {
            var resp = client.HttpClient.Post($"/guilds/{guildId}/emojis", JsonConvert.SerializeObject(properties));

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

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

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