import { Client } from "https://deno.land/x/mtkruto@0.1.182/mod.ts";
An MTKruto client.
Constructors
Constructs the client.
Properties
Invokes a function waiting and returning its reply if the second parameter is not true
. Requires the client
to be connected.
Methods
Add multiple stories to highlights. User-only.
Add a single story to highlights. User-only.
Answer a callback query. Bot-only.
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.
Loads the session if setDc
was not called, initializes and connnects
a ClientPlain
to generate auth key if there was none, and connects the client.
Before establishing the connection, the session is saved.
Create an invite link.
Delete all messages sent by a specific member of a chat. User-only.
Download a file.
Edit an inline message's reply markup. Bot-only.
Get information on a user's chat membership.
Get the invite links created for a chat. User-only.
Get custom emoji documents for download.
Get a channel or a supergroup's inputChannel. Useful when calling API functions directly.
Get a chat's inputPeer. Useful when calling API functions directly.
Get a user's inputUser. Useful when calling API functions directly.
Get the bot's commands in the given scope and/or language. Bot-only.
Get the bot's description in the given language. Bot-only.
Get the bot's name in the given language. Bot-only.
Get the bot's short description in the given language. Bot-only.
Get network statistics. This might not always be available.
Hide a username from the current account, a bot account, a supergroup, or a channel's profile. User-only.
Hide all usernames from the a supergroup or a channel's profile. User-only.
Kick a member from a chat. Same as a banChatMember call followed by unbanChatMember.
Remove multiple stories from highlights. User-only.
Remove a single story from highlights. User-only.
Reorder the usernames of the current account, a bot account, a supergroup, or a channel's profile. User-only.
Alias for invoke
with its second parameter being true
.
Send a venue.
Set a chat's available reactions. User-only.
Set the number of boosts required to circument a chat's default restrictions. User-only.
Sets the DC and resets the auth key stored in the session provider
if the stored DC was not the same as the dc
parameter.
Set the bot's commands in the given scope and/or language. Bot-only.
Set the bot's description in the given language. Bot-only.
Set the bot's name in the given language. Bot-only.
Set the bot's short description in the given language. Bot-only.
Show a username in the current account, a bot account, sa upergroup, or a channel's profile. User-only.
Same as calling .connect()
followed by .authorize(params)
.