diff --git a/samples/03_sharded_client/Program.cs b/samples/03_sharded_client/Program.cs index f89e0eb3c..048145f9f 100644 --- a/samples/03_sharded_client/Program.cs +++ b/samples/03_sharded_client/Program.cs @@ -27,9 +27,8 @@ namespace _03_sharded_client TotalShards = 2 }; - var services = ConfigureServices(); - _client = new DiscordShardedClient(config); + var services = ConfigureServices(); // The Sharded Client does not have a Ready event. // The ShardReady event is used instead, allowing for individual @@ -37,6 +36,8 @@ namespace _03_sharded_client _client.ShardReady += ReadyAsync; _client.Log += LogAsync; + await services.GetRequiredService().InitializeAsync(); + await _client.LoginAsync(TokenType.Bot, Environment.GetEnvironmentVariable("token")); await _client.StartAsync();