diff --git a/ChaosBot/Discord/Services/CommandHandler.cs b/ChaosBot/Discord/Services/CommandHandler.cs index 7da71bf..f0bece2 100644 --- a/ChaosBot/Discord/Services/CommandHandler.cs +++ b/ChaosBot/Discord/Services/CommandHandler.cs @@ -1,6 +1,7 @@ using System; using System.Reflection; using System.Threading.Tasks; +using ChaosBot.Database.Repository; using Microsoft.Extensions.DependencyInjection; using Discord; using Discord.Commands; @@ -12,7 +13,6 @@ namespace ChaosBot.Discord.Services { public class CommandHandler { - private readonly IConfiguration _config; private readonly CommandService _commands; private readonly DiscordSocketClient _client; private readonly IServiceProvider _services; @@ -22,7 +22,6 @@ namespace ChaosBot.Discord.Services { try { - _config = services.GetRequiredService(); _commands = services.GetRequiredService(); _client = services.GetRequiredService(); _services = services; @@ -54,7 +53,7 @@ namespace ChaosBot.Discord.Services var argPos = 0; - char prefix = Char.Parse(_config["Discord:Prefix"]); + char prefix = Char.Parse(ConfigurationRepository.GetValue("Discord:Prefix")); if (!(message.HasMentionPrefix(_client.CurrentUser, ref argPos) || message.HasCharPrefix(prefix, ref argPos))) return;