JaBa/TO REWRITE/Examples/mention.js
JonnyBro d7b2790200 Переход на discord.js 14
Фиксы
Подготовка старых команд к d.js 14
2022-07-31 17:08:00 +05:00

37 lines
No EOL
894 B
JavaScript

const { ApplicationCommandType } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand");
class Mention extends BaseCommand {
/**
*
* @param {import("../../base/JaBa")} client
*/
constructor() {
super({
command: {
name: "mention",
type: ApplicationCommandType.User
},
aliases: [],
dirname: __dirname,
guildOnly: true
});
}
/**
*
* @param {import("../../base/JaBa")} client
*/
async onLoad() {
//...
}
/**
*
* @param {import("../../base/JaBa")} client
* @param {import("discord.js").ContextMenuInteraction} interaction
*/
async execute(client, interaction) {
const target = interaction.member.guild.members.cache.get(interaction.targetId);
return interaction.reply({ content: target.toString(), ephemeral: false, fetchReply: true }).then(m => setTimeout(() => m.delete(), 5000));
}
}
module.exports = Mention;