@tasks.loop(seconds=1.0)
async def mutes(self):
ended = self.nakaz.find({'mute_time': {'$lte': time.time()}}) # ищет строчки где время уже вышло
for mute in ended: # mute - просто переменная
main_guild = self.bot.get_guild(820618566163628034)
member_id = mute["_id"]
print(member_id)
member = main_guild.get_member(member_id)
for member in main_guild:
print(member.name, member.id)
muted = main_guild.get_role(913833814021787709)
await member.remove_roles(muted)
self.nakaz.delete_one(mute)