async def fixvc(self, ctx): """Fix broken VC counts""" guild = ctx.guild humans = self.get_humans(ctx) bots = self.get_bots(ctx) doc = await self.db.find_one({'_id':'config'}) setkeys = list(doc.keys()) checks = ["m", "r", "c", "h", "b"] matching = [guild.member_count, len(guild.roles), len(guild.channels), humans, bots] for check in checks: if f"{check}Channel" in setkeys: num = checks.index(check) value = matching[num] await self.update_channel(ctx, doc[f'{check}Channel'], value) await ctx.send('Fixed all Counts!')
async def fixvc(self, ctx): """Fix broken VC counts""" guild = ctx.guild humans = 0 bots = 0 for member in guild.members: if member.bot: bots += 1 else: humans += 1 doc = await self.db.find_one({'_id': 'config'}) setkeys = list(doc.keys()) checks = ['m', 'r', 'c', 'h', 'b'] matching = [ guild.member_count, len(guild.roles), len(guild.channels), humans, bots ] for check in checks: if f'{check}Channel' in setkeys: num = checks.index(check) value = matching[num] await self.update_channel(ctx, doc[f'{check}Channel'], value) await ctx.send('Fixed all Counts!')