Groups and participants
A conversation is either direct or group. A direct conversation is between one person and one agent. A group conversation has several people and any number of agents, and the rules for who may do what are the same for everyone in it.
Creating a conversation
robotelos.create_conversation takes a kind and an optional list of agents:
"direct": the agents listed (usually one) always answer every message."group": zero or more agents. The creator becomes the owner. Agents in a group answer only when they are mentioned.
Only group conversations change their participants after creation.
Roles
| Role | Can read | Can speak | Can invite or remove | Notes |
|---|---|---|---|---|
| owner | yes | yes | yes | The creator, and anyone an owner promotes. The last owner cannot leave or be demoted. |
| member | yes | yes | no | Joins by accepting an invitation. |
| guest | yes | yes | no | Guests can read and speak, like members. |
| observer | yes | no | no | Reads only. An observer’s messages are refused. |
Agents are participants with the role participant. An agent belongs to the owner who added it, so it leaves with that owner.
Membership: invite, join, leave
All membership changes use one command, robotelos.update_participant. Its content has a membership field:
| Membership | Who | What happens |
|---|---|---|
invite | an owner | Invites a member (the target) with an optional role. The invitee sees the invitation but cannot read or speak yet. |
join | the invitee, for themself | Accepts the invitation and gains the invited role. |
join | an owner | Adds an agent with agent_id, or changes the role of a member who already joined (role). |
leave | anyone, for themself | Leaves. |
leave | an owner | Removes another participant. |
A removed participant stops receiving events: its stream ends with resnapshot_required, and a new subscribe says the conversation is unknown to it.
Invitations need the conversation ID
Agents in a group
An agent is added by an owner, through join with agent_id. Its replies are authored by the agent, not by the owner who added it, and the message names the agent and its version.
An agent answers only when it is mentioned. A message in a group names the participants it addresses in its mentions field. A mentioned agent replies; an agent that is not mentioned stays quiet. This keeps a group from filling with replies to every message. In a direct conversation the agent always answers, because there is nobody else to address.
What a participant sees
Every participant sees the same events, except where a role limits what it may do. An observer sees everything a member sees. A participant that is removed sees nothing more.
Every participant has a kind (member, agent, party or system) in the conversation state. By design, external identifiers such as a phone number are kept out of conversation events; the participant state shows only the channel and the verification level.
Rules worth knowing
- The last owner of a group cannot leave or be demoted, so a group never loses all control.
- An agent leaves with its owner. Removing an owner removes the agents they added.
- The same rules apply on every transport and on PostgreSQL. These rules are covered by automated tests on every transport.
For the multi-device behavior of these roles, read Multiple clients. The command fields are in the command reference.
Next steps
Feedback
Was this page helpful?
Glad to hear it! Please tell us how we can improve.
Sorry to hear that. Please tell us how we can improve.