public async Task UpdateConfig(int key, string value) { if (key == typeof(RecurringRaidTemplate) .GetProperty(nameof(RecurringRaidTemplate.SoftResTemplateId)) .GetCustomAttribute <ConfigurationKeyAttribute>().Key) { var templateExists = await _softResRaidTemplateRepository.Contains(value); if (!templateExists) { await ReplyAsync("No such soft res template exists."); return; } } var config = await AddOrGetRaidTemplate(false); _templateConfigurationService.UpdateTemplate(config, key, value); await _recurringRaidTemplateRepository.SaveAllChangesAsync(); await ReplyAsync("Configuration updated successfully"); }