Advertisement
Terror_nisse

Untitled

Jul 12th, 2023
1,079
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 3.55 KB | None | 0 0
  1.         private static async Task<Embed> ApplicationEmbed(ulong channelID)
  2.         {
  3.             //var j = "\u1cbc\u1cbc\u1cbc\u1cbc\u1cbc<:joiner_small:1072887158874062958>";
  4.             var j = "\u1cbc\u1cbc\u1cbc\u1cbc\u1cbc:regional_indicator_a:";
  5.             Console.WriteLine("embedbuilder");
  6.             var average = await GetAverageTime();
  7.             var unix = DateTimeOffset.UtcNow.ToUnixTimeSeconds();
  8.             Console.WriteLine("Average seconds " + average.average + " | Last 1hr: " + average.averageHr);
  9.             var application = await GetApplication(channelID);
  10.             var user = await _client!.GetUserAsync(application.UserID);
  11.             if (application == null || average == null || user == null)
  12.             {
  13.                 Console.WriteLine("Didn't pass null checks on embedbuilder. - " + $"Application: {application ?? null}, Average: {average ?? null}, User: {user ?? null}");
  14.                 return null!;
  15.             }
  16.             var stats = await GetStats(playerName: application.a1!);
  17.  
  18.             var embedBuilder = new EmbedBuilder();
  19.  
  20.             embedBuilder.WithTitle($":wave: Hey {(user.GlobalName ?? user.Username)}, welcome to **Rs Burnt**!");
  21.  
  22.             embedBuilder.WithThumbnailUrl(user.GetAvatarUrl() ?? user.GetDefaultAvatarUrl());
  23.  
  24.             embedBuilder.WithDescription($"Thank you for submitting an application. An <@&{_settings["moderatorRole"]}> or <@&{_settings["helperRole"]}> will be with you shortly to give you full access to the discord");
  25.  
  26.             double a = average.average;
  27.             double aH = average.averageHr;
  28.  
  29.             embedBuilder.AddField("**Average staff response time(All time):**", a > 0 ? $"{TimeSpan.FromSeconds(a).Humanize(3)} (<t:{(ulong)unix + a}:R>)\n" : "No data.");
  30.             embedBuilder.AddField("**Average staff response time(Last 1hr):**", aH > 0 ? $"{TimeSpan.FromSeconds(aH).Humanize(3)} (<t:{(ulong)unix + aH}:R>)\n" : "No data.");
  31.             embedBuilder.AddField("**Questions/Answers:**", "** **");
  32.             /*embedBuilder.AddField("1. :regional_indicator_q: What is your RuneScape in-game name?", $"{j} `{application.a1}` ({(stats ? ":white_check_mark:Stats found" : ":x:Stats not found")})");
  33.             embedBuilder.AddField("2. :regional_indicator_q: How did you find out about the discord?", $"{j} `{application.a2}`");
  34.             embedBuilder.AddField("3. :regional_indicator_q: Do you collect or resell?", $"{j} `{application.a3}`");
  35.             embedBuilder.AddField("4. :regional_indicator_q: Did you read, and agree to follow the rules?", $"{j} `{application.a4}`");
  36.             embedBuilder.AddField("5. :regional_indicator_q: In your own words, what is rule #3 about?", $"{j} `{application.a5}`\n");*/
  37.  
  38.             embedBuilder.AddField("1.", $">>> :regional_indicator_q: **What is your RuneScape in-game name?**\n:regional_indicator_a: `{application.a1}` ({(stats ? ":white_check_mark:Stats found" : ":x:Stats not found")})");
  39.             embedBuilder.AddField("2.", $">>> :regional_indicator_q: **How did you find out about the discord?**\n:regional_indicator_a: `{application.a2}`");
  40.             embedBuilder.AddField("3.", $">>> :regional_indicator_q: **Do you collect or resell?**\n:regional_indicator_a: `{application.a3}`");
  41.             embedBuilder.AddField("4.", $">>> :regional_indicator_q: **Did you read, and agree to follow the rules?**\n:regional_indicator_a: `{application.a4}`");
  42.             embedBuilder.AddField("5.", $">>> :regional_indicator_q: **In your own words, what is rule #3 about?**\n:regional_indicator_a: `{application.a5}`\n");
  43.  
  44.             embedBuilder.AddField("** **", ":arrow_down: _If you need to edit your answers, click one of the buttons below_");
  45.             //.WithFooter(":arrow_down: _If you need to edit your answers, click the button below_")
  46.             embedBuilder.WithColor(Color.Blue);
  47.  
  48.             return await Task.FromResult(embedBuilder.Build());
  49.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement