T
T
tofel2021-11-29 12:19:48
Python
tofel, 2021-11-29 12:19:48

How to send a message via telethon knowing the user id?

Hello everyone, such a problem, I received data about people from my chat and I want to send each person a private message.

User(id=739254934, is_self=False, contact=False, mutual_contact=False, deleted=False, bot=False, bot_chat_history=False, bot_nochats=False, verified=False, restricted=False, min=False, bot_inline_geo=False, support=False, scam=False, apply_min_photo=True, fake=False, access_hash=-261036748641918397, first_name='..', last_name=None, username=None, phone=None, photo=None, status=UserStatusOffline(was_online=datetime.datetime(2021, 11, 29, 8, 0, 43, tzinfo=datetime.timezone.utc)), bot_info_version=None, restriction_reason=[], bot_inline_placeholder=None, lang_code=None),

Unfortunately, a person does not always have a phone or @username, but everyone does (id=739254934) How to send a message knowing the user's id?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
N
nozzy, 2021-11-29
@nozzy

How will you send a message through the Bot API or through the Telegram API?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question