BotVentic.Program.UpdateFFZEmotes C# (CSharp) Method

UpdateFFZEmotes() private static method

Update the list of FrankerFaceZ emoticons
private static UpdateFFZEmotes ( List e ) : Task
e List
return Task
        private static async Task UpdateFFZEmotes(List<EmoteInfo> e)
        {
            var emotes = JsonConvert.DeserializeObject<FFZEmoticonSets>(await RequestAsync("http://api.frankerfacez.com/v1/set/global"));

            if (emotes == null || emotes.Sets == null || emotes.Sets.Values == null)
            {
                Console.WriteLine("Error loading ffz emotes");
                return;
            }

            foreach (FFZEmoticonImages set in emotes.Sets.Values)
            {
                if (set != null && set.Emotes != null)
                {
                    foreach (var em in set.Emotes)
                    {
                        e.Add(new EmoteInfo(em.Id, em.Code, EmoteType.Ffz));
                    }
                }
            }
        }