-4

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.

Pekea
  • 21
  • 5
  • SO is not a code writing service. Put some effort into figuring out how to use the Telegram API, then ask if you have issues with the code. – Makonede Nov 20 '22 at 16:31

1 Answers1

0

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.

Ravi
  • 20
  • 1
  • Hi, thanks, i want, to get the user_id from members what have just joined and initiate a chat with it and send a custom message in direct message – Pekea Nov 26 '22 at 15:17