Telegram User Bot icon

Telegram User Bot

Send messages and manage contacts via Telegram User Bot (MTProto)

Get Unread Chats

AI-generated

Summary

Retrieve a list of Telegram chats that have unread messages, limited to a specified maximum number of chats.

Inputs

  • Limit — Maximum number of unread chats to return. Defaults to 20.

Output shape

a list of chat objects with unread messages, each containing chat ID, name, type (user or group), unread message count, and an array of unread messages with details such as message ID, text, date, sender info, and media status.

The operation returns up to the specified limit of unread chats. For each chat, only incoming unread messages are included. If no unread chats exist, the output includes a single object indicating zero count and a message stating 'No unread chats'. The full message details include sender information if available.

Examples

Example 1: Example output array element

One item representing a chat with unread messages, showing chat metadata and messages array with sender info and text.

Discussion