JaBa/commands/Fun/cat.js

50 lines
1.1 KiB
JavaScript
Raw Normal View History

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