@@ -118,8 +118,6 @@ namespace Discord | |||||
/// <summary> Removes all users from this guild if they have not logged on in a provided number of days or, if simulate is true, returns the number of users that would be removed. </summary> | /// <summary> Removes all users from this guild if they have not logged on in a provided number of days or, if simulate is true, returns the number of users that would be removed. </summary> | ||||
Task<int> PruneUsersAsync(int days = 30, bool simulate = false, RequestOptions options = null); | Task<int> PruneUsersAsync(int days = 30, bool simulate = false, RequestOptions options = null); | ||||
/// <summary> Gets a collection of all emotes in this guild. </summary> | |||||
Task<IReadOnlyCollection<GuildEmote>> ListEmotesAsync(RequestOptions options = null); | |||||
/// <summary> Gets a specific emote from this guild. </summary> | /// <summary> Gets a specific emote from this guild. </summary> | ||||
Task<GuildEmote> GetEmoteAsync(ulong id, RequestOptions options = null); | Task<GuildEmote> GetEmoteAsync(ulong id, RequestOptions options = null); | ||||
/// <summary> Creates a new emote in this guild. </summary> | /// <summary> Creates a new emote in this guild. </summary> | ||||
@@ -1067,15 +1067,6 @@ namespace Discord.API | |||||
} | } | ||||
//Guild emoji | //Guild emoji | ||||
public async Task<IReadOnlyCollection<Emoji>> ListGuildEmotesAsync(ulong guildId, RequestOptions options = null) | |||||
{ | |||||
Preconditions.NotEqual(guildId, 0, nameof(guildId)); | |||||
options = RequestOptions.CreateOrClone(options); | |||||
var ids = new BucketIds(guildId: guildId); | |||||
return await SendAsync<IReadOnlyCollection<Emoji>>("GET", () => $"guilds/{guildId}/emojis", ids, options: options); | |||||
} | |||||
public async Task<Emoji> GetGuildEmoteAsync(ulong guildId, ulong emoteId, RequestOptions options = null) | public async Task<Emoji> GetGuildEmoteAsync(ulong guildId, ulong emoteId, RequestOptions options = null) | ||||
{ | { | ||||
Preconditions.NotEqual(guildId, 0, nameof(guildId)); | Preconditions.NotEqual(guildId, 0, nameof(guildId)); | ||||
@@ -255,14 +255,6 @@ namespace Discord.Rest | |||||
} | } | ||||
//Emotes | //Emotes | ||||
public static async Task<IReadOnlyCollection<GuildEmote>> ListEmotesAsync(IGuild guild, BaseDiscordClient client, RequestOptions options) | |||||
{ | |||||
var model = await client.ApiClient.ListGuildEmotesAsync(guild.Id, options); | |||||
var emotes = ImmutableArray.CreateBuilder<GuildEmote>(model.Count); | |||||
foreach (var xm in model) | |||||
emotes.Add(xm.ToEntity()); | |||||
return emotes; | |||||
} | |||||
public static async Task<GuildEmote> GetEmoteAsync(IGuild guild, BaseDiscordClient client, ulong id, RequestOptions options) | public static async Task<GuildEmote> GetEmoteAsync(IGuild guild, BaseDiscordClient client, ulong id, RequestOptions options) | ||||
{ | { | ||||
var emote = await client.ApiClient.GetGuildEmoteAsync(guild.Id, id, options); | var emote = await client.ApiClient.GetGuildEmoteAsync(guild.Id, id, options); | ||||
@@ -261,8 +261,6 @@ namespace Discord.Rest | |||||
private string DebuggerDisplay => $"{Name} ({Id})"; | private string DebuggerDisplay => $"{Name} ({Id})"; | ||||
//Emotes | //Emotes | ||||
public Task<IReadOnlyCollection<GuildEmote>> ListEmotesAsync(RequestOptions options = null) | |||||
=> GuildHelper.ListEmotesAsync(this, Discord, options); | |||||
public Task<GuildEmote> GetEmoteAsync(ulong id, RequestOptions options = null) | public Task<GuildEmote> GetEmoteAsync(ulong id, RequestOptions options = null) | ||||
=> GuildHelper.GetEmoteAsync(this, Discord, id, options); | => GuildHelper.GetEmoteAsync(this, Discord, id, options); | ||||
public Task<GuildEmote> CreateEmoteAsync(string name, Image image, Optional<IEnumerable<IRole>> roles = default(Optional<IEnumerable<IRole>>), RequestOptions options = null) | public Task<GuildEmote> CreateEmoteAsync(string name, Image image, Optional<IEnumerable<IRole>> roles = default(Optional<IEnumerable<IRole>>), RequestOptions options = null) | ||||
@@ -434,8 +434,6 @@ namespace Discord.WebSocket | |||||
} | } | ||||
//Emotes | //Emotes | ||||
public Task<IReadOnlyCollection<GuildEmote>> ListEmotesAsync(RequestOptions options = null) | |||||
=> GuildHelper.ListEmotesAsync(this, Discord, options); | |||||
public Task<GuildEmote> GetEmoteAsync(ulong id, RequestOptions options = null) | public Task<GuildEmote> GetEmoteAsync(ulong id, RequestOptions options = null) | ||||
=> GuildHelper.GetEmoteAsync(this, Discord, id, options); | => GuildHelper.GetEmoteAsync(this, Discord, id, options); | ||||
public Task<GuildEmote> CreateEmoteAsync(string name, Image image, Optional<IEnumerable<IRole>> roles = default(Optional<IEnumerable<IRole>>), RequestOptions options = null) | public Task<GuildEmote> CreateEmoteAsync(string name, Image image, Optional<IEnumerable<IRole>> roles = default(Optional<IEnumerable<IRole>>), RequestOptions options = null) | ||||