Discord roles are hierarchical in nature. Meaning, the role listed in Discord Server Settings at the top, is the most "powerful" above any roles under it. So whatever role you have assigned to your bot, needs to have permissions that #1, allow it to read/write messages, but also if you want to ban a person from Discord through it (as an example), the bot would have to have a role higher than the person the bot is trying to ban.
Also, as a test. Try setting your bots permissions to "Administrator" and see if that works. I think the Discord API might have changed and could be causing some issues as well.
Also, as a test. Try setting your bots permissions to "Administrator" and see if that works. I think the Discord API might have changed and could be causing some issues as well.