mtcute/packages/client/src/methods/auth/send-recovery-code.ts

14 lines
389 B
TypeScript
Raw Normal View History

2021-04-08 12:19:38 +03:00
import { TelegramClient } from '../../client'
/**
* Send a code to email needed to recover your password
*
* @returns String containing email pattern to which the recovery code was sent
* @internal
*/
export function sendRecoveryCode(this: TelegramClient): Promise<string> {
return this.call({
_: 'auth.requestPasswordRecovery',
}).then((res) => res.emailPattern)
}