Discord.js: setNickname Error

Created on 12 Jul 2016  路  1Comment  路  Source: discordjs/discord.js

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 }
question (please use Discord instead)

Most helpful comment

You can't modify the nickname of people whose highest role is the same or higher than your highest role.

>All comments

You can't modify the nickname of people whose highest role is the same or higher than your highest role.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

ghost picture ghost  路  3Comments

LLamaFTL picture LLamaFTL  路  3Comments

ghost picture ghost  路  3Comments

Alipoodle picture Alipoodle  路  3Comments

Lombra picture Lombra  路  3Comments