Can I set the nickname for all members? #10038
-
I was trying to put some words in the members' nicknames in my server, but it gives me the error "missing permission." I tried using the My code: import { Interaction } from "discord.js";
export async function rename(interaction: Interaction) {
const members = await interaction.guild?.members.fetch();
members.each(async (member) => {
console.log(
`Manageable: ${member.manageable}, Nickname: ${member.nickname}, Display name: ${member.displayName}`,
);
const word = "new word";
await member.setNickname(`${member.displayName} - ${word}`);
});
await interaction.reply("OK");
} |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
You cannot manage the guild owner or members of the same or a higher role than the bot's highest role, regardless of permissions. |
Beta Was this translation helpful? Give feedback.
You cannot manage the guild owner or members of the same or a higher role than the bot's highest role, regardless of permissions.