import { Client } from "https://deno.land/x/mtkruto@0.1.157/mod.ts";
Calls initConnection and authorizes the client with one of the following:
- Bot token (
string
) - Exported authorization (
types.AuthExportedAuthorization
) - User authorization handlers (
AuthorizeUserParams
)
if the current auth key doesn't throw AUTH_KEY_UNREGISTERED when calling updates.getState.
Notes:
- Requires the
apiId
andapiHash
paramters to be passed when constructing the client. - Reconnects the client to the appropriate DC in case of MIGRATE_X errors.
- The parameters passed to the initConnection call can be configured with the last parameter of the constructor.
Parameters
optional
params: string | types.auth.ExportedAuthorization | AuthorizeUserParams