Пример #1
0
        public async Task UpdateGuildConnectionInfo(SocketGuild guild)
        {
            var server = DiscordNetToModelConverter.SocketGuildToModel(guild);
            var repo   = new GuildRepository();

            if (repo.ServerExists(server))
            {
                //Update server connection time
                await repo.UpdateLastConnectionTime(server, DateTime.Now);

                return;
            }

            //If no server/guild exists, make a new database entry for it and its table.
            Log.Information($"Creating new Guild Entry: {server.Name}, {server.Id} | Owner: {server.OwnerUsername}, {server.OwnerId}");
            await repo.SaveNewServer(server);
        }