Exemplo n.º 1
0
        internal static RestEmote Create(BaseTwitchClient client, Model model)
        {
            var entity = new RestEmote(client, model.Id);

            entity.Update(model);
            return(entity);
        }
Exemplo n.º 2
0
        internal static async Task <IReadOnlyDictionary <string, IEnumerable <RestEmote> > > GetEmotesAsync(BaseRestClient client, ulong userId)
        {
            var token = TokenHelper.GetSingleToken(client);
            var model = await client.RestClient.GetEmotesInternalAsync(token, userId);

            var entity = model.Emotes.Select(x =>
            {
                var values = x.Value.Select(y =>
                {
                    var emote = new RestEmote(client, y.Id);
                    emote.Update(y);
                    return(emote);
                });
                return(new KeyValuePair <string, IEnumerable <RestEmote> >(x.Key, values));
            });

            return(entity.ToDictionary(x => x.Key, x => x.Value));
        }