discord javascript how to create a role 1

discord javascript how to create a role

// Create a new role with data and a reason
guild.roles.create({
  data: {
    name: 'Super Cool People',
    color: 'BLUE',
  },
  reason: 'we needed a role for Super Cool People',
})
  .then(console.log)
  .catch(console.error);

Here is what the above code is Doing:
1. We create a new role with the data we want.
2. We set the reason for the role’s creation.
3. We log the role to the console.
4. We catch any errors and log them to the console.

The role is created and logged to the console.

Similar Posts