[go] how launch telegram bot on vds

hi how I can lunch bot telegram (go) on vds server (ubuntu) ? I get error (need help)…
error (dial tcp…) , launch on my mac+vpn worked fine…how I can properly launch my bot?

What do you mean by “vds” server?

There are many errors starting with “dial TCP” or similar, can you be a bit more explicit?

1 Like

virtual dedicated server,

bot, err := tgbotapi.NewBotAPI("mytoken")
if err != nil {
	log.Panic(err)
}

error:

2019/04/21 20:07:42 Post https://api.telegram.org/mytoken/getUpdates: dial tcp 149.124.167.330:443: connect: connection refused

That IP address ends in 330, which is obviously invalid.

My DNS lookup says, api.telegram.org is 149.154.167.220, so maybe start searching there.
Check /etc/resolv.conf to see what your nameserver is.

1 Like

I edit ip adress my self…

Well, then there is some kind of packet filter between you and the destination.

1 Like

no, telegram blocked in russia, i dont know how i can deploy telegram bot on vds (

Well, if your server is located in Russia, you’ll need to VPN out of Russia first. Not sure if that’s legal though. If your server is located outside of Russia, it should just work, assuming there are no other networking issues.

1 Like

ua genius man)) easy way change hosting :slight_smile: thanks all guys, I change hosting all worked fine now

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.