Skip to main content
Module

x/mtkruto/mod.ts>UpdateAuthorizationState

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

A client's authorization state was changed.

client.on("authorizationState", (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.