http.cat beta support

This commit is contained in:
Lucas Gabriel 2024-10-14 06:30:55 -03:00 committed by GitHub
parent d23e63c22e
commit b8067bf59e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -24,6 +24,22 @@ module.exports = (bot) => {
reply_to_message_id: ctx.message.message_id
});
};
} else if (userInput && userInput.includes("http")) {
request = `/${userInput.replace("http", "")}`;
const apiUrl = `https://http.cat${request}`;
try {
await ctx.replyWithPhoto(apiUrl, {
caption: `🐱`,
parse_mode: 'Markdown',
reply_to_message_id: ctx.message.message_id
});
} catch (error) {
ctx.reply(Strings.catImgErr, {
parse_mode: 'Markdown',
reply_to_message_id: ctx.message.message_id
});
};
} else {
request = userInput ? `/${userInput}` : '';
const apiUrl = `https://cataas.com/cat${request}`;