I made a discord bot in python , now I am trying save my data on database instead of local files. I am trying to use insert_one in database but it show error . Its very basic code but dont know why this problem apper while all you tube , tutorial said its ok. My code is:
@client.command()
async def data(ctx, member:discord.Member):
mydb=cluster["record"]
mycol = mydb["data"]
await ctx.send(f"checkpoint 1")
member_id=str(member.id)
await ctx.send(f"checkpoint 2")
mydict = { "_id": member_id, "name": "John", "gender": "M", "area": "US", "age": 33}
await ctx.send(f"checkpoint 3")
mycol.insert_one(mydict)
await ctx.send(f"checkpoint 4")
at checkpoint 3 it works ok and print also but nextline it create error . What may be the reason? Any help will be appriciated.