I want to know the code that targets the person who gave the command instead 'message.mentions.members.first();'
I want to create a way to change my nickname by typing a command, but I always have to do an mention
The code consists of this configuration.
module.exports = { name: "nick", async execute(message, args, client) { const member = message.mentions.members.first();
if (!member) return message.reply("Please specify a member!");
const arguments = args.shift(2)
if (!arguments) return message.reply("Please specify a nickname!");
try { const arguments = args.shift(2) member.setNickname(arguments); }catch (error) { console.error(error);
} }, }