Eleirbag89 / TelegramBotPHP

A very simple PHP Telegram Bot API for sending messages.
http://eleirbag89.github.io/TelegramBotPHP
MIT License
794 stars 343 forks source link

Sending Messages To Individual Telegram Users ( Not a Channel ) via PHP #252

Closed marcoczen closed 2 years ago

marcoczen commented 2 years ago

Hi,

Right now, my php app has the ability to send email reminders to users via phpmailer. So i am looking for a telegram equivalent. The users cell / mobile phone number is stored in my app.

How do we do this using your library ? I have seen some tutorials in youtube but they are more about sending messages to a telegram group instead of individuals.

Thanks.

Eleirbag89 commented 2 years ago

You can't. A Telegram bot can't start a chat, only respond to users' requests

marcoczen commented 2 years ago

Thank u for a clear answer.

So, every person who wants to receive reminders must be part of a 'pre-existing' telegram chat group ? And then your library will be able to send to the group reminders ?

Note - your library seems to be the simplest - just 1 file ( Telegram.php ). Nice.

Eleirbag89 commented 2 years ago

The bot can write to users who wrote to it first or groups/channels where the bot is an administrator. In this case the members will see the message

marcoczen commented 2 years ago

@Eleirbag89

The bot can write to u groups/channels where the bot is an administrator.

I understand this part.

The bot can write to users who wrote to it first

How can a user write to the bot ? They have to add it to their contact list ?

Eleirbag89 commented 2 years ago

Yes. You can give a linh like https://telegram.me/YourBotUsername to your users

marcoczen commented 2 years ago

Thanks x 1000. Closed.