Give and remove roles with a bot, Discord.py
问题 How do I make a bot in Discord.py that will assign roles present in a role.json file, while using the same command to both remove and add the same role. For example, ?role <rolename> will both add and remove a role, depending on if the user has the role assigned. I'm a bit confused on how to achieve this. My current bot uses ?roleadd <rolename> ?roleremove <rolename> . 回答1: I'm not sure where your role.json file comes into play, but here's how I would implement such a command @bot.command