go-telegram-bot-api / telegram-bot-api

Golang bindings for the Telegram Bot API
https://go-telegram-bot-api.dev
MIT License
5.7k stars 879 forks source link

Proactively message users #557

Open myktw opened 2 years ago

myktw commented 2 years ago

How to actively send messages to users? Or get the ChatID of a user

pav5000 commented 2 years ago

You cannot do it unless user had sent you a /start command once. When you receive a /start command you can save UserID and use it to send messages to this user (UserID==ChatID)