This snippet shows a simple example of how you can remove a role when it is added to a user. Set your banned role in the env variables and then whenever a user updates their role it will remove the new role if the role is banned.
const lib = require('lib')({token: process.env.STDLIB_SECRET_TOKEN});
let role = process.env.BAD_ROLE_ID;
//Checks if the role that was added to a user is the bad role
if (context.params.event.roles.includes(role)) {
//If it is, then remove said role
await lib.discord.guilds['@0.2.4'].members.roles.destroy({
role_id: role,
user_id: `${context.params.event.user.id}`,
guild_id: `${context.params.event.guild_id}`,
});
}