Pekea
Pekea

Reputation: 19

Send direct message to new members from target telegram group

i want to make a script, that get the user_id from new joined members in a target group, and send to new member a direct message, how i can do that?

I didn't know what to try.

Upvotes: -4

Views: 263

Answers (1)

Ravi
Ravi

Reputation: 20

I think its a welcome message from new member. You can try this code. Correct me if i wrong.

@bot.on(events.ChatAction)
async def handler(event):

if event.user_joined:
    await event.reply('Your Custom Message')
    print(event.sender.id)

With this code, will send a new message when nember joined to your group and print their user_id to your terminal.

Upvotes: 0

Related Questions