public static string GetUrl(this ICustomEmoji emoji) { return(string.Format( EMOJI_URL, emoji.Id, emoji.IsAnimated ? "gif" : "png" )); }
public int GetHashCode(ICustomEmoji obj) { if (obj == null) { throw new ArgumentNullException(nameof(obj)); } return(obj.Id.GetHashCode()); }
public static string GetUrl(this ICustomEmoji emoji, CdnAssetFormat format = default, int?size = null) { if (format == CdnAssetFormat.Automatic) { format = emoji.IsAnimated ? CdnAssetFormat.Gif : CdnAssetFormat.Png; } return(Discord.Cdn.GetCustomEmojiUrl(emoji.Id, format, size)); }
public bool Equals(ICustomEmoji x, ICustomEmoji y) { if (x == null && y == null) { return(true); } if (x == null || y == null) { return(false); } return(x.Id == y.Id); }
public bool Equals(ICustomEmoji other) => Comparers.Emoji.Equals(this, other);
public async ValueTask AddEmoteAsync(ICustomEmoji emoji) => await AddEmoteAsync(emoji.Name, Discord.Cdn.GetCustomEmojiUrl(emoji.Id, emoji.IsAnimated, 128));
public async ValueTask AddEmoteAsync([Regex(Global.EmoteNameRegex)] string name, ICustomEmoji emoji) => await AddEmoteAsync(name, Discord.Cdn.GetCustomEmojiUrl(emoji.Id, emoji.IsAnimated, 128));