mtcute/packages/client/src/methods/chats/mark-chat-unread.ts
teidesu b634aa01eb feat(client): markChatUnread method
now i might be stupid
2021-05-12 22:37:09 +03:00

23 lines
562 B
TypeScript

import { TelegramClient } from '../../client'
import { InputPeerLike } from '../../types'
import { normalizeToInputPeer } from '../../utils/peer-utils'
/**
* 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',
peer: normalizeToInputPeer(await this.resolvePeer(chatId)),
},
unread: true
})
}