From 5ae3d7599d19312d039ef76096b285ce98827cee Mon Sep 17 00:00:00 2001 From: Daniel-I-Am Date: Sat, 6 Jun 2020 14:35:39 +0200 Subject: [PATCH] Fix CommandHandler config service requirement --- ChaosBot/Discord/Services/CommandHandler.cs | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) 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;