R
R
Renat Grishin2020-05-07 16:53:40
Bots
Renat Grishin, 2020-05-07 16:53:40

Discord bot does not change nickname, how to solve the problem?

I'm trying to implement the function of changing the nickname, through the bot in the discord.
When I try to change the name through the bot, an error appears in the console, swears at the rights.
I checked the rights of the bot, everything is set.
Just in case, in the guild I set the bot a role with all rights.

Bug from concholi

(node:3864) UnhandledPromiseRejectionWarning: DiscordAPIError: Missing Permissions
at D:\OpenServer\OSPanel\domains\AstraBot\node_modules\discord.js\src\client\rest\RequestHandlers\Sequential.js:85:15
at D:\OpenServer\OSPanel\domains\AstraBot\node_modules\snekfetch\src\index.js:215:21
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:3864) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_reje... (rejection id: 2)
(node:3864) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

spoiler

if (msg.content == '333') {
            msg.guild.members.get(msg.author.id).setNickname("Шашлык")
        }


Bot rights

5eb411952a5a0386654993.png
5eb4124bd8814694176272.png
5eb412b9ebf97006164111.png

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Artem, 2020-05-10
@CynVox

Are you trying to change your nickname through a bot and you are the owner of the server? A bot with no rights can in any way edit your profile, because in any case you are higher than it

I
Igor Gafarchik, 2020-05-09
@Gafarchik

@client.command(pass_context=True)
async def chnick(ctx, member: discord.Member, nick):
    await member.edit(nick=nick)
    await ctx.send(f'Nickname was changed for {member.mention} ')

Put the bot's role above those it should have access to in the list of roles and the bot can't change owner nicknames

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question