Telegram send message to an username

Would like to send a message (from a telegram bot) directly to an username (and not using Chat ID)
I’m getting the username from an API that i’m calling with the HTTP, after i want send a mail and a telegram message. The telegram message doesn’t work, i received error 400. There is any way to add the @username instead of the ID? do you have any solution to store this?

1 Like

Hi there.

I believe that what you are describing would be possible only if the user sends a message to your bot first.

If you have set the “Watch Updates” webhook trigger and your bot receives a message from a user, then you can use the ID of this newly created conversation to send a reply to this user.

I’ve spent some time testing this and I believe you can’t send a message without a previous interaction from the user.

It seems that you can send messages by using the username only to the channels/groups that have your bot added as admin.

Hate to be the bearer of bad news here but these are the results of my tests.