private async Task HandleCommandAsync(SocketMessage rawMsg)
        {
            // Ignore system messages
            if (!(rawMsg is SocketUserMessage msg))
            {
                return;
            }

            // Ignore bot messages
            if (msg.Author.IsBot || msg.Author.IsWebhook)
            {
                return;
            }

            // Ignore messages from blacklisted users
            if (_settings.BlacklistedUsers?.Contains(msg.Author.Id) == true)
            {
                return;
            }

            // Ignore if the bot doesn't have the permission to send messages in the channel
            IGuildChannel guildChannel = msg.Channel as IGuildChannel;

            if (guildChannel != null)
            {
                IGuildUser guildUser = await guildChannel.Guild.GetCurrentUserAsync().ConfigureAwait(false);

                ChannelPermissions channelPermissions = guildUser.GetPermissions(guildChannel);
                if (!channelPermissions.Has(ChannelPermission.SendMessages))
                {
                    return;
                }
            }

            string prefix = _settings.Prefix;

            if (_settings.GuildSpecificSettings &&
                guildChannel != null)
            {
                using (GuildSettingsDatabase db = new GuildSettingsDatabase())
                {
                    prefix = (await db.GetSettingsAsync(guildChannel.Guild.Id).ConfigureAwait(false))?.Prefix ?? _settings.Prefix;
                }
            }

            // Mark where the prefix ends and the command begins
            int argPos = 0;

            // Determine if the message has a valid prefix, adjust argPos
            if (!(msg.HasMentionPrefix(_discordClient.CurrentUser, ref argPos) ||
                  msg.HasStringPrefix(prefix, ref argPos)))
            {
                return;
            }

            // Execute the Command, store the result
            IResult result = await _commandService.ExecuteAsync(
                new SocketCommandContext(_discordClient, msg), argPos, _serviceProvider).ConfigureAwait(false);

            // If the command failed, notify the user
            if (result.Error.HasValue && result.Error != CommandError.UnknownCommand)
            {
                _logger.LogError(result.ErrorReason);

                await msg.Channel.SendMessageAsync(string.Empty,
                                                   embed : new EmbedBuilder()
                {
                    Title       = "Error",
                    Color       = _settings.GetErrorColor(),
                    Description = result.ErrorReason
                }.Build()).ConfigureAwait(false);
            }
        }