JaBa/commands/Fun/crab.js

45 lines
997 B
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 {
/**
*
* @param {import("../base/JaBa")} client
*/
constructor(client) {
super({
command: new SlashCommandBuilder()
.setName("crab")
.setDescription(client.translate("fun/crab:DESCRIPTION"))
.setDMPermission(true),
2022-08-11 20:27:43 +05:00
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) {
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({
2022-08-11 20:27:43 +05:00
content: res.Link
});
}
}
module.exports = Crab;