Skip to content

Commit

Permalink
fix interaction service
Browse files Browse the repository at this point in the history
  • Loading branch information
Zechiax committed Jun 5, 2024
1 parent 3f31717 commit e0b2fe6
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions Asterion/Asterion.cs
Original file line number Diff line number Diff line change
Expand Up @@ -106,9 +106,6 @@ public async Task MainAsync()
logger.LogInformation("Stopping the client");
client.StopAsync().Wait();
logger.LogInformation("Disposing services");
services.DisposeAsync().GetAwaiter().GetResult();
args.Cancel = false;
};

Expand All @@ -134,12 +131,14 @@ private ServiceProvider ConfigureServices()
UserAgent = "Zechiax/Asterion",
RateLimitRetryCount = 3
};

var client = new DiscordSocketClient(config);

var services = new ServiceCollection()
.AddSingleton(_config)
.AddSingleton(new DiscordSocketClient(config))
.AddSingleton(client)
.AddSingleton(new CommandService(commandConfig))
.AddSingleton<InteractionService>()
.AddSingleton<InteractionService>( new InteractionService(client))
.AddSingleton<InteractionCommandHandler>()
.AddSingleton<MessageHandler>()
.AddSingleton<LoggingService>()
Expand Down

0 comments on commit e0b2fe6

Please sign in to comment.