JaBa/commands/Fun/crab.js

50 lines
1.2 KiB
JavaScript
Raw Normal View History

2022-08-11 20:27:43 +05:00
const { SlashCommandBuilder } = require("discord.js");
const BaseCommand = require("../../base/BaseCommand"),
fetch = require("node-fetch");
class Crab extends BaseCommand {
/**
*
2023-11-05 16:03:23 +05:00
* @param {import("../base/Client")} client
2022-08-11 20:27:43 +05:00
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("crab")
.setDescription(client.translate("fun/crab:DESCRIPTION"))
.setDescriptionLocalizations({
2023-07-05 00:58:06 +05:00
uk: client.translate("fun/crab:DESCRIPTION", null, "uk-UA"),
ru: client.translate("fun/crab:DESCRIPTION", null, "ru-RU"),
})
.setDMPermission(true),
2022-08-11 20:27:43 +05:00
aliases: [],
dirname: __dirname,
ownerOnly: false,
2022-08-11 20:27:43 +05:00
});
}
/**
*
2023-11-05 16:03:23 +05:00
* @param {import("../../base/Client")} client
2022-08-11 20:27:43 +05:00
*/
async onLoad() {
//...
}
/**
*
2023-11-05 16:03:23 +05:00
* @param {import("../../base/Client")} client
2022-08-11 20:27:43 +05:00
* @param {import("discord.js").ChatInputCommandInteraction} interaction
* @param {Object} data
*/
async execute(client, interaction) {
2022-08-11 21:56:29 +05:00
await interaction.deferReply();
2022-08-11 20:27:43 +05:00
const res = await fetch("https://and-here-is-my-code.glitch.me/img/crab").then(response => response.json());
2022-08-11 21:56:29 +05:00
interaction.editReply({
content: res.Link,
2022-08-11 20:27:43 +05:00
});
}
}
2023-07-05 00:58:06 +05:00
module.exports = Crab;