コード例 #1
0
ファイル: RestEmote.cs プロジェクト: kouweizhong/NTwitch
        internal static RestEmote Create(BaseTwitchClient client, Model model)
        {
            var entity = new RestEmote(client, model.Id);

            entity.Update(model);
            return(entity);
        }
コード例 #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));
        }