Zidious / crypto-telegrambot

A cryptocurrency Telegram BOT
MIT License
0 stars 1 forks source link

If a tweet contains a video it tries to post that as a photo message instead of video message to Telegram #25

Open Zidious opened 2 years ago

Zidious commented 2 years ago

Error: image

Error 400: Bad Request: invalid file HTTP URL

This happens when we receive a tweet that contains an video and attempt to send it to Telegram as a photo message. We need to check the received data shape from the Twitter API to determine what media is sent, we account for photos but we need to check of the data shape contains a video, if so we can send a video message and not a photo message.

Telegram video message: https://core.telegram.org/bots/api#sendvideo

In our types, we will need to create another interface that takes a videoUrl like our IInlineKeyboardWithPhoto. Next, we will need to create a function that builds the video mesage, like our sendMessageWithPhoto . Finally, add some logic here to build a video message