Example #1
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)
                );
        }