I have a collection that I want to convert to list to use. I just can't get it done.
@tasks.loop(minutes=1)
async def check_current_mutes(self):
print("AAAAAA")
mutes = utils.servicecode.IslaDB("Isla", "Muted")
print(datetime.datetime.now())
lists = mutes.test_collection.find({'unmute': {'$gte': str(datetime.datetime.now())}})
print(lists)
for muted in lists.to_list(length=100):
print(muted)
if muted["unmute"] == "Indefinite":
return
else:
if not time.strptime(muted["unmute"]) <= str(datetime.datetime.now()):
member = await self.bot.get_user(muted)
print(member)
I just need to iterate it to compare values in it.
I think the issue is that you must await to convert the object to list as following:
That is the step you are missing: