uh yes pls (#2963)

This commit is contained in:
Mihail Gribkov
2024-07-20 23:35:19 +03:00
committed by GitHub
parent 8b6be640c7
commit 26bb789b0a
15 changed files with 254 additions and 11 deletions

View File

@@ -0,0 +1,12 @@
namespace Discord;
/// <summary>
/// Represents the properties for an application emote.
/// </summary>
public class ApplicationEmoteProperties
{
/// <summary>
/// Gets or sets the name of the emote.
/// </summary>
public string Name { get; set; }
}

View File

@@ -12,8 +12,10 @@ namespace Discord
{
/// <inheritdoc />
public string Name { get; }
/// <inheritdoc />
public ulong Id { get; }
/// <summary>
/// Gets whether this emote is animated.
/// </summary>
@@ -21,8 +23,10 @@ namespace Discord
/// A boolean that determines whether or not this emote is an animated one.
/// </returns>
public bool Animated { get; }
/// <inheritdoc />
public DateTimeOffset CreatedAt => SnowflakeUtils.FromSnowflake(Id);
/// <summary>
/// Gets the image URL of this emote.
/// </summary>
@@ -31,6 +35,11 @@ namespace Discord
/// </returns>
public string Url => CDN.GetEmojiUrl(Id, Animated);
/// <summary>
/// Gets the user who created this emote. <see langword="null" /> if not available.
/// </summary>
public IUser User { get; private set; }
/// <summary>
/// Creates a new instance of <see cref="Emote" />.
/// </summary>
@@ -41,6 +50,14 @@ namespace Discord
Animated = animated;
}
internal Emote(ulong id, string name, bool animated = false, IUser user = null)
{
Id = id;
Name = name;
Animated = animated;
User = user;
}
/// <summary>
/// Determines whether the specified emote is equal to the current emote.
/// </summary>

View File

@@ -356,5 +356,30 @@ namespace Discord
/// <param name="entitlementId">The id of the entitlement.</param>
/// <param name="options">The options to be used when sending the request.</param>
Task ConsumeEntitlementAsync(ulong entitlementId, RequestOptions options = null);
/// <summary>
/// Gets an emote for the current application.
/// </summary>
public Task<Emote> GetApplicationEmoteAsync(ulong emoteId, RequestOptions options = null);
/// <summary>
/// Gets all emotes for the current application.
/// </summary>
public Task<IReadOnlyCollection<Emote>> GetApplicationEmotesAsync(RequestOptions options = null);
/// <summary>
/// Modifies an emote for the current application.
/// </summary>
public Task<Emote> ModifyApplicationEmoteAsync(ulong emoteId, Action<ApplicationEmoteProperties> args, RequestOptions options = null);
/// <summary>
/// Creates an emote for the current application.
/// </summary>
public Task<Emote> CreateApplicationEmoteAsync(string name, Image image, RequestOptions options = null);
/// <summary>
/// Deletes an emote for the current application.
/// </summary>
public Task DeleteApplicationEmoteAsync(ulong emoteId, RequestOptions options = null);
}
}