fix cat and dog yipeee

This commit is contained in:
Jonny_Bro (Nikita) 2024-02-02 20:49:55 +05:00
parent e9855591b2
commit b82a51b6bc
No known key found for this signature in database
GPG key ID: 391C19BE62D36B33
9 changed files with 19 additions and 84 deletions

View file

@ -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;

View file

@ -38,11 +38,10 @@ class Cat extends BaseCommand {
async execute(client, interaction) { async execute(client, interaction) {
await interaction.deferReply(); 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({ await interaction.editReply({ content: cat });
content: res.Link,
});
} }
} }

View file

@ -38,11 +38,10 @@ class Dog extends BaseCommand {
async execute(client, interaction) { async execute(client, interaction) {
await interaction.deferReply(); 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({ await interaction.editReply({ content: dog });
content: res.Link,
});
} }
} }

View file

@ -59,10 +59,7 @@ class Clips extends BaseCommand {
client.player.play(interaction.member.voice.channel, query, { client.player.play(interaction.member.voice.channel, query, {
nodeOptions: { nodeOptions: {
metadata: { metadata: interaction,
channel: interaction.channel,
requestedBy: interaction.user,
},
}, },
searchEngine: QueryType.FILE, searchEngine: QueryType.FILE,
selfDeaf: true, selfDeaf: true,

View file

@ -51,10 +51,7 @@ class PlayContext extends BaseCommand {
else { else {
const { queue } = await client.player.play(interaction.member.voice.channel, searchResult, { const { queue } = await client.player.play(interaction.member.voice.channel, searchResult, {
nodeOptions: { nodeOptions: {
metadata: { metadata: interaction,
channel: interaction.channel,
requestedBy: interaction.user,
},
}, },
selfDeaf: true, selfDeaf: true,
leaveOnEnd: false, leaveOnEnd: false,

View file

@ -63,10 +63,7 @@ class Play extends BaseCommand {
else { else {
const { queue } = await client.player.play(interaction.member.voice.channel, searchResult, { const { queue } = await client.player.play(interaction.member.voice.channel, searchResult, {
nodeOptions: { nodeOptions: {
metadata: { metadata: interaction,
channel: interaction.channel,
requestedBy: interaction.user,
},
}, },
selfDeaf: true, selfDeaf: true,
leaveOnEnd: false, leaveOnEnd: false,

View file

@ -29,7 +29,7 @@
"mongoose": "^7.6.3", "mongoose": "^7.6.3",
"ms": "^2.1.3", "ms": "^2.1.3",
"node-fetch": "^2.7.0", "node-fetch": "^2.7.0",
"play-dl": "^1.9.7" "youtube-ext": "^1.1.16"
}, },
"devDependencies": { "devDependencies": {
"eslint": "^8.52.0" "eslint": "^8.52.0"

View file

@ -62,9 +62,9 @@ dependencies:
node-fetch: node-fetch:
specifier: ^2.7.0 specifier: ^2.7.0
version: 2.7.0 version: 2.7.0
play-dl: youtube-ext:
specifier: ^1.9.7 specifier: ^1.1.16
version: 1.9.7 version: 1.1.16
devDependencies: devDependencies:
eslint: eslint:
@ -1668,17 +1668,6 @@ packages:
engines: {node: '>=8'} engines: {node: '>=8'}
dev: false 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: /prelude-ls@1.2.1:
resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==} resolution: {integrity: sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==}
engines: {node: '>= 0.8.0'} engines: {node: '>= 0.8.0'}
@ -2156,6 +2145,12 @@ packages:
engines: {node: '>=10'} engines: {node: '>=10'}
dev: true 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: /youtube-sr@4.3.9:
resolution: {integrity: sha512-wPGEgVevSn32BJu5jiSHdvoryUCTCIM9LYT+yMDDpUfaev2Dh46dB+4qU31NgJ9XOsNxGlEKmc9qxUO5L0CE/Q==} resolution: {integrity: sha512-wPGEgVevSn32BJu5jiSHdvoryUCTCIM9LYT+yMDDpUfaev2Dh46dB+4qU31NgJ9XOsNxGlEKmc9qxUO5L0CE/Q==}
dev: false dev: false