示例#1
0
 /// <summary>
 /// Creates an emoji
 /// </summary>
 /// <param name="properties">Options for creating the emoji</param>
 public DiscordEmoji CreateEmoji(EmojiProperties properties)
 {
     return(CreateEmojiAsync(properties).GetAwaiter().GetResult());
 }
示例#2
0
 /// <summary>
 /// Creates an emoji
 /// </summary>
 /// <param name="properties">Options for creating the emoji</param>
 public Emoji CreateEmoji(EmojiProperties properties)
 {
     return(Client.CreateGuildEmoji(Id, properties));
 }
示例#3
0
 public async Task <DiscordEmoji> CreateEmojiAsync(EmojiProperties properties)
 {
     return(await Client.CreateEmojiAsync(Id, properties));
 }
示例#4
0
        /// <summary>
        /// Creates an emoji
        /// </summary>
        /// <param name="guildId">ID of the guild</param>
        /// <param name="properties">Options for creating the emoji</param>
        /// <returns>The created <see cref="Emoji"/></returns>
        public static Emoji CreateGuildEmoji(this DiscordClient client, ulong guildId, EmojiProperties properties)
        {
            Emoji emoji = client.HttpClient.Post($"/guilds/{guildId}/emojis",
                                                 JsonConvert.SerializeObject(properties)).Deserialize <Emoji>().SetClient(client);

            emoji.GuildId = guildId;
            return(emoji);
        }
示例#5
0
        /// <summary>
        /// Creates an emoji
        /// </summary>
        /// <param name="guildId">ID of the guild</param>
        /// <param name="properties">Options for creating the emoji</param>
        /// <returns>The created <see cref="DiscordEmoji"/></returns>
        public static DiscordEmoji CreateEmoji(this DiscordClient client, ulong guildId, EmojiProperties properties)
        {
            DiscordEmoji emoji = client.HttpClient.Post($"/guilds/{guildId}/emojis", properties).Deserialize <DiscordEmoji>().SetClient(client);

            emoji.GuildId = guildId;
            return(emoji);
        }
示例#6
0
 /// <summary>
 /// Creates an emoji
 /// </summary>
 /// <param name="properties">Options for creating the emoji</param>
 public DiscordEmoji CreateEmoji(EmojiProperties properties)
 {
     return(Client.CreateEmoji(Id, properties));
 }
示例#7
0
        public static async Task <DiscordEmoji> CreateEmojiAsync(this DiscordClient client, ulong guildId, EmojiProperties properties)
        {
            DiscordEmoji emoji = (await client.HttpClient.PostAsync($"/guilds/{guildId}/emojis", properties)).Deserialize <DiscordEmoji>().SetClient(client);

            emoji.GuildId = guildId;
            return(emoji);
        }
示例#8
0
 /// <summary>
 /// Creates an emoji
 /// </summary>
 /// <param name="guildId">ID of the guild</param>
 /// <param name="properties">Options for creating the emoji</param>
 /// <returns>The created <see cref="DiscordEmoji"/></returns>
 public static DiscordEmoji CreateEmoji(this DiscordClient client, ulong guildId, EmojiProperties properties)
 {
     return(client.CreateEmojiAsync(guildId, properties).GetAwaiter().GetResult());
 }