mirror of
https://github.com/JonnyBro/JaBa.git
synced 2024-11-21 20:54:58 +05:00
fix cat and dog yipeee
This commit is contained in:
parent
e9855591b2
commit
b82a51b6bc
9 changed files with 19 additions and 84 deletions
|
@ -1,49 +0,0 @@
|
|||
const { SlashCommandBuilder } = require("discord.js");
|
||||
const BaseCommand = require("../../base/BaseCommand"),
|
||||
fetch = require("node-fetch");
|
||||
|
||||
class Crab extends BaseCommand {
|
||||
/**
|
||||
*
|
||||
* @param {import("../base/Client")} client
|
||||
*/
|
||||
constructor(client) {
|
||||
super({
|
||||
command: new SlashCommandBuilder()
|
||||
.setName("crab")
|
||||
.setDescription(client.translate("fun/crab:DESCRIPTION"))
|
||||
.setDescriptionLocalizations({
|
||||
uk: client.translate("fun/crab:DESCRIPTION", null, "uk-UA"),
|
||||
ru: client.translate("fun/crab:DESCRIPTION", null, "ru-RU"),
|
||||
})
|
||||
.setDMPermission(true),
|
||||
aliases: [],
|
||||
dirname: __dirname,
|
||||
ownerOnly: false,
|
||||
});
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param {import("../../base/Client")} client
|
||||
*/
|
||||
async onLoad() {
|
||||
//...
|
||||
}
|
||||
/**
|
||||
*
|
||||
* @param {import("../../base/Client")} 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/crab").then(response => response.json());
|
||||
|
||||
interaction.editReply({
|
||||
content: res.Link,
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Crab;
|
|
@ -38,11 +38,10 @@ class Cat extends BaseCommand {
|
|||
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());
|
||||
const res = await fetch("https://api.thecatapi.com/v1/images/search").then(r => r.json());
|
||||
const cat = res[0].url;
|
||||
|
||||
interaction.editReply({
|
||||
content: res.Link,
|
||||
});
|
||||
await interaction.editReply({ content: cat });
|
||||
}
|
||||
}
|
||||
|
|
@ -38,11 +38,10 @@ class Dog extends BaseCommand {
|
|||
async execute(client, interaction) {
|
||||
await interaction.deferReply();
|
||||
|
||||
const res = await fetch("https://and-here-is-my-code.glitch.me/img/dog").then(response => response.json());
|
||||
const res = await fetch("https://dog.ceo/api/breeds/image/random").then(r => r.json());
|
||||
const dog = res.message;
|
||||
|
||||
interaction.editReply({
|
||||
content: res.Link,
|
||||
});
|
||||
await interaction.editReply({ content: dog });
|
||||
}
|
||||
}
|
||||
|
|
@ -59,10 +59,7 @@ class Clips extends BaseCommand {
|
|||
|
||||
client.player.play(interaction.member.voice.channel, query, {
|
||||
nodeOptions: {
|
||||
metadata: {
|
||||
channel: interaction.channel,
|
||||
requestedBy: interaction.user,
|
||||
},
|
||||
metadata: interaction,
|
||||
},
|
||||
searchEngine: QueryType.FILE,
|
||||
selfDeaf: true,
|
||||
|
|
|
@ -51,10 +51,7 @@ class PlayContext extends BaseCommand {
|
|||
else {
|
||||
const { queue } = await client.player.play(interaction.member.voice.channel, searchResult, {
|
||||
nodeOptions: {
|
||||
metadata: {
|
||||
channel: interaction.channel,
|
||||
requestedBy: interaction.user,
|
||||
},
|
||||
metadata: interaction,
|
||||
},
|
||||
selfDeaf: true,
|
||||
leaveOnEnd: false,
|
||||
|
|
|
@ -63,10 +63,7 @@ class Play extends BaseCommand {
|
|||
else {
|
||||
const { queue } = await client.player.play(interaction.member.voice.channel, searchResult, {
|
||||
nodeOptions: {
|
||||
metadata: {
|
||||
channel: interaction.channel,
|
||||
requestedBy: interaction.user,
|
||||
},
|
||||
metadata: interaction,
|
||||
},
|
||||
selfDeaf: true,
|
||||
leaveOnEnd: false,
|
||||
|
|
|
@ -29,7 +29,7 @@
|
|||
"mongoose": "^7.6.3",
|
||||
"ms": "^2.1.3",
|
||||
"node-fetch": "^2.7.0",
|
||||
"play-dl": "^1.9.7"
|
||||
"youtube-ext": "^1.1.16"
|
||||
},
|
||||
"devDependencies": {
|
||||
"eslint": "^8.52.0"
|
||||
|
|
|
@ -62,9 +62,9 @@ dependencies:
|
|||
node-fetch:
|
||||
specifier: ^2.7.0
|
||||
version: 2.7.0
|
||||
play-dl:
|
||||
specifier: ^1.9.7
|
||||
version: 1.9.7
|
||||
youtube-ext:
|
||||
specifier: ^1.1.16
|
||||
version: 1.1.16
|
||||
|
||||
devDependencies:
|
||||
eslint:
|
||||
|
@ -1668,17 +1668,6 @@ packages:
|
|||
engines: {node: '>=8'}
|
||||
dev: false
|
||||
|
||||
/play-audio@0.5.2:
|
||||
resolution: {integrity: sha512-ZAqHUKkQLix2Iga7pPbsf1LpUoBjcpwU93F1l3qBIfxYddQLhxS6GKmS0d3jV8kSVaUbr6NnOEcEMFvuX93SWQ==}
|
||||
dev: false
|
||||
|
||||
/play-dl@1.9.7:
|
||||
resolution: {integrity: sha512-KpgerWxUCY4s9Mhze2qdqPhiqd8Ve6HufpH9mBH3FN+vux55qSh6WJKDabfie8IBHN7lnrAlYcT/UdGax58c2A==}
|
||||
engines: {node: '>=16.0.0'}
|
||||
dependencies:
|
||||
play-audio: 0.5.2
|
||||
dev: false
|
||||
|
||||
/prelude-ls@1.2.1:
|
||||
resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==}
|
||||
engines: {node: '>= 0.8.0'}
|
||||
|
@ -2156,6 +2145,12 @@ packages:
|
|||
engines: {node: '>=10'}
|
||||
dev: true
|
||||
|
||||
/youtube-ext@1.1.16:
|
||||
resolution: {integrity: sha512-vyzHSwxlCAwqWUxZKJ/5g139BgnbmZFTy9I0nxDwqlbAh74dB1LjayCoB5BgLaaIkSMruEQwlf5bF+EeR235qA==}
|
||||
dependencies:
|
||||
undici: 5.27.2
|
||||
dev: false
|
||||
|
||||
/youtube-sr@4.3.9:
|
||||
resolution: {integrity: sha512-wPGEgVevSn32BJu5jiSHdvoryUCTCIM9LYT+yMDDpUfaev2Dh46dB+4qU31NgJ9XOsNxGlEKmc9qxUO5L0CE/Q==}
|
||||
dev: false
|
||||
|
|
Loading…
Reference in a new issue