skip to Main Content

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.

2

Answers


  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, ...).

    Login or Signup to reply.
  2. 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."

    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search