public async Task Deactivate(string userID) { ModCaseRepository repo = ModCaseRepository.CreateDefault(ServiceProvider, CurrentIdentity); List <ModCase> modCases = (await repo.GetCasesForGuildAndUser(Context.Guild.Id, Convert.ToUInt64(userID))) .Where(x => x.PunishmentActive && x.PunishmentType == PunishmentType.Ban).ToList(); await repo.DeactivateModCase(modCases.ToArray()); var castInteraction = Context.Interaction as SocketMessageComponent; var embed = castInteraction.Message.Embeds.FirstOrDefault().ToEmbedBuilder().WithColor(Color.Green); embed.Fields = new() { new EmbedFieldBuilder().WithName(Translator.T().CmdUndoResultTitle()).WithValue(Translator.T().CmdUndoUnbanResultDeactivated()) }; await castInteraction.UpdateAsync(message => { message.Embed = embed.Build(); message.Components = new ComponentBuilder().Build(); }); }