Example #1
0
        public async Task DropUserAsync(ulong userId)
        {
            Users.Remove(await Users.AsQueryable()
                         .FirstAsync(x => x.Id == userId).ConfigureAwait(false));

            Pastas.RemoveRange(Pastas.AsQueryable()
                               .Where(x => x.OwnerId == userId));

            UserCommandUsage.RemoveRange(UserCommandUsage.AsQueryable()
                                         .Where(x => x.UserId == userId));

            Reputations.RemoveRange(Reputations.AsQueryable()
                                    .Where(x => x.Repee == userId || x.Reper == userId));

            UserXp.RemoveRange(UserXp.AsQueryable()
                               .Where(x => x.UserId == userId));

            StarboardVotes.RemoveRange(
                StarboardVotes.AsQueryable().Where(x => x.VoterId == userId)
                );

            GuildWeeklyPots.RemoveRange(
                GuildWeeklyPots.AsQueryable().Where(x => x.UserId == userId)
                );

            PlacePixelHistory.RemoveRange(
                PlacePixelHistory.AsQueryable().Where(x => x.ModifierId == userId)
                );
        }
Example #2
0
        public async Task DropGuildAsync(ulong guildId)
        {
            Guilds.Remove(await Guilds.AsQueryable()
                          .FirstAsync(x => x.Id == guildId).ConfigureAwait(false));

            Modules.Remove(await Modules.AsQueryable()
                           .FirstAsync(x => x.Id == guildId).ConfigureAwait(false));

            IAmRoles.RemoveRange(IAmRoles.AsQueryable()
                                 .Where(x => x.GuildId == guildId));

            Features.Remove(await Features.AsQueryable()
                            .FirstAsync(x => x.Id == guildId).ConfigureAwait(false));

            CustomCommands.RemoveRange(
                CustomCommands.AsQueryable().Where(x => x.GuildId == guildId)
                );

            UserXp.RemoveRange(
                UserXp.AsQueryable().Where(x => x.GuildId == guildId)
                );

            TwitterFollows.RemoveRange(
                TwitterFollows.AsQueryable().Where(x => x.GuildId == guildId)
                );

            TwitchFollows.RemoveRange(
                TwitchFollows.AsQueryable().Where(x => x.GuildId == guildId)
                );

            StarboardBlacklist.RemoveRange(
                StarboardBlacklist.AsQueryable().Where(x => x.GuildId == guildId)
                );

            StarboardWhitelist.RemoveRange(
                StarboardWhitelist.AsQueryable().Where(x => x.GuildId == guildId)
                );

            StarboardVotes.RemoveRange(
                StarboardVotes.AsQueryable().Where(x => x.GuildId == guildId)
                );

            GuildWeeklyPots.RemoveRange(
                GuildWeeklyPots.AsQueryable().Where(x => x.GuildId == guildId)
                );
        }