/// <summary>
        /// Kicks the client for bad nickname.
        /// </summary>
        /// <param name="clientEntry">The client entry.</param>
        private void KickClientForBadNickname(SimpleClientEntity clientEntry)
        {
            var context = new MessageContext
                              {
                                  ClientDatabaseId = clientEntry.ClientDatabaseId,
                                  ClientNickname = clientEntry.Nickname
                              };

            QueryRunner.AddComplaint(clientEntry.ClientDatabaseId, Repository.Settings.BadNickname.KickMessage.ToMessage(context));
            QueryRunner.KickClient(clientEntry.ClientId, KickReason.Server, Repository.Settings.BadNickname.KickMessage.ToMessage(context));

            Log(Repository.Settings.BadNickname,
                string.Format("Client '{0}'(id:{1}) kicked for bad nickname.",
                              clientEntry.Nickname, clientEntry.ClientDatabaseId));
        }
        /// <summary>
        /// Moves the client to sticky.
        /// </summary>
        /// <param name="clientEntry">The client entry.</param>
        private void PunishClient(SimpleClientEntity clientEntry)
        {
            if (Repository.Client.IsClientVoted(clientEntry.ClientDatabaseId)) return;

            var context = new MessageContext
                              {
                                  ClientDatabaseId = clientEntry.ClientDatabaseId,
                                  ClientNickname = clientEntry.Nickname
                              };

            QueryRunner.PokeClient(clientEntry.ClientId, Repository.Settings.Vote.KickMessage.ToMessage(context));

            switch (Repository.Settings.Vote.Behavior)
            {
                case PunishBehavior.KickFromChannel:
                    QueryRunner.KickClient(clientEntry.ClientId, KickReason.Channel, Repository.Settings.Vote.KickMessage.ToMessage(context));
                    Repository.Client.AddVotedClients(new VotedClientEntity(clientEntry.ClientDatabaseId, clientEntry.ChannelId));
                    break;
                case PunishBehavior.KickFromServer:
                    QueryRunner.KickClient(clientEntry.ClientId, KickReason.Server, Repository.Settings.Vote.KickMessage.ToMessage(context));
                    break;
                case PunishBehavior.MoveToSticky:
                    QueryRunner.MoveClient(clientEntry.ClientId, Repository.Settings.Sticky.Channel.GetValueOrDefault());
                    Repository.Channel.AddStickyClients(clientEntry.ClientDatabaseId, Repository.Settings.Sticky.Channel.GetValueOrDefault(), Repository.Settings.Sticky.StickTime.GetValueOrDefault());
                    Repository.Client.AddVotedClients(new VotedClientEntity(clientEntry.ClientDatabaseId, clientEntry.ChannelId));
                    break;
            }

            Log(Repository.Settings.Vote,
                string.Format("Client '{0}'(id:{1}) punished by voting.",
                              clientEntry.Nickname, clientEntry.ClientDatabaseId));
        }
        /// <summary>
        /// Kicks the clients with bad nickname.
        /// </summary>
        /// <param name="e">The <see cref="TS3QueryLib.Core.Server.Notification.EventArgs.ClientJoinedEventArgs"/> instance containing the event data.</param>
        protected void KickClientsWithBadNickname(ClientJoinedEventArgs e)
        {
            if (!Repository.Settings.BadNickname.Enabled) return;

            if (IsBadNickname(e.Nickname))
            {
                var client = new SimpleClientEntity(e);
                if (!PermissionHelper.IsGranted(Repository.Settings.BadNickname, client.ServerGroups)) return;

                KickClientForBadNickname(client);
            }
        }