Created
May 28, 2024 21:24
-
-
Save carafelix/803b51ab299432186bbc9d72e3fa6a82 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
bot.use(posts()); | |
bot.command('papin', async (c) => { | |
c.replyWithPhoto(new InputFile('/example/Georges_Perec.jpg')) | |
.then(async update => { | |
c.api.raw.deleteMessage({ | |
chat_id: update.chat.id, | |
message_id: update.message_id | |
}) | |
update.photo.sort((a, b) => b.height * b.width - a.height * a.width) | |
const fileTelegramPath = (await c.api.raw.getFile({ file_id: update.photo[0].file_id })).file_path | |
const _url = `https://api.telegram.org/file/bot${bot.token}/${fileTelegramPath}` | |
const url = await mediaUpload(_url) | |
c.replyWithPost(`papi media foto: ![](${url})`) | |
}) | |
}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment