UpdateAuthorizationState

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
DISCRIMINATOR

The client’s new authorization state