-1

How can I get information from telegram about new users joining my group, I want it to record on a spreadsheet of the member name and who he/she invited into the group. Is there a way for me to do this?

I try to look at some Telegram API in https://core.telegram.org/bots/api but it didn't really help me at all.

Moon
  • 9
  • 2

2 Answers2

1

When a members joins a group, you'll receice a Message update, with new_chat_members set. If you're using the python-telegram-bot library (which I assume, as you used the tag), you can filters for those updates by adding a MessageHandler(Filters.new_chat_members, ...).

CallMeStag
  • 5,467
  • 1
  • 7
  • 22
1

You can use message Filters to trigger a function when a new user joins the group

Example

from telegram.ext.filters import Filters

def new_user(update, context):
    update.message.reply_text("New user joined.")

def main():  
    updater.dispatcher.add_handler(
        MessageHandler(Filters.status_update.new_chat_members, new_user)
    )

When a user joins the group this bot will leave a reply "New user joined."

Sumithran
  • 6,217
  • 4
  • 40
  • 54