public static ServerEmoji GetCached(ulong emojiId) { return(FactoryUtils.GetCached(_cache, emojiId)); }
internal static ServerEmoji CreateFromJson(ulong serverId, EmojiJson json, [CanBeNull] object state) { return(FactoryUtils.CreateFromJson(_cache, state, json2 => new ServerEmoji(serverId, json, 1), Populate, json)); }
public static async Task <ServerEmoji> GetAsync(ulong emojiId, ulong serverId, [CanBeNull] Client client) { return(await FactoryUtils.GetAsync <ServerEmoji, EmojiJson, NoSuchEmojiException>(_cache, "Emoji", null, FactoryUtils.ResolveGetter <EmojiJson>(client, c => async id2 => await c.GetServerEmojiJsonAsync(id2, serverId)), json => new ServerEmoji(serverId, json, emojiId), Populate, emojiId)); }
public void Uncache() { FactoryUtils.Uncache(_cache, this); }
public async Task PullUpdateAsync([CanBeNull] Client client) { client = client ?? DiscordEnvironment.CurrentClient; FactoryUtils.ValidateInEnv(client); await FactoryUtils.UpdateAsync(this, null, FactoryUtils.ResolveGetter <EmojiJson>(client, c2 => id => c2.GetServerEmojiJsonAsync(id, ServerId)), Populate); }
public static User GetCached(ulong userId) { return(FactoryUtils.GetCached(_cache, userId)); }
public static async Task <User> GetAsync(ulong userId, [CanBeNull] Client client) { return(await FactoryUtils.GetAsync <User, UserJson, NoSuchUserException>(_cache, "ServerUser", null, FactoryUtils.ResolveGetter <UserJson>(client, c2 => c2.GetUserJsonAsync), json => new User(json), Populate, userId)); }
internal static User CreateFromJson(UserJson json, [CanBeNull] object state) { return(FactoryUtils.CreateFromJson(_cache, state, json2 => new User(json2), Populate, json)); }