dracarys18 / TweetBot

A simple Telegram Bot to Stream the tweets from any twitter accounts to Telegram Channel
MIT License
100 stars 45 forks source link

Failing to retrieve images from Twitter #10

Open StephenBass opened 2 years ago

StephenBass commented 2 years ago

First off, thank you for the amazing bot! Everything is in working order, however, I notice Tweets which include images are not appearing with the image in our Telegram channel. Is there a setting to include images? One example from the Manchester United sample group below shows images working.

Thanks

image

dracarys18 commented 2 years ago

Currently it just displays telegram webview whenever a tweet has an image or a video. It doesn't work every time and it's a very naive approach. I will reimplement that in a different way when I rewrite the bot.

StephenBass commented 2 years ago

Thank you for the help, @dracarys18

dracarys18 commented 2 years ago

Still need to think about this. I don't know what's the current media size limit in twitter. But Bot API has 50MB limit for sending the media.So might not be a good idea to send a whole file as the current implementation works well

jayco12 commented 2 years ago

my telegram bot is not yet pulling tweets from twoitter

dracarys18 commented 2 years ago

my telegram bot is not yet pulling tweets from twoitter

Can you provide the logs that you are getting and the steps you followed to deploy the bot?

jayco12 commented 2 years ago

Building on the Heroku-20 stack-----> Using buildpack: emk/rust-----> Rust app detected-----> Checking for new releases of Rust stable channelinfo: checking for self-updates rustup unchanged - 1.25.1info: syncing channel updates for 'stable-x86_64-unknown-linux-gnu' stable-x86_64-unknown-linux-gnu unchanged - rustc 1.62.0 (a8314ef7d 2022-06-27)info: checking for self-updatesinfo: using existing install for 'stable-x86_64-unknown-linux-gnu'info: default toolchain set to 'stable-x86_64-unknown-linux-gnu' stable-x86_64-unknown-linux-gnu unchanged - rustc 1.62.0 (a8314ef7d 2022-06-27)-----> Building application using Cargo Compiling tweet_bot v0.1.0 (/tmp/build_2d8bb7ad)warning: associated function is never used: new --> src/error/tweet_error.rs:22:12 |22 | pub fn new(kind: TweetErrorKind) -> Self { | ^^^ | = note: #[warn(dead_code)] on by defaultwarning: function is never used: get_url_entity --> src/utils.rs:23:14 |23 | pub async fn get_url_entity(tweet: &Tweet) -> Option { | ^^^^^^^^^^^^^^warning: function is never used: get_media_urls --> src/utils.rs:34:14 |34 | pub async fn get_media_urls(tweet: &Tweet) -> Option<Vec> { | ^^^^^^^^^^^^^^warning: tweet_bot (bin "tweet_bot") generated 3 warnings Finished release [optimized] target(s) in 52.12s-----> Discovering process types Procfile declares types -> web, worker-----> Compressing... Done: 4.6M-----> Launching... Released v4 https://shielded-hollows-23459.herokuapp.com/ deployed to HerokuThis app is using the Heroku-20 stack, however a newer stack is available.To upgrade to Heroku-22, see:https://devcenter.heroku.com/articles/upgrading-to-the-latest-stack

This is the log. The steps I followed are below.

I cloned your repository. I logged into heroku. I installed buildpack. Changed key_sample.env to .env I filled the details in.env I pushed the code to heroku and put on dynos.

And when I checked my telegram bot it had not yet started

jayco12 commented 2 years ago

Or can I get an updated version of the code or a step by step video, please