Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/mtkruto/3_types.ts>UpdateAuthorizationState

Cross-runtime JavaScript library for building Telegram clients
Latest
interface UpdateAuthorizationState
import { type UpdateAuthorizationState } from "https://deno.land/x/mtkruto@0.6.3/3_types.ts";

A client's authorization state was changed.

client.on("authorizationState", async (ctx) => {
  if (ctx.authorizationState.authorized) {
    const me = await ctx.client.getMe();
    console.log("The client is now authorized as", me.firstName);
  } else {
    console.log("The client is no longer authorized.")
  }
});

Properties

authorizationState: AuthorizationState

The client's new authorization state