예제 #1
0
        public async Task UpdateTemplate(string templateId, int key, int value)
        {
            var template = await GetTemplate(templateId);

            if (template == null)
            {
                await ReplyAsync("No template by that name could be found");

                return;
            }
            _templateConfigurationService.UpdateTemplate(template, key, value);
            await _softResRaidTemplateRepository.SaveAllChangesAsync();

            await ReplyAsync("Template updated successfully.");
        }
예제 #2
0
        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");
        }