N
N
Nika9802021-12-19 10:18:18
Python
Nika980, 2021-12-19 10:18:18

How to make mailings and view subscribers in a Telegram bot in Python?

Hello. I have a bot written in python, how can I see subscribers and send newsletters from it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
R
Ruslan Mandzyuk, 2021-12-19
@Ryslan_13

With the help telethonyou can see subscribers

A
Alexander Ananchenko, 2021-12-19
@Shurik24

If this is a chat with users and a bot, you can use get_chat_members()
In different libraries, methods are called differently, read the documentation
You will be returned a dict with users (Name, ID, and dofiga more information)
Loop through the users, take the ID and send messages, but I don’t I recommend doing this, extra spam from the bot is not pleasant
Make a mailing function in the bot and let the user decide whether he wants to receive the mailing list or not

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question