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 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 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)); }