diff --git a/src/Disqord.Core/Entities/Core/Emoji/IGuildEmoji.cs b/src/Disqord.Core/Entities/Core/Emoji/IGuildEmoji.cs index d5cef812e..4085deddf 100644 --- a/src/Disqord.Core/Entities/Core/Emoji/IGuildEmoji.cs +++ b/src/Disqord.Core/Entities/Core/Emoji/IGuildEmoji.cs @@ -16,7 +16,7 @@ public interface IGuildEmoji : ICustomEmoji, IGuildEntity, IClientEntity, INamab /// /// Gets the user that created this emoji. /// - IUser Creator { get; } + IUser? Creator { get; } /// /// Gets whether this emoji requires colons in chat. diff --git a/src/Disqord.Core/Entities/Transient/Emoji/TransientGuildEmoji.cs b/src/Disqord.Core/Entities/Transient/Emoji/TransientGuildEmoji.cs index 8ca9acf2f..20705da30 100644 --- a/src/Disqord.Core/Entities/Transient/Emoji/TransientGuildEmoji.cs +++ b/src/Disqord.Core/Entities/Transient/Emoji/TransientGuildEmoji.cs @@ -1,5 +1,6 @@ using System.Collections.Generic; using Disqord.Models; +using Qommon; namespace Disqord; @@ -21,7 +22,7 @@ public class TransientGuildEmoji : TransientClientEntity, IGuild public IReadOnlyList RoleIds => Model.Roles.Value; /// - public IUser Creator => _creator ??= new TransientUser(Client, Model.User.Value); + public IUser? Creator => _creator ??= Optional.ConvertOrDefault(Model.User, static (user, client) => new TransientUser(client, user), Client); private IUser? _creator;