Telegram MT v0.1.1-alpha MTProto.API.Messages View Source

Working with Messages and Chats as explained in :

Link to this section Summary

Functions

Adds a user to a chat and sends a service message on it

Changes chat photo and sends a service message on it

Creates a new chat

Deletes a user from a chat and sends a service message on it

Deletes communication history

Deletes messages by their identifiers

Changes chat name and sends a service message on it

Forwards single messages

Forwards messages by their IDs

Returns basic chat information by chat identifiers

Returns the current user dialog list

Returns complete chat information by chat identifier

Returns message history for a chat

Returns the list of messages by their IDs

Notifies the sender about the recipient having listened a voice message or watched a video

Confirms receipt of messages by a client, cancels PUSH-notification sending

Sends multiple messages to contacts

Sends a non-text message

Sends a text message

Sends a current user typing event to a conversation partner or group

Link to this section Functions

Link to this function add_chat_user(chat, user_id, fwd_limit) View Source

Adds a user to a chat and sends a service message on it.

  • chat - ID of the chat (integer)
  • user_id - ID of the user to be added
  • fwd_limit - Number of last messages to be forwarded
Link to this function change_chat_photo(chat, photo) View Source

Changes chat photo and sends a service message on it.

  • chat - ID of the chat (integer)
  • photo - new photo, TL InputChatPhoto object
Link to this function create_chat(users, title) View Source

Creates a new chat.

  • users - List of user IDs to be invited (List of InputUser)
  • title - chat name
Link to this function delete_chat_user(chat, user_id) View Source

Deletes a user from a chat and sends a service message on it.

  • chat - ID of the chat (integer)
  • user_id - ID of the user to be removed
Link to this function delete_history(peer, offset) View Source

Deletes communication history.

  • peer - User or chat, communication history of which will be deleted
  • offset - Value from (messages.affectedHistory) or 0

Deletes messages by their identifiers.

  • list - Message ID list
Link to this function edit_chat_title(chat, title) View Source

Changes chat name and sends a service message on it.

  • chat - ID of the chat (integer)
  • title - new title of the chat (string)
Link to this function forward_message(peer, id) View Source

Forwards single messages.

  • peer - User or chat where a message will be forwarded
  • id - Forwarded message ID
Link to this function forward_messages(peer, list) View Source

Forwards messages by their IDs.

  • peer - User or chat where messages will be forwarded
  • list - Message ID list

Returns basic chat information by chat identifiers.

  • chats - list of chats IDs
Link to this function get_dialogs(offset, max_id, limit) View Source

Returns the current user dialog list.

  • offset - number of list elements to be skipped.
  • max_id - if a positive value was transmitted sent, the method will return only dialogs with IDs less than the set one.
  • limit - number of list elements to be returned.

Returns complete chat information by chat identifier.

  • chat - ID of the chat (integer)
Link to this function get_history(peer, offset, max_id, limit) View Source

Returns message history for a chat.

  • peer - Target user or group
  • offset - Number of list elements to be skipped
  • max_id - only messages with IDs less than max_id
  • limit - Number of list elements to be returned

Returns the list of messages by their IDs.

  • list - Message ID list.
Link to this function read_history(peer, max_id, offset, read_contents) View Source

Marks message history as read.

  • peer - Target user or group
  • max_id - only messages with identifiers less or equal than the given one will be read
  • offset - Value from (messages.affectedHistory)
  • read_contents - boolean
Link to this function read_message_contents(list) View Source

Notifies the sender about the recipient having listened a voice message or watched a video.

  • list - Message ID list
Link to this function received_messages(max_id) View Source

Confirms receipt of messages by a client, cancels PUSH-notification sending.

max_id - Maximum message ID available in a client

Link to this function search(peer, q, filter, min_date, max_date, offset, max_id, limit) View Source

Returns search messages.

  • peer - User or chat, histories with which are searched, or (inputPeerEmpty) constructor for global search
  • q - Text search request
  • filter - Additional filter
  • min_date - only messages with a sending date bigger than the transferred one will be returned
  • max_date - only messages with a sending date less than the transferred one will be returned
  • offset - Number of list elements to be skipped
  • max_id - If a positive value was transferred, the method will return only messages with IDs less than the set one
  • limit - Number of list elements to be returned
Link to this function send_broadcast(contacts, message, media) View Source

Sends multiple messages to contacts.

  • contacts - List of user ID to whom a message will be sent
  • message - Message text
  • media - Message media-contents

Sends a non-text message.

  • dst - user or group to receive the message, TL InputPeer object.
  • media - message content, TL InputMedia object.
Link to this function send_message(dst, message) View Source

Sends a text message.

  • dst - user or chat where a message will be sent, TL InputPeer object.
  • message - message text.
Link to this function set_typing(dst, typing, action) View Source

Sends a current user typing event to a conversation partner or group.

  • dst - Target user or group, TL InputPeer object.
  • typing - Typing status, boolean.
  • action - Type of action, TL SendMessageAction object.