R
R
redd_i2021-11-21 20:31:15
API
redd_i, 2021-11-21 20:31:15

How to subscribe to a newsletter for clients in telegram?

Good evening. I created a telegram bot. Is it possible to somehow make a button on the site, when clicked on which the user will subscribe to the newsletter, and in return I will receive the user's chat id and add it to the database? I will be grateful for help. Tried to find it but nothing

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Denis, 2021-11-21
@nosemka

In this case, you need to log in to the user via telegram on the site, or connect it. Otherwise, there is no way, or you can stir up the user to enter his nickname, then get the ID for this nickname, but this at least does not look pretty.

M
Michael, 2021-11-22
@lob4Noff

Yes, you can, and it doesn't take much effort:

  1. Connect the module for storing user data in a separate file, for example, the csv module
  2. Add a button, when clicked, the handler will enter the user id into the database (created csv file)
  3. Having a database, through a for loop, send a message to each user in the file

These were the main steps to solve the problem. No auxiliary sites and registrations are needed either for you or for your users.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question