I’ve created a telegram bot that works perfectly fine when I run it on my local machine. AKA you can go into telegram and normally interact with the bot when running locally. However, I take the same steps to run the bot on a digital ocean droplet (Ubuntu) and the bot simply does not respond when trying to interact with it in Telegram. Does anybody know the issue here?
Thank you.
I uploaded the relevant files to my Digital Ocean Droplet (AKA Ubuntu Instance) and installed NodeJS and NPM and ran ‘npm install’ and ‘npm start’ as I would on my local machine with no success.
This textbox defaults to using Markdown to format your answer.
You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!
These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.
Enter your email to get $200 in credit for your first 60 days with DigitalOcean.
New accounts only. By submitting your email you agree to our Privacy Policy.
Hey @27f435659dc64d2d877d490c5579ba,
On what port are you accessing your Telegram bot? Additionally, what does no success mean, how are you trying to connect to it?
Here are general things you can try to resolve the issue:
Port Forwarding/Security Group Settings:
Check whether the ports that your application uses are open and correctly forwarded in your Digital Ocean Droplet. This can be verified in the security group settings of your droplet.
Node.js Server not Listening on Correct IP/Port:
Ensure that your Node.js application is set to listen on the correct IP (0.0.0.0 for all interfaces) and the correct port.
Environment Variables:
If your bot uses environment variables, you should set them in the droplet as well. You can use dotenv package to manage them.
Firewall:
There might be firewall rules that are preventing your bot from accessing the internet. You can use ufw or iptables to manage these rules on your Ubuntu Droplet.
Error logs:
Check your bot’s logs for any error messages. If your application crashed and restarted, logs will help you understand what happened.
Having said that, I do believe you are accessing the bot on the wrong port.