diff --git a/commands/femboy.js b/commands/femboy.js index c10ebc8..25777d4 100644 --- a/commands/femboy.js +++ b/commands/femboy.js @@ -3,7 +3,9 @@ import { SlashCommandBuilder} from "discord.js"; export const data = new SlashCommandBuilder() .setName('femboy') .setDescription('femboy penis porno') -export async function execute(interaction, defer=false) { +export async function execute(interaction, defer=false, maxTry=10) { + maxTry-- + if (maxTry === 0) return if (!defer) await interaction.deferReply() if (interaction.channel.nsfw) { @@ -29,14 +31,16 @@ export async function execute(interaction, defer=false) { .then(response => response.json()) .then(response => { let i = Math.floor(Math.random() * response.length) - let ip = Math.floor(Math.random() * response[i].attachments.length) - if (!response.attachments || response.length === 0 || response[i].attachments.length === 0) { + if (response.length === 0 || response[i].attachments.length === 0) { return null } + let ip = Math.floor(Math.random() * response[i].attachments.length) return "https://coomer.su" + response[i].attachments[ip].path + }).catch(e => { + console.log(e) }) if (!getLink) { - return execute(interaction, true) + return execute(interaction, true, maxTry) } await fetch(getLink, options) @@ -48,6 +52,8 @@ export async function execute(interaction, defer=false) { name: 'image.png' }] }); + }).catch(e => { + console.log(e) }) } else { interaction.reply({ diff --git a/commands/porn.js b/commands/porn.js index 8156f52..cf7dd96 100644 --- a/commands/porn.js +++ b/commands/porn.js @@ -3,7 +3,9 @@ import { SlashCommandBuilder} from "discord.js"; export const data = new SlashCommandBuilder() .setName('porn') .setDescription('reel women prono') -export async function execute(interaction, defer=false) { +export async function execute(interaction, defer=false, maxTry=10) { + maxTry-- + if (maxTry === 0) return if (!defer) await interaction.deferReply() if (interaction.channel.nsfw) { @@ -45,14 +47,16 @@ export async function execute(interaction, defer=false) { .then(response => response.json()) .then(response => { let i = Math.floor(Math.random() * response.length) - let ip = Math.floor(Math.random() * response[i].attachments.length) - if (!response.attachments || response.length === 0 || response[i].attachments.length === 0) { + if (response.length === 0 || response[i].attachments.length === 0) { return null } + let ip = Math.floor(Math.random() * response[i].attachments.length) return "https://coomer.su" + response[i].attachments[ip].path + }).catch(e => { + console.log(e) }) if (!getLink) { - return execute(interaction, true) + return execute(interaction, true, maxTry) } await fetch(getLink, options) @@ -64,6 +68,8 @@ export async function execute(interaction, defer=false) { name: 'image.png' }] }); + }).catch(e => { + console.log(e) }) } else { interaction.reply({