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

47 lines
No EOL
1.1 KiB
JavaScript

const { SlashCommandBuilder } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand");
class LMGTFY extends BaseCommand {
/**
*
* @param {import("../base/JaBa")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("lmgtfy")
.setDescription(client.translate("fun/lmgtfy:DESCRIPTION"))
.addStringOption(option =>
option.setName("question")
.setDescription(client.translate("fun/8ball:QUESTION"))
.setRequired(true)),
aliases: [],
dirname: __dirname,
guildOnly: true,
ownerOnly: false
});
}
/**
*
* @param {import("../../base/JaBa")} client
*/
async onLoad() {
//...
}
/**
*
* @param {import("../../base/JaBa")} client
* @param {import("discord.js").CommandInteraction} interaction
* @param {Array} data
*/
async execute(client, interaction) {
const question = interaction.options.getString("question").replace(/[' '_]/g, "+");
interaction.reply({
content: `<https://letmegooglethat.com/?q=${question}>`,
ephemeral: true
});
}
}
module.exports = LMGTFY;