Skip to content

Action: Chat info

This action allows you to retrieve detailed data about any chat on Telegram (users, bots, groups, or channels) using its user ID or @username. The retrieved data can be used in other actions.


How does this action work?

  1. Identify the chat:

    Provide the Telegram ID or @username of the chat you want to analyze. Example:

    • ID: 123456789
    • Username: @myGroup

    Get the ID

    Learn what a Telegram ID is and how to obtain it here.

  2. Receive chat data:

    The action will return a wide variety of information about the chat, such as its type, name, permissions, and more.


How to configure the action?

1. Create the action

  1. Go to your bot and press 🛠 Edit to enter editor mode.
  2. Select the button or command where you want to add this action, or create a new one.
  3. Press Actions 🌟🎯 New action🔍 Chat info.
  4. Press Configure 🛠 to set it up.

2. Configure the options

➡️ Set chat

Enter the Telegram ID or @username of the chat you want to retrieve information from. It can be a user, bot, group, or channel.

3. Activate the action

Press ✅ Activate to enable this action and make it functional.


What does this action return through its ID?

This action provides a wide range of chat data, which is retrieved using the action ID.

To access the data, use the format:

#ActionID.data#

Replace ActionID with the Action ID of Chat info (this action).

Replace data with the specific information you want to obtain (such as id or description).

For example, to get the name of a group or channel:

#ABC12.title#

Available data

Basic chat information

  • id: Chat ID.
  • type: Chat type (private, channel, or group).
  • username: Chat username (if available).
  • title: Name of the group or channel (only for groups and channels).
  • first_name: User or bot first name (only for users and bots).
  • last_name: User last name (only for users).
  • bio: User or bot biography.
  • description: Group or channel description.
  • photo: The file_id of the chat profile photo, if available.
  • pinned_message: Pinned message in the chat.
  • sticker_set_name: Name of the sticker set assigned to the group.
  • can_set_sticker_set: Indicates if the bot can change the group's sticker set (True if allowed, False otherwise).
  • invite_link: Invitation link for the group or channel.
  • linked_chat: Linked group or channel.
  • has_protected_content: Indicates if messages have forwarding protection (True if enabled, False otherwise).

Example: basic data

#ActionID.username#

Bot permissions and settings in the chat

  • permissions.can_send_messages: Indicates if the bot can send text messages, contacts, locations, and venues (True if allowed, False otherwise).
  • permissions.can_send_media_messages: Indicates if the bot can send audios, documents, photos, videos, video notes, and voice notes (True if allowed, False otherwise).
  • permissions.can_send_other_messages: Indicates if the bot can send animations, games, stickers, and use inline bots (True if allowed, False otherwise).
  • permissions.can_send_polls: Indicates if the bot can send polls (True if allowed, False otherwise).
  • permissions.can_add_web_page_previews: Indicates if the bot can add link previews to messages (True if allowed, False otherwise).
  • permissions.can_change_info: Indicates if the bot can change the chat title, photo, and other settings (True if allowed, False otherwise).
  • permissions.can_invite_users: Indicates if the bot can invite new users to the chat (True if allowed, False otherwise).
  • permissions.can_pin_messages: Indicates if the bot can pin messages (True if allowed, False otherwise).

Example: permissions

#ActionID.permissions.can_send_messages#

This will return True if the bot is allowed to send messages in the chat.

User-specific data joined to the bot

  • user.id: User ID.
  • user.first_name: User first name.
  • user.last_name: User last name.
  • user.username: Username.
  • user.language_code: User language in ISO 639-1 format. Example: en.
  • user.ref_link: User referral link.
  • user.ref_by: Referrer ID (returns None if not available).
  • user.ref_count: Number of referrals brought through their referral link.
  • user.ref_list: List of referrals in cursor format (use the loop() function to display them).
  • user.is_new: Indicates if the user is new to the bot (True if yes, False otherwise).
  • user.is_active: Indicates if the user is active in the bot (True if yes, False otherwise).
  • user.is_banned: Indicates if the user is banned from the bot (True if yes, False otherwise).
  • user.is_admin: Indicates if the user is an admin of the bot (True if yes, False otherwise).
  • user.date_joined: Date the user joined the bot.
  • user.last_seen: Last time the user interacted with the bot.
  • user.variables.(variable_name): Access user variables. Replace (variable_name) with the variable name you want to retrieve.

Example: bot users

#ActionID.user.variables.balance#

This will return the value stored in the balance variable for the user whose information was retrieved.


Practical example: Retrieve user information

Let's create a /information command that returns a user's information by providing their @username or ID.

Usage example:

  1. You send to the bot:

    /information "@JohnDoe"
    
  2. The bot responds:

    Name: John
    ID: 12345678
    Balance: 10
    

1. Create the /information command

  1. Enter the bot editor by clicking 🛠 Edit.
  2. Create a new command by clicking ✳️ New button | command and name it /information.
  3. Click on Actions 🌟 to configure the command's actions.

2. Configure the actions

a) Action 1: Receive parameters
  1. Click on 🎯 New action🖥 Receive parameters.
  2. This action does not require configuration, simply activate it by clicking ✅ Activate.
  3. Copy the ID of this action, you will need it shortly.
b) Action 2: Chat info
  1. Click on 🎯 New action🔍 Chat info.
  2. Click on Configure 🛠📍 Set chat 📍 and enter:

    {#ActionID.param1#}
    

    Replace ActionID with the Action ID from Receive parameters action that you copied earlier.

  3. Return to the actions menu and activate this action by clicking ✅ Activate.

  4. Copy the ID of this action, you will need it shortly.
c) Action 3: Send message
  1. Click on 🎯 New action✉️ Send message.
  2. Click on Configure 🛠💬 Set message 💬 and enter:

    Name: {#ActionIDChatInfo.first_name#}
    ID: {#ActionIDChatInfo.id#}
    Balance: {#ActionIDChatInfo.user.variables.balance#}
    

    Replace ActionIDChatInfo with the Action ID from Chat info action that you just copied.

  3. Return to the actions menu and activate this action by clicking ✅ Activate.


Final result

When you send the command:

/information "@MaryDoe"
  1. The Receive parameters action captures the parameter "@MaryDoe".
  2. The Chat info action receives the parameter and retrieves the information.
  3. The Send message action responds with the information:
    Name: Mary
    ID: 987654321
    Balance: 55
    

This is how the actions look

VisualMaker action chat info example


Important notes

  • Ensure the bot has sufficient permissions to access group and channel information.
  • The action works even if the user has not interacted with your bot, but some specific user data within the bot (user.ref_count, user.is_active, etc.) are only available for users joined to the bot.
  • You can send the stored profile photo using the file_id obtained with photo by using the Send message action, setting the following message:

    {photo:#ActionIDChatInfo.photo#}
    

    Replace ActionIDChatInfo with the Action ID from Chat info (this action).