2021-05-12 22:36:03 +03:00
|
|
|
import { TelegramClient } from '../../client'
|
|
|
|
import { InputPeerLike } from '../../types'
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Mark a chat as unread
|
|
|
|
*
|
|
|
|
* @param chatId Chat ID
|
|
|
|
* @internal
|
|
|
|
*/
|
|
|
|
export async function markChatUnread(
|
|
|
|
this: TelegramClient,
|
|
|
|
chatId: InputPeerLike
|
|
|
|
): Promise<void> {
|
|
|
|
await this.call({
|
|
|
|
_: 'messages.markDialogUnread',
|
|
|
|
peer: {
|
|
|
|
_: 'inputDialogPeer',
|
2021-05-15 20:25:59 +03:00
|
|
|
peer: await this.resolvePeer(chatId),
|
2021-05-12 22:36:03 +03:00
|
|
|
},
|
2021-05-12 22:37:09 +03:00
|
|
|
unread: true
|
2021-05-12 22:36:03 +03:00
|
|
|
})
|
|
|
|
}
|