> For the complete documentation index, see [llms.txt](https://docs.botdistrikt.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.botdistrikt.com/messaging-channels/telegram/telegram-groups.md).

# Telegram Groups

Bots can work in Telegram group chats. In group chats, a bot responds when:

* It is added to a group
* A member joins the group
* A member leaves the group
* A new group is created with the bot as a member
* A member replies to a bot message

You may use bots to manage your groups and communities, play games, and share information amongst all the members of a group easily with scheduled or recurring Broadcasts.

A group is represented as a single User on BotDistrikt, no matter how many members are in it. Groups can be identified with the word *(Group)* in their names, and User Type *group* in their profiles.

![(Group) in a user's name shows that this user is a group](https://2535542804-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LirAdLo22OkAW9w3tvY%2F-MkMYKODcLv1A9rRqv6m%2F-MkMZ4Z_sI-hzOWwF255%2FScreenshot%202021-09-24%20at%207.28.12%20PM.png?alt=media\&token=c461f431-7e81-48d8-b202-d94bd24fa9aa)

![User Type group shows that this user is a group](https://2535542804-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LirAdLo22OkAW9w3tvY%2F-MkMZEDO-pqbhwavlDbV%2F-MkMZe_cpCrx8KOpr6NV%2FScreenshot%202021-09-24%20at%207.30.00%20PM.png?alt=media\&token=aca6b2a3-e3c8-47fa-b867-87f5c306398f)

## Added to a group

When you add the bot to a group, a postback event is triggered. To make the bot respond to this event, you must add a rule with the following condition

| Context   | Property   | Function | Value      |
| --------- | ---------- | -------- | ---------- |
| `message` | `postback` | `equals` | `botAdded` |

If the above rule is not added, the bot will respond with its default fallback story

## Member joins the group

When a new member joins a group the bot is in, a postback event is triggered. To make the bot respond to this event, you must add a rule with the following condition

| Context   | Property   | Function | Value         |
| --------- | ---------- | -------- | ------------- |
| `message` | `postback` | `equals` | `memberAdded` |

If the above rule is not added, the bot will respond with its default fallback story

## Member leaves the group

When a member leaves a group the bot is in, a postback event is triggered. To make the bot respond to this event, you must add a rule with the following condition

| Context   | Property   | Function | Value           |
| --------- | ---------- | -------- | --------------- |
| `message` | `postback` | `equals` | `memberRemoved` |

If the above rule is not added, the bot will respond with its default fallback story

## New group with bot

When a new group is created with the bot as a member, a postback event is triggered. To make the bot respond to this event, you must add a rule with the following condition

| Context   | Property   | Function | Value              |
| --------- | ---------- | -------- | ------------------ |
| `message` | `postback` | `equals` | `groupChatCreated` |

If the above rule is not added, the bot will respond with its default fallback story

## Reply to message

Inside a group, a Telegram bot only responds when one of its previous messages is **Replied** to

![The bot only responds to "Replied to" messages](https://2535542804-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LirAdLo22OkAW9w3tvY%2F-MkMNtWcs7C3sJrMwgII%2F-MkMQn7rRuEJXmxj0ujU%2FScreenshot_20210924-184854.png?alt=media\&token=4060be23-89c3-49f6-b751-cd6123d872c8)

{% hint style="info" %}
Tagging a bot by its username will not make the bot respond. Its message must be **Replied** to
{% endhint %}

When a bot provides quick replies in a group, clicking on a quick reply automatically "Replies to" the bot, thus making it easier to chat with in groups

{% hint style="warning" %}
Location quick replies do not work in groups
{% endhint %}
