Skip to content

Commit

Permalink
.-.
Browse files Browse the repository at this point in the history
Signed-off-by: Lala Sabathil <[email protected]>
  • Loading branch information
Lulalaby authored Feb 7, 2024
1 parent 29494c1 commit e043604
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions ApplicationCommands/src/Program.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@

namespace DisCatSharp.Examples.ApplicationCommands;

// TODO: rewrite, this is kinda weird
/// <summary>
/// The program.
/// </summary>
Expand Down Expand Up @@ -51,12 +52,6 @@ public static async Task MainAsync(string[] args)

DiscordShardedClient discordShardedClient = new(discordConfiguration);

Log.Logger.Information("Connecting to Discord...");
await discordShardedClient.StartAsync();

// Use the default logger provided for easy reading
discordShardedClient.Logger.LogInformation("Connection success! Logged in as {CurrentUserUsername}#{CurrentUserDiscriminator} ({CurrentUserId})", discordShardedClient.CurrentUser.Username, discordShardedClient.CurrentUser.Discriminator, discordShardedClient.CurrentUser.Id);

// Register a Random class instance now for use later over in RollRandom.cs
ApplicationCommandsConfiguration appCommandsConfiguration = new(new ServiceCollection().AddSingleton<Random>().BuildServiceProvider())
{
Expand Down Expand Up @@ -99,6 +94,14 @@ public static async Task MainAsync(string[] args)
}

discordShardedClient.Logger.LogInformation("Application commands registered successfully");


Log.Logger.Information("Connecting to Discord...");
await discordShardedClient.StartAsync();

// Use the default logger provided for easy reading
discordShardedClient.Logger.LogInformation("Connection success! Logged in as {CurrentUserUsername}#{CurrentUserDiscriminator} ({CurrentUserId})", discordShardedClient.CurrentUser.Username, discordShardedClient.CurrentUser.Discriminator, discordShardedClient.CurrentUser.Id);

// Listen for commands by putting this method to sleep and relying off of DiscordClient's event listeners
await Task.Delay(-1);
}
Expand Down

0 comments on commit e043604

Please sign in to comment.