import { Command, CommandoMessage, CommandoClient } from 'discord.js-commando'; //@ts-ignore this has no types import emoji from 'emoji-random' module.exports = class NicknameModeration extends Command { constructor(client: CommandoClient) { super(client, { name: 'nickname', aliases: ['nick'], group: 'moderation', memberName: 'nickname', description: 'Change someones nickname', userPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY', 'CHANGE_NICKNAME', 'MANAGE_NICKNAMES'], clientPermissions: ['SEND_MESSAGES', 'READ_MESSAGE_HISTORY', 'CHANGE_NICKNAME', 'MANAGE_NICKNAMES'], examples: [ 'uwu!nickname @sin#1337 loser', 'uwu!nick @sin#1337 loser' ], throttling: { usages: 5, duration: 30 }, guildOnly: true, args: [ { key: 'user', prompt: 'Which users nickname would you like to change?', type: 'string' }, { key: 'nick', prompt: 'What would you like to change their nickname to?', type: 'string' } ] }); } //@ts-ignore this aint async run(msg: CommandoMessage, { nick, user }: any) { msg.delete() if (msg.mentions.users) { user = msg.mentions.users.first()?.id if (nick) { msg.guild.members.cache.get(user)?.setNickname(nick) return msg.reply(`<@${user}>'s nickname has been changed to **${nick}**! ${emoji.random()}`).then(m => m.delete({ timeout: 3000 })) } else { return msg.reply(`No nickname was provided! ${emoji.random()}`) } } else { return msg.reply(`No valid member was mentioned! ${emoji.random()}`) } } };