Example #1
0
 public static ServerEmoji GetCached(ulong emojiId)
 {
     return(FactoryUtils.GetCached(_cache, emojiId));
 }
Example #2
0
 internal static ServerEmoji CreateFromJson(ulong serverId, EmojiJson json, [CanBeNull] object state)
 {
     return(FactoryUtils.CreateFromJson(_cache, state, json2 => new ServerEmoji(serverId, json, 1), Populate, json));
 }
Example #3
0
 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));
 }
Example #4
0
 public void Uncache()
 {
     FactoryUtils.Uncache(_cache, this);
 }
Example #5
0
 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);
 }
Example #6
0
 public static User GetCached(ulong userId)
 {
     return(FactoryUtils.GetCached(_cache, userId));
 }
Example #7
0
 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));
 }
Example #8
0
 internal static User CreateFromJson(UserJson json, [CanBeNull] object state)
 {
     return(FactoryUtils.CreateFromJson(_cache, state, json2 => new User(json2), Populate, json));
 }