I'm not professional in programming and do this more like a hobby to have a great discord bot for my server.
At the moment i am using the version 3.10.5 of python and the discord.py beta 2.0
Feel free to use the code of the bot to create your own one.
Also the Discord Server has 2 roles that i will name "specific roles" in the file. In the script they are the "Red Card" & "Yellow Card" roles. More information see below at "Card System"
In te bot_versions file, you can see what changed from one version to another, i would recommend you to have a look in there.
The "Card System" is a system to "punish" members of the discord. You can create a for example Red and Yellow Card role and give them restrictions like they cant send messages with a red card.
When someone receives either one of the roles they receive also a direct message of the bot as information that they got the role. Also when someone loses a role of the 2 they will get a direct message, that they have lost the role.
When you give a user the Red Card Role and he has the Yellow Card already, the yellow will be removed. (they wont get a information about the removal here)