diff --git a/Events/ReadyEvent.cs b/Events/ReadyEvent.cs index 33cb1ca..9e44161 100644 --- a/Events/ReadyEvent.cs +++ b/Events/ReadyEvent.cs @@ -7,9 +7,6 @@ public static async Task OnReady(DiscordClient client, SessionCreatedEventArgs e await Task.Run(async () => { Program.ConnectTime = DateTime.Now; - - await Program.HomeChannel.SendMessageAsync(await DebugInfoHelpers.GenerateDebugInfoEmbed(true)); - await ActivityTasks.SetActivityAsync(); }); } diff --git a/Helpers/DebugInfoHelpers.cs b/Helpers/DebugInfoHelpers.cs index 2f78f60..c5105a3 100644 --- a/Helpers/DebugInfoHelpers.cs +++ b/Helpers/DebugInfoHelpers.cs @@ -41,7 +41,7 @@ public static DebugInfo GetDebugInfo() } // If provided a DebugInfo object, use that... - private static Task GenerateDebugInfoEmbed(DebugInfo debugInfo, bool isOnReadyEvent) + private static Task GenerateDebugInfoEmbed(DebugInfo debugInfo, bool isOnStartup) { // Check whether GuildDownloadCompleted has been fired yet // If not, wait until it has @@ -50,7 +50,7 @@ private static Task GenerateDebugInfoEmbed(DebugInfo debugInfo, bo DiscordEmbedBuilder embed = new() { - Title = isOnReadyEvent ? "Connected!" : "", + Title = isOnStartup ? "Connected!" : "", Color = Program.BotColor }; @@ -64,7 +64,7 @@ private static Task GenerateDebugInfoEmbed(DebugInfo debugInfo, bo embed.AddField("Library", debugInfo.Library, true); embed.AddField("Server Count", Program.Discord.Guilds.Count.ToString(), true); embed.AddField("Command Count", Program.ApplicationCommands.Count.ToString(), true); - if (isOnReadyEvent) embed.AddField("Time Since Process Start", debugInfo.TimeSinceProcessStart, true); + if (isOnStartup) embed.AddField("Time Since Process Start", debugInfo.TimeSinceProcessStart, true); embed.AddField("Commit Hash", commitHash, true); embed.AddField(debugInfo.CommitTimeDescription, debugInfo.CommitTimestamp, true); embed.AddField("Commit Message", debugInfo.CommitMessage); @@ -73,9 +73,9 @@ private static Task GenerateDebugInfoEmbed(DebugInfo debugInfo, bo } // ...otherwise, get debug info manually - public static async Task GenerateDebugInfoEmbed(bool isOnReadyEvent) + public static async Task GenerateDebugInfoEmbed(bool isOnStartup) { - return await GenerateDebugInfoEmbed(GetDebugInfo(), isOnReadyEvent); + return await GenerateDebugInfoEmbed(GetDebugInfo(), isOnStartup); } diff --git a/Program.cs b/Program.cs index 9fb25be..8ad168c 100644 --- a/Program.cs +++ b/Program.cs @@ -282,6 +282,9 @@ internal static async Task Main() #if !DEBUG await EvalCommands.RunCommand("cat /app/id_ed25519 > ~/.ssh/id_ed25519 && chmod 700 ~/.ssh/id_ed25519"); #endif + + // Send startup message + await Program.HomeChannel.SendMessageAsync(await DebugInfoHelpers.GenerateDebugInfoEmbed(true)); // Run tasks