Example #1
0
 public Task ResentDaily()
 {
     return(Task.Run(() =>
     {
         var queueApi = DIManager.Services.GetRequiredService <IFortniteQueueApi>();
         var dailyllama = queueApi.DailyLlama().ToList();
         FortniteEventHandler.DailyLlamaWebhook(Context.Guild.Id, Context.GuildConfig, new List <Embed>()
         {
             dailyllama.ToWebhookEmbed()
         }).Wait();
     }));
 }
Example #2
0
 public Task ResentAllDaily()
 {
     return(Task.Run(async() =>
     {
         var partners = Context.Repo.Priority.GetValidGuildPartners();
         int count = 0;
         var queueApi = DIManager.Services.GetRequiredService <IFortniteQueueApi>();
         var dEmbedList = queueApi.DailyLlama().ToList();
         if (dEmbedList.Count > 0)
         {
             foreach (var partner in partners)
             {
                 try
                 {
                     var gConfig = Context.Repo.Guild.GetConfig(partner.Id);
                     if (gConfig == null)
                     {
                         continue;
                     }
                     FortniteEventHandler.DailyLlamaWebhook(partner.GetUlongId(), gConfig, new List <Embed>()
                     {
                         dEmbedList.ToWebhookEmbed()
                     }).Wait();
                     count++;
                 }
                 catch (Exception e)
                 {
                 }
             }
             await ReplyEmbedAsync($"({dEmbedList.Count()})DailyLlamas are sent to premium discords({count}).");
         }
         else
         {
             await ReplyEmbedErrorAsync($"there is no DaillyLama right now.");
         }
     }));
 }