I am currently making a bot using discord.py, and I’m using a JSON file to hold user information, however, I want it to automatically delete information if an account gets deleted. Is it possible?
I have neither code nor an idea of how to make it.
Daice is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
1
When a user deletes their account, the username becomes something like deleted_user_781550cdcda3
. You can consider that users who have a username similar to this have been deleted.
Additionally, when a user has their account deleted, their data becomes unavailable on the Discord API. So if you try to use await bot.fetch_user(user_id)
you will get the discord.errors.NotFound
error.
1