I wrote this code but the userUpdate part doesn't even trigger when someone changes their username, so I'm thinking I probably forgot to add an intent? Furthermore, would the code work at all if I had the missing intent? Note: I am using v12
const discord = require("discord.js");
const client = new discord.Client({ ws: { intents: 'GUILD_MEMBERS' }});
client.on('userUpdate', (oldUser, newUser) => {
console.log(oldUser);
console.log(newUser);
if(newUser.user.username && oldUser.user.username !== newUser.user.username) {
if(newUser.user.username.includes("test")) {
newUser.user.ban();
}
}
});