the RaidRandomizer now updates the DiscordMessages

This commit is contained in:
Sarah Faey 2022-12-06 14:19:52 +01:00
parent 452c9d0fc1
commit 94f92735d1

View file

@ -7,11 +7,13 @@ namespace Lieb.Data
public class RaidRandomizerService public class RaidRandomizerService
{ {
private readonly IDbContextFactory<LiebContext> _contextFactory; private readonly IDbContextFactory<LiebContext> _contextFactory;
private readonly DiscordService _discordService;
private static Random _random = new Random(); private static Random _random = new Random();
public RaidRandomizerService(IDbContextFactory<LiebContext> contextFactory) public RaidRandomizerService(IDbContextFactory<LiebContext> contextFactory, DiscordService discordService)
{ {
_contextFactory = contextFactory; _contextFactory = contextFactory;
_discordService = discordService;
} }
public async Task RandomizeRaid(int raidId) public async Task RandomizeRaid(int raidId)
@ -48,6 +50,7 @@ namespace Lieb.Data
await context.SaveChangesAsync(); await context.SaveChangesAsync();
CleanUpRoles(raid, context); CleanUpRoles(raid, context);
await context.SaveChangesAsync(); await context.SaveChangesAsync();
await _discordService.PostRaidMessage(raidId);
} }
private void RandomizeClasses(Raid raid) private void RandomizeClasses(Raid raid)