mirror of
https://github.com/abocn/TelegramBot.git
synced 2025-03-10 12:49:57 +00:00
http.cat beta support
This commit is contained in:
parent
d23e63c22e
commit
b8067bf59e
@ -24,6 +24,22 @@ module.exports = (bot) => {
|
|||||||
reply_to_message_id: ctx.message.message_id
|
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 {
|
} else {
|
||||||
request = userInput ? `/${userInput}` : '';
|
request = userInput ? `/${userInput}` : '';
|
||||||
const apiUrl = `https://cataas.com/cat${request}`;
|
const apiUrl = `https://cataas.com/cat${request}`;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user