Hello, i just want to change the nickname of a user on a specific role.
Code:
var Discord = require("discord.js");
var mybot = new Discord.Client({forceFetchUsers: true});
mybot.on("message", function (message) {
'use strict';
if (message.content === "nickname") {
var list_users = message.server.usersWithRole(message.server.roles.get("name", "role"));
mybot.setNickname(message.server, "LoremIpsum", list_users[1], function (error) {
if (error) {
console.log(error);
} else {
console.log("done!");
}
});
}
});
mybot.loginWithToken("token");
debugging error:
error:
{ [Error: cannot PATCH /api/guilds/189284181602205697/members/187800800657932289 (403)]
status: 403,
text: '{"code": 0, "message": "Privilege is too low..."}',
method: 'PATCH',
path: '/api/guilds/189284181602205697/members/187800800657932289' },
accepted: false,
noContent: false,
badRequest: false,
unauthorized: false,
notAcceptable: false,
forbidden: true,
notFound: false,
type: 'application/json',
setEncoding: [Function: bound ],
redirects: [] },
status: 403 }
You can't modify the nickname of people whose highest role is the same or higher than your highest role.
Most helpful comment
You can't modify the nickname of people whose highest role is the same or higher than your highest role.