<metaproperty="description"content="Sometimes, when interacting with Telegram users via private or secret chats, an action bar must be shown on top of the chat, offering convenient action buttons or notices regarding the user.">
<metaproperty="og:title"content="Action bar">
<metaproperty="og:image"content="">
<metaproperty="og:description"content="Sometimes, when interacting with Telegram users via private or secret chats, an action bar must be shown on top of the chat, offering convenient action buttons or notices regarding the user.">
<p>Sometimes, when interacting with Telegram users via private or secret chats, an action bar must be shown on top of the chat, offering convenient action buttons or notices regarding the user.</p>
<p>The action bar is represented by the <ahref="/constructor/peerSettings">peerSettings</a> constructor, fetchable using <ahref="/method/messages.getPeerSettings">messages.getPeerSettings</a>; it is also contained in the <ahref="/constructor/userFull">userFull</a> constructor returned by <ahref="/method/users.getFullUser">users.getFullUser</a>.</p>
<p>Changes to the chat bar may also be notified by the server using <ahref="/constructor/updatePeerSettings">updatePeerSettings</a>. </p>
<p>The currently active action bar may also be dismissed using <ahref="/method/messages.hidePeerSettingsBar">messages.hidePeerSettingsBar</a>. </p>
<p>What follows is a list of the various (<em>mutually exclusive</em>) chat bar types, along with the <strong>condition</strong> used to identify each type, by checking the appropriate flags of <ahref="/constructor/peerSettings">peerSettings</a>. </p>
<h3><aclass="anchor"href="#report-spam-block-or-add-contact"id="report-spam-block-or-add-contact"name="report-spam-block-or-add-contact"><iclass="anchor-icon"></i></a>Report spam, block or add contact</h3>
<p>This action bar, associated to a private or secret chat, offers the user buttons to:</p>
<ul>
<li>Report the chat for spam using <ahref="/method/account.reportPeer">account.reportPeer</a> and <ahref="/constructor/inputReportReasonSpam">inputReportReasonSpam</a>.<br>
If the other user has an emoji status, then the bar should also show a notice, indicating that the emoji status is shown next to the user's name because they have purchased <ahref="/api/premium">Telegram Premium</a> (i.e. this is useful to avoid issues if the user uses an emoji status similar to a verified checkmark).<br>
Additionally, if the chat was automatically <ahref="/api/folders#peer-folders">archived »</a> (according to <ahref="/constructor/peerSettings">peerSettings</a>.<code>autoarchived</code>), an extra button can be shown to unarchive the chat <ahref="/api/folders#peer-folders">as specified here »</a> instead of reporting it.</li>
<li>Add the other user of the chat to the contact list using <ahref="/method/contacts.addContact">contacts.addContact</a>.<br>
Optionally, the <ahref="/constructor/peerSettings">peerSettings</a>.<code>need_contacts_exception</code> flag may also be set: if so, the <code>add_phone_privacy_exception</code> flag <strong>must</strong> be set if the user clicks on the add contact button, invoking <ahref="/method/contacts.addContact">contacts.addContact</a>. </li>
<li>Block the other user of the chat from writing to us using <ahref="/method/contacts.block">contacts.block</a> (without setting the <code>my_stories_from</code> flag). </li>
</ul>
<p><strong>Condition</strong>: the <ahref="/constructor/peerSettings">peerSettings</a>.<code>report_spam</code>, <ahref="/constructor/peerSettings">peerSettings</a>.<code>add_contact</code>, <ahref="/constructor/peerSettings">peerSettings</a>.<code>block_contact</code> flags must all be set.</p>
<p>Additionally, if the <ahref="/constructor/peerSettings">peerSettings</a>.<code>geo_distance</code> flag is set, the bar should also display the distance between us and the user, indicating that the user found us by invoking <ahref="/method/contacts.getLocated">contacts.getLocated</a>, because we are currently advertising our location with the same method.</p>
<h3><aclass="anchor"href="#report-spam-or-unarchive"id="report-spam-or-unarchive"name="report-spam-or-unarchive"><iclass="anchor-icon"></i></a>Report spam or unarchive</h3>
<p>This action bar, associated to a private or secret chat, offers the user a button to report the chat for spam using <ahref="/method/account.reportPeer">account.reportPeer</a> and <ahref="/constructor/inputReportReasonSpam">inputReportReasonSpam</a>. </p>
<p>If the other user has an emoji status, then the bar should also show a notice, indicating that the emoji status is shown next to the user's name because they have purchased <ahref="/api/premium">Telegram Premium</a> (i.e. this is useful to avoid issues if the user uses an emoji status similar to a verified checkmark). </p>
<p><strong>Condition</strong>: the <ahref="/constructor/peerSettings">peerSettings</a>.<code>report_spam</code> flag must be set, and the <ahref="/constructor/peerSettings">peerSettings</a>.<code>add_contact</code>, <ahref="/constructor/peerSettings">peerSettings</a>.<code>block_contact</code> flags must <strong>not</strong> be set.</p>
<p>Additionally, if the chat was automatically <ahref="/api/folders#peer-folders">archived »</a> (according to <ahref="/constructor/peerSettings">peerSettings</a>.<code>autoarchived</code>), an extra button can be shown to unarchive the chat <ahref="/api/folders#peer-folders">as specified here »</a> instead of reporting it.</p>
<p>This action bar, associated to a private or secret chat, offers the user a button to add the other user of the chat to the contact list using <ahref="/method/contacts.addContact">contacts.addContact</a>. </p>
<p><strong>Conditions</strong>: the <ahref="/constructor/peerSettings">peerSettings</a>.<code>add_contact</code> flag must be set <strong>and</strong>:</p>
<ul>
<li>For secret chats, the chat must <strong>not</strong> be archived.</li>
<li>For private chats, the <code>block_contact</code> and <code>report_spam</code> flags must <strong>not</strong> be set.</li>
</ul>
<p>Optionally, the <ahref="/constructor/peerSettings">peerSettings</a>.<code>need_contacts_exception</code> flag may also be set: if so, the <code>add_phone_privacy_exception</code> flag <strong>must</strong> be set if the user clicks on the add contact button, invoking <ahref="/method/contacts.addContact">contacts.addContact</a>. </p>
<p>This action bar, associated to a private or secret chat, offers the user a button to share their phone number with the other user using <ahref="/method/contacts.acceptContact">contacts.acceptContact</a>. </p>
<p><strong>Condition</strong>: the <ahref="/constructor/peerSettings">peerSettings</a>.<code>share_contact</code> flag must be set.</p>
<p>This flag is set and the bar is activated only if the other user has added us as a contact using <ahref="/method/contacts.addContact">contacts.addContact</a>, without using a phone number, and none of the <code>add_contact</code>, <code>report_spam</code>, <code>block_contact</code> flags are set.</p>
<p>This bar indicates that the associated location-based supergroup can be reported for having an unrelated location using a bar button that invokes <ahref="/method/account.reportPeer">account.reportPeer</a> with <code>reason</code><ahref="/constructor/inputReportReasonGeoIrrelevant">inputReportReasonGeoIrrelevant</a>. </p>
<p><strong>Condition</strong>: the <ahref="/constructor/peerSettings">peerSettings</a>.<code>report_geo</code> flag must be set.</p>
<h3><aclass="anchor"href="#invite-new-members"id="invite-new-members"name="invite-new-members"><iclass="anchor-icon"></i></a>Invite new members</h3>
<p>This bar indicates that the associated group was created recently, and it offers a bar button to invite new members using <ahref="/method/messages.addChatUser">messages.addChatUser</a> or <ahref="/method/channels.inviteToChannel">channels.inviteToChannel</a>, depending on whether the associated peer is a <ahref="/api/channel">group or a supergroup</a>.</p>
<p><strong>Condition</strong>: the <ahref="/constructor/peerSettings">peerSettings</a>.<code>invite_members</code> flag must be set.</p>
<h3><aclass="anchor"href="#an-admin-from-a-recent-join-request-is-contacting-you"id="an-admin-from-a-recent-join-request-is-contacting-you"name="an-admin-from-a-recent-join-request-is-contacting-you"><iclass="anchor-icon"></i></a>An admin from a recent join request is contacting you</h3>
<p>This bar indicates that the associated private or secret chat is a chat with an administrator of a <ahref="/api/channel">group or channel</a> to which the user sent a <ahref="/api/invites#join-requests">join request, see here for more info on join requests »</a>. </p>
<p><strong>Condition</strong>: the <code>request_chat_title</code> and <code>request_chat_date</code> fields of <ahref="/constructor/peerSettings">peerSettings</a> must both be set; optionally <code>request_chat_broadcast</code> may also be set:</p>
<ul>
<li><code>request_chat_title</code> - Contains the group/channel's title.</li>
<li><code>request_chat_date</code> - Contains the timestamp indicating when the join request was sent.</li>
<li><code>request_chat_broadcast</code> - This flag is set if the join request is related to a channel (otherwise, the join request is related to a group).</li>
</ul></div>
</div>
</div>
</div>
<divclass="footer_wrap">
<divclass="footer_columns_wrap footer_desktop">
<divclass="footer_column footer_column_telegram">
<h5>Telegram</h5>
<divclass="footer_telegram_description"></div>
Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.