/// <summary>
        /// Election update logic.
        /// </summary>
        private async Task UpdateElections()
        {
            var activeElections = _repository.GetActiveElections();

            if (activeElections.Count == 0)
            {
                return;
            }

            foreach (var election in activeElections)
            {
                var voteChannelId = this._config.GuildConfigs[election.GuildId].VoteChannel;
                if (voteChannelId == 0)
                {
                    this._client.Logger.LogError("Posting election failed: No vote channel specified.");
                    break;
                }
                if (election.Message == null)
                {
                    if (election.Start <= DateTime.UtcNow)
                    {
                        var voteChannel = this._client
                                          .Guilds[election.GuildId]
                                          .Channels[voteChannelId];

                        var message = await voteChannel.SendMessageAsync(embed : election.GetEmbed());

                        this._repository.SetMessage(election.GuildId, election.ID, message);
                    }
                }
                else
                {
                    if (election.End <= DateTime.UtcNow)
                    {
                        if (_repository.CloseElection(election, this._client))
                        {
                            DiscordChannel voteChannel = this._client
                                                         .Guilds[election.GuildId]
                                                         .Channels[voteChannelId];

                            DiscordMessageBuilder builder = new DiscordMessageBuilder()
                                                            .WithFile(File.OpenRead(_repository.GetAuditLogPath(election)))
                                                            .WithContent($"Election #{election.ID} for {election.Title} has concluded. Results:\n{election.GetResults()}");

                            await voteChannel.SendMessageAsync(builder);
                        }
                    }
                }
            }
            this._repository.SaveChanges();
            return;
        }