tdjson
Version:
TypeScript types for libtdjson.so
9,493 lines • 418 kB
JavaScript
"use strict";
/* eslint-disable @typescript-eslint/no-unsafe-return */
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());
});
};
var __generator = (this && this.__generator) || function (thisArg, body) {
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
function verb(n) { return function (v) { return step([n, v]); }; }
function step(op) {
if (f) throw new TypeError("Generator is already executing.");
while (g && (g = 0, op[0] && (_ = 0)), _) try {
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
if (y = 0, t) op = [op[0] & 2, t.value];
switch (op[0]) {
case 0: case 1: t = op; break;
case 4: _.label++; return { value: op[1], done: false };
case 5: _.label++; y = op[1]; op = [0]; continue;
case 7: op = _.ops.pop(); _.trys.pop(); continue;
default:
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
if (t[2]) _.ops.pop();
_.trys.pop(); continue;
}
op = body.call(thisArg, _);
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
}
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Tdjson = void 0;
var Tdjson = /** @class */ (function () {
function Tdjson() {
}
/**
Returns the current authorization state. This is an offline method. For informational purposes only. Use
updateAuthorizationState instead to maintain the current authorization state. Can be called before initialization.
*/
Tdjson.prototype.getAuthorizationState = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getAuthorizationState',
})];
});
});
};
/**
Sets the parameters for TDLib initialization. Works only when the current authorization state is
authorizationStateWaitTdlibParameters.
*/
Tdjson.prototype.setTdlibParameters = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setTdlibParameters' }))];
});
});
};
/**
Sets the phone number of the user and sends an authentication code to the user. Works only when the current
authorization state is authorizationStateWaitPhoneNumber, or if there is no pending authentication query and the current
authorization state is authorizationStateWaitPremiumPurchase, authorizationStateWaitEmailAddress,
authorizationStateWaitEmailCode, authorizationStateWaitCode, authorizationStateWaitRegistration, or
authorizationStateWaitPassword.
*/
Tdjson.prototype.setAuthenticationPhoneNumber = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setAuthenticationPhoneNumber' }))];
});
});
};
/**
Checks whether an in-store purchase of Telegram Premium is possible before authorization. Works only when the current
authorization state is authorizationStateWaitPremiumPurchase.
*/
Tdjson.prototype.checkAuthenticationPremiumPurchase = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'checkAuthenticationPremiumPurchase' }))];
});
});
};
/**
Informs server about an in-store purchase of Telegram Premium before authorization. Works only when the current
authorization state is authorizationStateWaitPremiumPurchase.
*/
Tdjson.prototype.setAuthenticationPremiumPurchaseTransaction = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setAuthenticationPremiumPurchaseTransaction' }))];
});
});
};
/**
Sets the email address of the user and sends an authentication code to the email address. Works only when the current
authorization state is authorizationStateWaitEmailAddress.
*/
Tdjson.prototype.setAuthenticationEmailAddress = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setAuthenticationEmailAddress' }))];
});
});
};
/**
Resends an authentication code to the user. Works only when the current authorization state is
authorizationStateWaitCode, the next_code_type of the result is not null and the server-specified timeout has passed, or
when the current authorization state is authorizationStateWaitEmailCode.
*/
Tdjson.prototype.resendAuthenticationCode = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'resendAuthenticationCode' }))];
});
});
};
/**
Checks the authentication of an email address. Works only when the current authorization state is
authorizationStateWaitEmailCode.
*/
Tdjson.prototype.checkAuthenticationEmailCode = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'checkAuthenticationEmailCode' }))];
});
});
};
/**
Checks the authentication code. Works only when the current authorization state is authorizationStateWaitCode.
*/
Tdjson.prototype.checkAuthenticationCode = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'checkAuthenticationCode' }))];
});
});
};
/**
Requests QR code authentication by scanning a QR code on another logged in device. Works only when the current
authorization state is authorizationStateWaitPhoneNumber, or if there is no pending authentication query and the current
authorization state is authorizationStateWaitPremiumPurchase, authorizationStateWaitEmailAddress,
authorizationStateWaitEmailCode, authorizationStateWaitCode, authorizationStateWaitRegistration, or
authorizationStateWaitPassword.
*/
Tdjson.prototype.requestQrCodeAuthentication = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'requestQrCodeAuthentication' }))];
});
});
};
/**
Finishes user registration. Works only when the current authorization state is authorizationStateWaitRegistration.
*/
Tdjson.prototype.registerUser = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'registerUser' }))];
});
});
};
/**
Resets the login email address. May return an error with a message "TASK_ALREADY_EXISTS" if reset is still pending.
Works only when the current authorization state is authorizationStateWaitEmailCode and
authorization_state.can_reset_email_address == true.
*/
Tdjson.prototype.resetAuthenticationEmailAddress = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'resetAuthenticationEmailAddress',
})];
});
});
};
/**
Checks the 2-step verification password for correctness. Works only when the current authorization state is
authorizationStateWaitPassword.
*/
Tdjson.prototype.checkAuthenticationPassword = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'checkAuthenticationPassword' }))];
});
});
};
/**
Requests to send a 2-step verification password recovery code to an email address that was previously set up. Works only
when the current authorization state is authorizationStateWaitPassword.
*/
Tdjson.prototype.requestAuthenticationPasswordRecovery = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'requestAuthenticationPasswordRecovery',
})];
});
});
};
/**
Checks whether a 2-step verification password recovery code sent to an email address is valid. Works only when the
current authorization state is authorizationStateWaitPassword.
*/
Tdjson.prototype.checkAuthenticationPasswordRecoveryCode = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'checkAuthenticationPasswordRecoveryCode' }))];
});
});
};
/**
Recovers the 2-step verification password with a password recovery code sent to an email address that was previously set
up. Works only when the current authorization state is authorizationStateWaitPassword.
*/
Tdjson.prototype.recoverAuthenticationPassword = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'recoverAuthenticationPassword' }))];
});
});
};
/**
Sends Firebase Authentication SMS to the phone number of the user. Works only when the current authorization state is
authorizationStateWaitCode and the server returned code of the type authenticationCodeTypeFirebaseAndroid or
authenticationCodeTypeFirebaseIos.
*/
Tdjson.prototype.sendAuthenticationFirebaseSms = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'sendAuthenticationFirebaseSms' }))];
});
});
};
/**
Reports that authentication code wasn't delivered via SMS; for official mobile applications only. Works only when the
current authorization state is authorizationStateWaitCode.
*/
Tdjson.prototype.reportAuthenticationCodeMissing = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'reportAuthenticationCodeMissing' }))];
});
});
};
/**
Checks the authentication token of a bot; to log in as a bot. Works only when the current authorization state is
authorizationStateWaitPhoneNumber. Can be used instead of setAuthenticationPhoneNumber and checkAuthenticationCode to
log in.
*/
Tdjson.prototype.checkAuthenticationBotToken = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'checkAuthenticationBotToken' }))];
});
});
};
/**
Closes the TDLib instance after a proper logout. Requires an available network connection. All local data will be
destroyed. After the logout completes, updateAuthorizationState with authorizationStateClosed will be sent.
*/
Tdjson.prototype.logOut = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'logOut',
})];
});
});
};
/**
Closes the TDLib instance. All databases will be flushed to disk and properly closed. After the close completes,
updateAuthorizationState with authorizationStateClosed will be sent. Can be called before initialization.
*/
Tdjson.prototype.close = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'close',
})];
});
});
};
/**
Closes the TDLib instance, destroying all local data without a proper logout. The current user session will remain in
the list of all active sessions. All local data will be destroyed. After the destruction completes
updateAuthorizationState with authorizationStateClosed will be sent. Can be called before authorization.
*/
Tdjson.prototype.destroy = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'destroy',
})];
});
});
};
/**
Confirms QR code authentication on another device. Returns created session on success.
*/
Tdjson.prototype.confirmQrCodeAuthentication = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'confirmQrCodeAuthentication' }))];
});
});
};
/**
Returns all updates needed to restore current TDLib state, i.e. all actual
updateAuthorizationState/updateUser/updateNewChat and others. This is especially useful if TDLib is run in a separate
process. Can be called before initialization.
*/
Tdjson.prototype.getCurrentState = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getCurrentState',
})];
});
});
};
/**
Changes the database encryption key. Usually the encryption key is never changed and is stored in some OS keychain.
*/
Tdjson.prototype.setDatabaseEncryptionKey = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setDatabaseEncryptionKey' }))];
});
});
};
/**
Returns the current state of 2-step verification.
*/
Tdjson.prototype.getPasswordState = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getPasswordState',
})];
});
});
};
/**
Changes the 2-step verification password for the current user. If a new recovery email address is specified, then the
change will not be applied until the new recovery email address is confirmed.
*/
Tdjson.prototype.setPassword = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setPassword' }))];
});
});
};
/**
Changes the login email address of the user. The email address can be changed only if the current user already has login
email and passwordState.login_email_address_pattern is non-empty. The change will not be applied until the new login
email address is confirmed with checkLoginEmailAddressCode. To use Apple ID/Google ID instead of an email address, call
checkLoginEmailAddressCode directly.
*/
Tdjson.prototype.setLoginEmailAddress = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setLoginEmailAddress' }))];
});
});
};
/**
Resends the login email address verification code.
*/
Tdjson.prototype.resendLoginEmailAddressCode = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'resendLoginEmailAddressCode',
})];
});
});
};
/**
Checks the login email address authentication.
*/
Tdjson.prototype.checkLoginEmailAddressCode = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'checkLoginEmailAddressCode' }))];
});
});
};
/**
Returns a 2-step verification recovery email address that was previously set up. This method can be used to verify a
password provided by the user.
*/
Tdjson.prototype.getRecoveryEmailAddress = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getRecoveryEmailAddress' }))];
});
});
};
/**
Changes the 2-step verification recovery email address of the user. If a new recovery email address is specified, then
the change will not be applied until the new recovery email address is confirmed. If new_recovery_email_address is the
same as the email address that is currently set up, this call succeeds immediately and aborts all other requests waiting
for an email confirmation.
*/
Tdjson.prototype.setRecoveryEmailAddress = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setRecoveryEmailAddress' }))];
});
});
};
/**
Checks the 2-step verification recovery email address verification code.
*/
Tdjson.prototype.checkRecoveryEmailAddressCode = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'checkRecoveryEmailAddressCode' }))];
});
});
};
/**
Resends the 2-step verification recovery email address verification code.
*/
Tdjson.prototype.resendRecoveryEmailAddressCode = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'resendRecoveryEmailAddressCode',
})];
});
});
};
/**
Cancels verification of the 2-step verification recovery email address.
*/
Tdjson.prototype.cancelRecoveryEmailAddressVerification = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'cancelRecoveryEmailAddressVerification',
})];
});
});
};
/**
Requests to send a 2-step verification password recovery code to an email address that was previously set up.
*/
Tdjson.prototype.requestPasswordRecovery = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'requestPasswordRecovery',
})];
});
});
};
/**
Checks whether a 2-step verification password recovery code sent to an email address is valid.
*/
Tdjson.prototype.checkPasswordRecoveryCode = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'checkPasswordRecoveryCode' }))];
});
});
};
/**
Recovers the 2-step verification password using a recovery code sent to an email address that was previously set up.
*/
Tdjson.prototype.recoverPassword = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'recoverPassword' }))];
});
});
};
/**
Removes 2-step verification password without previous password and access to recovery email address. The password can't
be reset immediately and the request needs to be repeated after the specified time.
*/
Tdjson.prototype.resetPassword = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'resetPassword',
})];
});
});
};
/**
Cancels reset of 2-step verification password. The method can be called if passwordState.pending_reset_date > 0.
*/
Tdjson.prototype.cancelPasswordReset = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'cancelPasswordReset',
})];
});
});
};
/**
Creates a new temporary password for processing payments.
*/
Tdjson.prototype.createTemporaryPassword = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'createTemporaryPassword' }))];
});
});
};
/**
Returns information about the current temporary password.
*/
Tdjson.prototype.getTemporaryPasswordState = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getTemporaryPasswordState',
})];
});
});
};
/**
Returns the current user.
*/
Tdjson.prototype.getMe = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getMe',
})];
});
});
};
/**
Returns information about a user by their identifier. This is an offline method if the current user is not a bot.
*/
Tdjson.prototype.getUser = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getUser' }))];
});
});
};
/**
Returns full information about a user by their identifier.
*/
Tdjson.prototype.getUserFullInfo = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getUserFullInfo' }))];
});
});
};
/**
Returns information about a basic group by its identifier. This is an offline method if the current user is not a bot.
*/
Tdjson.prototype.getBasicGroup = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getBasicGroup' }))];
});
});
};
/**
Returns full information about a basic group by its identifier.
*/
Tdjson.prototype.getBasicGroupFullInfo = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getBasicGroupFullInfo' }))];
});
});
};
/**
Returns information about a supergroup or a channel by its identifier. This is an offline method if the current user is
not a bot.
*/
Tdjson.prototype.getSupergroup = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getSupergroup' }))];
});
});
};
/**
Returns full information about a supergroup or a channel by its identifier, cached for up to 1 minute.
*/
Tdjson.prototype.getSupergroupFullInfo = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getSupergroupFullInfo' }))];
});
});
};
/**
Returns information about a secret chat by its identifier. This is an offline method.
*/
Tdjson.prototype.getSecretChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getSecretChat' }))];
});
});
};
/**
Returns information about a chat by its identifier. This is an offline method if the current user is not a bot.
*/
Tdjson.prototype.getChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChat' }))];
});
});
};
/**
Returns information about a message. Returns a 404 error if the message doesn't exist.
*/
Tdjson.prototype.getMessage = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getMessage' }))];
});
});
};
/**
Returns information about a message, if it is available without sending network request. Returns a 404 error if message
isn't available locally. This is an offline method.
*/
Tdjson.prototype.getMessageLocally = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getMessageLocally' }))];
});
});
};
/**
Returns information about a non-bundled message that is replied by a given message. Also, returns the pinned message for
messagePinMessage, the game message for messageGameScore, the invoice message for messagePaymentSuccessful, the message
with a previously set same background for messageChatSetBackground, the giveaway message for messageGiveawayCompleted,
the checklist message for messageChecklistTasksDone, messageChecklistTasksAdded, the message with suggested post
information for messageSuggestedPostApprovalFailed, messageSuggestedPostApproved, messageSuggestedPostDeclined,
messageSuggestedPostPaid, messageSuggestedPostRefunded, the message with the regular gift that was upgraded for
messageUpgradedGift with origin of the type upgradedGiftOriginUpgrade, and the topic creation message for topic messages
without non-bundled replied message. Returns a 404 error if the message doesn't exist.
*/
Tdjson.prototype.getRepliedMessage = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getRepliedMessage' }))];
});
});
};
/**
Returns information about a newest pinned message in the chat. Returns a 404 error if the message doesn't exist.
*/
Tdjson.prototype.getChatPinnedMessage = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatPinnedMessage' }))];
});
});
};
/**
Returns information about a message with the callback button that originated a callback query; for bots only.
*/
Tdjson.prototype.getCallbackQueryMessage = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getCallbackQueryMessage' }))];
});
});
};
/**
Returns information about messages. If a message is not found, returns null on the corresponding position of the result.
*/
Tdjson.prototype.getMessages = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getMessages' }))];
});
});
};
/**
Returns properties of a message. This is an offline method.
*/
Tdjson.prototype.getMessageProperties = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getMessageProperties' }))];
});
});
};
/**
Returns information about a message thread. Can be used only if messageProperties.can_get_message_thread == true.
*/
Tdjson.prototype.getMessageThread = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getMessageThread' }))];
});
});
};
/**
Returns read date of a recent outgoing message in a private chat. The method can be called if
messageProperties.can_get_read_date == true.
*/
Tdjson.prototype.getMessageReadDate = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getMessageReadDate' }))];
});
});
};
/**
Returns viewers of a recent outgoing message in a basic group or a supergroup chat. For video notes and voice notes only
users, opened content of the message, are returned. The method can be called if messageProperties.can_get_viewers ==
true.
*/
Tdjson.prototype.getMessageViewers = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getMessageViewers' }))];
});
});
};
/**
Returns information about actual author of a message sent on behalf of a channel. The method can be called if
messageProperties.can_get_author == true.
*/
Tdjson.prototype.getMessageAuthor = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getMessageAuthor' }))];
});
});
};
/**
Returns information about a file. This is an offline method.
*/
Tdjson.prototype.getFile = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getFile' }))];
});
});
};
/**
Returns information about a file by its remote identifier. This is an offline method. Can be used to register a URL as a
file for further uploading, or sending as a message. Even the request succeeds, the file can be used only if it is still
accessible to the user. For example, if the file is from a message, then the message must be not deleted and accessible
to the user. If the file database is disabled, then the corresponding object with the file must be preloaded by the
application.
*/
Tdjson.prototype.getRemoteFile = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getRemoteFile' }))];
});
});
};
/**
Loads more chats from a chat list. The loaded chats and their positions in the chat list will be sent through updates.
Chats are sorted by the pair (chat.position.order, chat.id) in descending order. Returns a 404 error if all chats have
been loaded.
*/
Tdjson.prototype.loadChats = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'loadChats' }))];
});
});
};
/**
Returns an ordered list of chats from the beginning of a chat list. For informational purposes only. Use loadChats and
updates processing instead to maintain chat lists in a consistent state.
*/
Tdjson.prototype.getChats = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChats' }))];
});
});
};
/**
Searches a public chat by its username. Currently, only private chats, supergroups and channels can be public. Returns
the chat if found; otherwise, an error is returned.
*/
Tdjson.prototype.searchPublicChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchPublicChat' }))];
});
});
};
/**
Searches public chats by looking for specified query in their username and title. Currently, only private chats,
supergroups and channels can be public. Returns a meaningful number of results. Excludes private chats with contacts and
chats from the chat list from the results.
*/
Tdjson.prototype.searchPublicChats = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchPublicChats' }))];
});
});
};
/**
Searches for the specified query in the title and username of already known chats. This is an offline method. Returns
chats in the order seen in the main chat list.
*/
Tdjson.prototype.searchChats = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchChats' }))];
});
});
};
/**
Searches for the specified query in the title and username of already known chats via request to the server. Returns
chats in the order seen in the main chat list.
*/
Tdjson.prototype.searchChatsOnServer = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchChatsOnServer' }))];
});
});
};
/**
Returns a list of channel chats recommended to the current user.
*/
Tdjson.prototype.getRecommendedChats = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getRecommendedChats',
})];
});
});
};
/**
Returns a list of chats similar to the given chat.
*/
Tdjson.prototype.getChatSimilarChats = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatSimilarChats' }))];
});
});
};
/**
Returns approximate number of chats similar to the given chat.
*/
Tdjson.prototype.getChatSimilarChatCount = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatSimilarChatCount' }))];
});
});
};
/**
Informs TDLib that a chat was opened from the list of similar chats. The method is independent of openChat and closeChat
methods.
*/
Tdjson.prototype.openChatSimilarChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'openChatSimilarChat' }))];
});
});
};
/**
Returns a list of bots similar to the given bot.
*/
Tdjson.prototype.getBotSimilarBots = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getBotSimilarBots' }))];
});
});
};
/**
Returns approximate number of bots similar to the given bot.
*/
Tdjson.prototype.getBotSimilarBotCount = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getBotSimilarBotCount' }))];
});
});
};
/**
Informs TDLib that a bot was opened from the list of similar bots.
*/
Tdjson.prototype.openBotSimilarBot = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'openBotSimilarBot' }))];
});
});
};
/**
Returns a list of frequently used chats.
*/
Tdjson.prototype.getTopChats = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getTopChats' }))];
});
});
};
/**
Removes a chat from the list of frequently used chats. Supported only if the chat info database is enabled.
*/
Tdjson.prototype.removeTopChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'removeTopChat' }))];
});
});
};
/**
Searches for the specified query in the title and username of up to 50 recently found chats. This is an offline method.
*/
Tdjson.prototype.searchRecentlyFoundChats = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchRecentlyFoundChats' }))];
});
});
};
/**
Adds a chat to the list of recently found chats. The chat is added to the beginning of the list. If the chat is already
in the list, it will be removed from the list first.
*/
Tdjson.prototype.addRecentlyFoundChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'addRecentlyFoundChat' }))];
});
});
};
/**
Removes a chat from the list of recently found chats.
*/
Tdjson.prototype.removeRecentlyFoundChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'removeRecentlyFoundChat' }))];
});
});
};
/**
Clears the list of recently found chats.
*/
Tdjson.prototype.clearRecentlyFoundChats = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'clearRecentlyFoundChats',
})];
});
});
};
/**
Returns recently opened chats. This is an offline method. Returns chats in the order of last opening.
*/
Tdjson.prototype.getRecentlyOpenedChats = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getRecentlyOpenedChats' }))];
});
});
};
/**
Checks whether a username can be set for a chat.
*/
Tdjson.prototype.checkChatUsername = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'checkChatUsername' }))];
});
});
};
/**
Returns a list of public chats of the specified type, owned by the user.
*/
Tdjson.prototype.getCreatedPublicChats = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getCreatedPublicChats' }))];
});
});
};
/**
Checks whether the maximum number of owned public chats has been reached. Returns corresponding error if the limit was
reached. The limit can be increased with Telegram Premium.
*/
Tdjson.prototype.checkCreatedPublicChatsLimit = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'checkCreatedPublicChatsLimit' }))];
});
});
};
/**
Returns a list of basic group and supergroup chats, which can be used as a discussion group for a channel. Returned
basic group chats must be first upgraded to supergroups before they can be set as a discussion group. To set a returned
supergroup as a discussion group, access to its old messages must be enabled using toggleSupergroupIsAllHistoryAvailable
first.
*/
Tdjson.prototype.getSuitableDiscussionChats = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getSuitableDiscussionChats',
})];
});
});
};
/**
Returns a list of recently inactive supergroups and channels. Can be used when user reaches limit on the number of
joined supergroups and channels and receives the error "CHANNELS_TOO_MUCH". Also, the limit can be increased with
Telegram Premium.
*/
Tdjson.prototype.getInactiveSupergroupChats = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getInactiveSupergroupChats',
})];
});
});
};
/**
Returns a list of channel chats, which can be used as a personal chat.
*/
Tdjson.prototype.getSuitablePersonalChats = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getSuitablePersonalChats',
})];
});
});
};
/**
Loads more topics in a channel direct messages chat administered by the current user. The loaded topics will be sent
through updateDirectMessagesChatTopic. Topics are sorted by their topic.order in descending order. Returns a 404 error
if all topics have been loaded.
*/
Tdjson.prototype.loadDirectMessagesChatTopics = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'loadDirectMessagesChatTopics' }))];
});
});
};
/**
Returns information about the topic in a channel direct messages chat administered by the current user.
*/
Tdjson.prototype.getDirectMessagesChatTopic = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getDirectMessagesChatTopic' }))];
});
});
};
/**
Returns messages in the topic in a channel direct messages chat administered by the current user. The messages are
returned in reverse chronological order (i.e., in order of decreasing message_id).
*/
Tdjson.prototype.getDirectMessagesChatTopicHistory = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getDirectMessagesChatTopicHistory' }))];
});
});
};
/**
Returns the last message sent in the topic in a channel direct messages chat administered by the current user no later
than the specified date.
*/
Tdjson.prototype.getDirectMessagesChatTopicMessageByDate = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getDirectMessagesChatTopicMessageByDate' }))];
});
});
};
/**
Deletes all messages in the topic in a channel direct messages chat administered by the current user.
*/
Tdjson.prototype.deleteDirectMessagesChatTopicHistory = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteDirectMessagesChatTopicHistory' }))];
});
});
};
/**
Deletes all messages between the specified dates in the topic in a channel direct messages chat administered by the
current user. Messages sent in the last 30 seconds will not be deleted.
*/
Tdjson.prototype.deleteDirectMessagesChatTopicMessagesByDate = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteDirectMessagesChatTopicMessagesByDate' }))];
});
});
};
/**
Changes the marked as unread state of the topic in a channel direct messages chat administered by the current user.
*/
Tdjson.prototype.setDirectMessagesChatTopicIsMarkedAsUnread = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setDirectMessagesChatTopicIsMarkedAsUnread' }))];
});
});
};
/**
Changes the draft message in the topic in a channel direct messages chat administered by the current user.
*/
Tdjson.prototype.setDirectMessagesChatTopicDraftMessage = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setDirectMessagesChatTopicDraftMessage' }))];
});
});
};
/**
Removes all pinned messages from the topic in a channel direct messages chat administered by the current user.
*/
Tdjson.prototype.unpinAllDirectMessagesChatTopicMessages = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'unpinAllDirectMessagesChatTopicMessages' }))];
});
});
};
/**
Removes all unread reactions in the topic in a channel direct messages chat administered by the current user.
*/
Tdjson.prototype.readAllDirectMessagesChatTopicReactions = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'readAllDirectMessagesChatTopicReactions' }))];
});
});
};
/**
Returns the total number of Telegram Stars received by the channel chat for direct messages from the given topic.
*/
Tdjson.prototype.getDirectMessagesChatTopicRevenue = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getDirectMessagesChatTopicRevenue' }))];
});
});
};
/**
Allows to send unpaid messages to the given topic of the channel direct messages chat administered by the current user.
*/
Tdjson.prototype.toggleDirectMessagesChatTopicCanSendUnpaidMessages = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleDirectMessagesChatTopicCanSendUnpaidMessages' }))];
});
});
};
/**
Loads more Saved Messages topics. The loaded topics will be sent through updateSavedMessagesTopic. Topics are sorted by
their topic.order in descending order. Returns a 404 error if all topics have been loaded.
*/
Tdjson.prototype.loadSavedMessagesTopics = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'loadSavedMessagesTopics' }))];
});
});
};
/**
Returns messages in a Saved Messages topic. The messages are returned in reverse chronological order (i.e., in order of
decreasing message_id).
*/
Tdjson.prototype.getSavedMessagesTopicHistory = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getSavedMessagesTopicHistory' }))];
});
});
};
/**
Returns the last message sent in a Saved Messages topic no later than the specified date.
*/
Tdjson.prototype.getSavedMessagesTopicMessageByDate = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getSavedMessagesTopicMessageByDate' }))];
});
});
};
/**
Deletes all messages in a Saved Messages topic.
*/
Tdjson.prototype.deleteSavedMessagesTopicHistory = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteSavedMessagesTopicHistory' }))];
});
});
};
/**
Deletes all messages between the specified dates in a Saved Messages topic. Messages sent in the last 30 seconds will
not be deleted.
*/
Tdjson.prototype.deleteSavedMessagesTopicMessagesByDate = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteSavedMessagesTopicMessagesByDate' }))];
});
});
};
/**
Changes the pinned state of a Saved Messages topic. There can be up to
getOption("pinned_saved_messages_topic_count_max") pinned topics. The limit can be increased with Telegram Premium.
*/
Tdjson.prototype.toggleSavedMessagesTopicIsPinned = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleSavedMessagesTopicIsPinned' }))];
});
});
};
/**
Changes the order of pinned Saved Messages topics.
*/
Tdjson.prototype.setPinnedSavedMessagesTopics = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setPinnedSavedMessagesTopics' }))];
});
});
};
/**
Returns a list of common group chats with a given user. Chats are sorted by their type and creation date.
*/
Tdjson.prototype.getGroupsInCommon = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getGroupsInCommon' }))];
});
});
};
/**
Returns messages in a chat. The messages are returned in reverse chronological order (i.e., in order of decreasing
message_id). For optimal performance, the number of returned messages is chosen by TDLib. This is an offline method if
only_local is true.
*/
Tdjson.prototype.getChatHistory = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatHistory' }))];
});
});
};
/**
Returns messages in a message thread of a message. Can be used only if messageProperties.can_get_message_thread == true.
Message thread of a channel message is in the channel's linked supergroup. The messages are returned in reverse
chronological order (i.e., in order of decreasing message_id). For optimal performance, the number of returned messages
is chosen by TDLib.
*/
Tdjson.prototype.getMessageThreadHistory = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getMessageThreadHistory' }))];
});
});
};
/**
Deletes all messages in the chat. Use chat.can_be_deleted_only_for_self and chat.can_be_deleted_for_all_users fields to
find whether and how the method can be applied to the chat.
*/
Tdjson.prototype.deleteChatHistory = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteChatHistory' }))];
});
});
};
/**
Deletes a chat along with all messages in the corresponding chat for all chat members. For group chats this will release
the usernames and remove all members. Use the field chat.can_be_deleted_for_all_users to find whether the method can be
applied to the chat.
*/
Tdjson.prototype.deleteChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteChat' }))];
});
});
};
/**
Searches for messages with given words in the chat. Returns the results in reverse chronological order, i.e. in order of
decreasing message_id. Cannot be used in secret chats with a non-empty query (searchSecretMessages must be used
instead), or without an enabled message database. For optimal performance, the number of returned messages is chosen by
TDLib and can be smaller than the specified limit. A combination of query, sender_id, filter and topic_id search
criteria is expected to be supported, only if it is required for Telegram official application implementation.
*/
Tdjson.prototype.searchChatMessages = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchChatMessages' }))];
});
});
};
/**
Searches for messages in all chats except secret chats. Returns the results in reverse chronological order (i.e., in
order of decreasing (date, chat_id, message_id)). For optimal performance, the number of returned messages is chosen by
TDLib and can be smaller than the specified limit.
*/
Tdjson.prototype.searchMessages = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchMessages' }))];
});
});
};
/**
Searches for messages in secret chats. Returns the results in reverse chronological order. For optimal performance, the
number of returned messages is chosen by TDLib.
*/
Tdjson.prototype.searchSecretMessages = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchSecretMessages' }))];
});
});
};
/**
Searches for messages tagged by the given reaction and with the given words in the Saved Messages chat; for Telegram
Premium users only. Returns the results in reverse chronological order, i.e. in order of decreasing message_id. For
optimal performance, the number of returned messages is chosen by TDLib and can be smaller than the specified limit.
*/
Tdjson.prototype.searchSavedMessages = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchSavedMessages' }))];
});
});
};
/**
Searches for call and group call messages. Returns the results in reverse chronological order (i.e., in order of
decreasing message_id). For optimal performance, the number of returned messages is chosen by TDLib.
*/
Tdjson.prototype.searchCallMessages = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchCallMessages' }))];
});
});
};
/**
Searches for outgoing messages with content of the type messageDocument in all chats except secret chats. Returns the
results in reverse chronological order.
*/
Tdjson.prototype.searchOutgoingDocumentMessages = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchOutgoingDocumentMessages' }))];
});
});
};
/**
Searches for public channel posts containing the given hashtag or cashtag. For optimal performance, the number of
returned messages is chosen by TDLib and can be smaller than the specified limit.
*/
Tdjson.prototype.searchPublicMessagesByTag = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchPublicMessagesByTag' }))];
});
});
};
/**
Searches for public stories containing the given hashtag or cashtag. For optimal performance, the number of returned
stories is chosen by TDLib and can be smaller than the specified limit.
*/
Tdjson.prototype.searchPublicStoriesByTag = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchPublicStoriesByTag' }))];
});
});
};
/**
Searches for public stories by the given address location. For optimal performance, the number of returned stories is
chosen by TDLib and can be smaller than the specified limit.
*/
Tdjson.prototype.searchPublicStoriesByLocation = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchPublicStoriesByLocation' }))];
});
});
};
/**
Searches for public stories from the given venue. For optimal performance, the number of returned stories is chosen by
TDLib and can be smaller than the specified limit.
*/
Tdjson.prototype.searchPublicStoriesByVenue = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchPublicStoriesByVenue' }))];
});
});
};
/**
Returns recently searched for hashtags or cashtags by their prefix.
*/
Tdjson.prototype.getSearchedForTags = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getSearchedForTags' }))];
});
});
};
/**
Removes a hashtag or a cashtag from the list of recently searched for hashtags or cashtags.
*/
Tdjson.prototype.removeSearchedForTag = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'removeSearchedForTag' }))];
});
});
};
/**
Clears the list of recently searched for hashtags or cashtags.
*/
Tdjson.prototype.clearSearchedForTags = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'clearSearchedForTags' }))];
});
});
};
/**
Deletes all call messages.
*/
Tdjson.prototype.deleteAllCallMessages = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteAllCallMessages' }))];
});
});
};
/**
Returns information about the recent locations of chat members that were sent to the chat. Returns up to 1 location
message per user.
*/
Tdjson.prototype.searchChatRecentLocationMessages = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchChatRecentLocationMessages' }))];
});
});
};
/**
Returns the last message sent in a chat no later than the specified date. Returns a 404 error if such message doesn't
exist.
*/
Tdjson.prototype.getChatMessageByDate = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatMessageByDate' }))];
});
});
};
/**
Returns sparse positions of messages of the specified type in the chat to be used for shared media scroll
implementation. Returns the results in reverse chronological order (i.e., in order of decreasing message_id). Cannot be
used in secret chats or with searchMessagesFilterFailedToSend filter without an enabled message database.
*/
Tdjson.prototype.getChatSparseMessagePositions = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatSparseMessagePositions' }))];
});
});
};
/**
Returns information about the next messages of the specified type in the chat split by days. Returns the results in
reverse chronological order. Can return partial result for the last returned day. Behavior of this method depends on the
value of the option "utc_time_offset".
*/
Tdjson.prototype.getChatMessageCalendar = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatMessageCalendar' }))];
});
});
};
/**
Returns approximate number of messages of the specified type in the chat or its topic.
*/
Tdjson.prototype.getChatMessageCount = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatMessageCount' }))];
});
});
};
/**
Returns approximate 1-based position of a message among messages, which can be found by the specified filter in the chat
and topic. Cannot be used in secret chats.
*/
Tdjson.prototype.getChatMessagePosition = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatMessagePosition' }))];
});
});
};
/**
Returns all scheduled messages in a chat. The messages are returned in reverse chronological order (i.e., in order of
decreasing message_id).
*/
Tdjson.prototype.getChatScheduledMessages = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatScheduledMessages' }))];
});
});
};
/**
Returns sponsored messages to be shown in a chat; for channel chats and chats with bots only.
*/
Tdjson.prototype.getChatSponsoredMessages = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatSponsoredMessages' }))];
});
});
};
/**
Informs TDLib that the user opened the sponsored chat via the button, the name, the chat photo, a mention in the
sponsored message text, or the media in the sponsored message.
*/
Tdjson.prototype.clickChatSponsoredMessage = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'clickChatSponsoredMessage' }))];
});
});
};
/**
Reports a sponsored message to Telegram moderators.
*/
Tdjson.prototype.reportChatSponsoredMessage = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'reportChatSponsoredMessage' }))];
});
});
};
/**
Returns sponsored chats to be shown in the search results.
*/
Tdjson.prototype.getSearchSponsoredChats = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getSearchSponsoredChats' }))];
});
});
};
/**
Informs TDLib that the user fully viewed a sponsored chat.
*/
Tdjson.prototype.viewSponsoredChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'viewSponsoredChat' }))];
});
});
};
/**
Informs TDLib that the user opened a sponsored chat.
*/
Tdjson.prototype.openSponsoredChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'openSponsoredChat' }))];
});
});
};
/**
Reports a sponsored chat to Telegram moderators.
*/
Tdjson.prototype.reportSponsoredChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'reportSponsoredChat' }))];
});
});
};
/**
Returns advertisements to be shown while a video from a message is watched. Available only if
messageProperties.can_get_video_advertisements.
*/
Tdjson.prototype.getVideoMessageAdvertisements = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getVideoMessageAdvertisements' }))];
});
});
};
/**
Informs TDLib that the user viewed a video message advertisement.
*/
Tdjson.prototype.viewVideoMessageAdvertisement = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'viewVideoMessageAdvertisement' }))];
});
});
};
/**
Informs TDLib that the user clicked a video message advertisement.
*/
Tdjson.prototype.clickVideoMessageAdvertisement = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'clickVideoMessageAdvertisement' }))];
});
});
};
/**
Reports a video message advertisement to Telegram moderators.
*/
Tdjson.prototype.reportVideoMessageAdvertisement = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'reportVideoMessageAdvertisement' }))];
});
});
};
/**
Removes an active notification from notification list. Needs to be called only if the notification is removed by the
current user.
*/
Tdjson.prototype.removeNotification = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'removeNotification' }))];
});
});
};
/**
Removes a group of active notifications. Needs to be called only if the notification group is removed by the current
user.
*/
Tdjson.prototype.removeNotificationGroup = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'removeNotificationGroup' }))];
});
});
};
/**
Returns an HTTPS link to a message in a chat. Available only if messageProperties.can_get_link, or if
messageProperties.can_get_media_timestamp_links and a media timestamp link is generated. This is an offline method.
*/
Tdjson.prototype.getMessageLink = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getMessageLink' }))];
});
});
};
/**
Returns an HTML code for embedding the message. Available only if messageProperties.can_get_embedding_code.
*/
Tdjson.prototype.getMessageEmbeddingCode = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getMessageEmbeddingCode' }))];
});
});
};
/**
Returns information about a public or private message link. Can be called for any internal link of the type
internalLinkTypeMessage.
*/
Tdjson.prototype.getMessageLinkInfo = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getMessageLinkInfo' }))];
});
});
};
/**
Translates a text to the given language. If the current user is a Telegram Premium user, then text formatting is
preserved.
*/
Tdjson.prototype.translateText = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'translateText' }))];
});
});
};
/**
Extracts text or caption of the given message and translates it to the given language. If the current user is a Telegram
Premium user, then text formatting is preserved.
*/
Tdjson.prototype.translateMessageText = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'translateMessageText' }))];
});
});
};
/**
Recognizes speech in a video note or a voice note message.
*/
Tdjson.prototype.recognizeSpeech = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'recognizeSpeech' }))];
});
});
};
/**
Rates recognized speech in a video note or a voice note message.
*/
Tdjson.prototype.rateSpeechRecognition = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'rateSpeechRecognition' }))];
});
});
};
/**
Returns the list of message sender identifiers, which can be used to send messages in a chat.
*/
Tdjson.prototype.getChatAvailableMessageSenders = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatAvailableMessageSenders' }))];
});
});
};
/**
Selects a message sender to send messages in a chat.
*/
Tdjson.prototype.setChatMessageSender = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setChatMessageSender' }))];
});
});
};
/**
Sends a message. Returns the sent message.
*/
Tdjson.prototype.sendMessage = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'sendMessage' }))];
});
});
};
/**
Sends 2-10 messages grouped together into an album. Currently, only audio, document, photo and video messages can be
grouped into an album. Documents and audio files can be only grouped in an album with messages of the same type. Returns
sent messages.
*/
Tdjson.prototype.sendMessageAlbum = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'sendMessageAlbum' }))];
});
});
};
/**
Invites a bot to a chat (if it is not yet a member) and sends it the /start command; requires can_invite_users member
right. Bots can't be invited to a private chat other than the chat with the bot. Bots can't be invited to channels
(although they can be added as admins) and secret chats. Returns the sent message.
*/
Tdjson.prototype.sendBotStartMessage = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'sendBotStartMessage' }))];
});
});
};
/**
Sends the result of an inline query as a message. Returns the sent message. Always clears a chat draft message.
*/
Tdjson.prototype.sendInlineQueryResultMessage = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'sendInlineQueryResultMessage' }))];
});
});
};
/**
Forwards previously sent messages. Returns the forwarded messages in the same order as the message identifiers passed in
message_ids. If a message can't be forwarded, null will be returned instead of the message.
*/
Tdjson.prototype.forwardMessages = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'forwardMessages' }))];
});
});
};
/**
Sends messages from a quick reply shortcut. Requires Telegram Business subscription. Can't be used to send paid
messages.
*/
Tdjson.prototype.sendQuickReplyShortcutMessages = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'sendQuickReplyShortcutMessages' }))];
});
});
};
/**
Resends messages which failed to send. Can be called only for messages for which messageSendingStateFailed.can_retry is
true and after specified in messageSendingStateFailed.retry_after time passed. If a message is re-sent, the
corresponding failed to send message is deleted. Returns the sent messages in the same order as the message identifiers
passed in message_ids. If a message can't be re-sent, null will be returned instead of the message.
*/
Tdjson.prototype.resendMessages = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'resendMessages' }))];
});
});
};
/**
Adds a local message to a chat. The message is persistent across application restarts only if the message database is
used. Returns the added message.
*/
Tdjson.prototype.addLocalMessage = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'addLocalMessage' }))];
});
});
};
/**
Deletes messages.
*/
Tdjson.prototype.deleteMessages = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteMessages' }))];
});
});
};
/**
Deletes all messages sent by the specified message sender in a chat. Supported only for supergroups; requires
can_delete_messages administrator right.
*/
Tdjson.prototype.deleteChatMessagesBySender = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteChatMessagesBySender' }))];
});
});
};
/**
Deletes all messages between the specified dates in a chat. Supported only for private chats and basic groups. Messages
sent in the last 30 seconds will not be deleted.
*/
Tdjson.prototype.deleteChatMessagesByDate = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteChatMessagesByDate' }))];
});
});
};
/**
Edits the text of a message (or a text of a game message). Returns the edited message after the edit is completed on the
server side.
*/
Tdjson.prototype.editMessageText = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editMessageText' }))];
});
});
};
/**
Edits the message content of a live location. Messages can be edited for a limited period of time specified in the live
location. Returns the edited message after the edit is completed on the server side.
*/
Tdjson.prototype.editMessageLiveLocation = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editMessageLiveLocation' }))];
});
});
};
/**
Edits the message content of a checklist. Returns the edited message after the edit is completed on the server side.
*/
Tdjson.prototype.editMessageChecklist = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editMessageChecklist' }))];
});
});
};
/**
Edits the media content of a message, including message caption. If only the caption needs to be edited, use
editMessageCaption instead. The type of message content in an album can't be changed with exception of replacing a photo
with a video or vice versa. Returns the edited message after the edit is completed on the server side.
*/
Tdjson.prototype.editMessageMedia = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editMessageMedia' }))];
});
});
};
/**
Edits the message content caption. Returns the edited message after the edit is completed on the server side.
*/
Tdjson.prototype.editMessageCaption = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editMessageCaption' }))];
});
});
};
/**
Edits the message reply markup; for bots only. Returns the edited message after the edit is completed on the server
side.
*/
Tdjson.prototype.editMessageReplyMarkup = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editMessageReplyMarkup' }))];
});
});
};
/**
Edits the text of an inline text or game message sent via a bot; for bots only.
*/
Tdjson.prototype.editInlineMessageText = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editInlineMessageText' }))];
});
});
};
/**
Edits the content of a live location in an inline message sent via a bot; for bots only.
*/
Tdjson.prototype.editInlineMessageLiveLocation = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editInlineMessageLiveLocation' }))];
});
});
};
/**
Edits the media content of a message with a text, an animation, an audio, a document, a photo or a video in an inline
message sent via a bot; for bots only.
*/
Tdjson.prototype.editInlineMessageMedia = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editInlineMessageMedia' }))];
});
});
};
/**
Edits the caption of an inline message sent via a bot; for bots only.
*/
Tdjson.prototype.editInlineMessageCaption = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editInlineMessageCaption' }))];
});
});
};
/**
Edits the reply markup of an inline message sent via a bot; for bots only.
*/
Tdjson.prototype.editInlineMessageReplyMarkup = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editInlineMessageReplyMarkup' }))];
});
});
};
/**
Edits the time when a scheduled message will be sent. Scheduling state of all messages in the same album or forwarded
together with the message will be also changed.
*/
Tdjson.prototype.editMessageSchedulingState = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editMessageSchedulingState' }))];
});
});
};
/**
Changes the fact-check of a message. Can be only used if messageProperties.can_set_fact_check == true.
*/
Tdjson.prototype.setMessageFactCheck = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setMessageFactCheck' }))];
});
});
};
/**
Sends a message on behalf of a business account; for bots only. Returns the message after it was sent.
*/
Tdjson.prototype.sendBusinessMessage = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'sendBusinessMessage' }))];
});
});
};
/**
Sends 2-10 messages grouped together into an album on behalf of a business account; for bots only. Currently, only
audio, document, photo and video messages can be grouped into an album. Documents and audio files can be only grouped in
an album with messages of the same type. Returns sent messages.
*/
Tdjson.prototype.sendBusinessMessageAlbum = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'sendBusinessMessageAlbum' }))];
});
});
};
/**
Edits the text of a text or game message sent on behalf of a business account; for bots only.
*/
Tdjson.prototype.editBusinessMessageText = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editBusinessMessageText' }))];
});
});
};
/**
Edits the content of a live location in a message sent on behalf of a business account; for bots only.
*/
Tdjson.prototype.editBusinessMessageLiveLocation = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editBusinessMessageLiveLocation' }))];
});
});
};
/**
Edits the content of a checklist in a message sent on behalf of a business account; for bots only.
*/
Tdjson.prototype.editBusinessMessageChecklist = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editBusinessMessageChecklist' }))];
});
});
};
/**
Edits the media content of a message with a text, an animation, an audio, a document, a photo or a video in a message
sent on behalf of a business account; for bots only.
*/
Tdjson.prototype.editBusinessMessageMedia = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editBusinessMessageMedia' }))];
});
});
};
/**
Edits the caption of a message sent on behalf of a business account; for bots only.
*/
Tdjson.prototype.editBusinessMessageCaption = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editBusinessMessageCaption' }))];
});
});
};
/**
Edits the reply markup of a message sent on behalf of a business account; for bots only.
*/
Tdjson.prototype.editBusinessMessageReplyMarkup = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editBusinessMessageReplyMarkup' }))];
});
});
};
/**
Stops a poll sent on behalf of a business account; for bots only.
*/
Tdjson.prototype.stopBusinessPoll = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'stopBusinessPoll' }))];
});
});
};
/**
Pins or unpins a message sent on behalf of a business account; for bots only.
*/
Tdjson.prototype.setBusinessMessageIsPinned = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setBusinessMessageIsPinned' }))];
});
});
};
/**
Reads a message on behalf of a business account; for bots only.
*/
Tdjson.prototype.readBusinessMessage = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'readBusinessMessage' }))];
});
});
};
/**
Deletes messages on behalf of a business account; for bots only.
*/
Tdjson.prototype.deleteBusinessMessages = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteBusinessMessages' }))];
});
});
};
/**
Changes a story posted by the bot on behalf of a business account; for bots only.
*/
Tdjson.prototype.editBusinessStory = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editBusinessStory' }))];
});
});
};
/**
Deletes a story posted by the bot on behalf of a business account; for bots only.
*/
Tdjson.prototype.deleteBusinessStory = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteBusinessStory' }))];
});
});
};
/**
Changes the first and last name of a business account; for bots only.
*/
Tdjson.prototype.setBusinessAccountName = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setBusinessAccountName' }))];
});
});
};
/**
Changes the bio of a business account; for bots only.
*/
Tdjson.prototype.setBusinessAccountBio = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setBusinessAccountBio' }))];
});
});
};
/**
Changes a profile photo of a business account; for bots only.
*/
Tdjson.prototype.setBusinessAccountProfilePhoto = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setBusinessAccountProfilePhoto' }))];
});
});
};
/**
Changes the editable username of a business account; for bots only.
*/
Tdjson.prototype.setBusinessAccountUsername = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setBusinessAccountUsername' }))];
});
});
};
/**
Changes settings for gift receiving of a business account; for bots only.
*/
Tdjson.prototype.setBusinessAccountGiftSettings = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setBusinessAccountGiftSettings' }))];
});
});
};
/**
Returns the amount of Telegram Stars owned by a business account; for bots only.
*/
Tdjson.prototype.getBusinessAccountStarAmount = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getBusinessAccountStarAmount' }))];
});
});
};
/**
Transfer Telegram Stars from the business account to the business bot; for bots only.
*/
Tdjson.prototype.transferBusinessAccountStars = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'transferBusinessAccountStars' }))];
});
});
};
/**
Checks validness of a name for a quick reply shortcut. Can be called synchronously.
*/
Tdjson.prototype.checkQuickReplyShortcutName = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'checkQuickReplyShortcutName' }))];
});
});
};
/**
Loads quick reply shortcuts created by the current user. The loaded data will be sent through updateQuickReplyShortcut
and updateQuickReplyShortcuts.
*/
Tdjson.prototype.loadQuickReplyShortcuts = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'loadQuickReplyShortcuts',
})];
});
});
};
/**
Changes name of a quick reply shortcut.
*/
Tdjson.prototype.setQuickReplyShortcutName = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setQuickReplyShortcutName' }))];
});
});
};
/**
Deletes a quick reply shortcut.
*/
Tdjson.prototype.deleteQuickReplyShortcut = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteQuickReplyShortcut' }))];
});
});
};
/**
Changes the order of quick reply shortcuts.
*/
Tdjson.prototype.reorderQuickReplyShortcuts = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'reorderQuickReplyShortcuts' }))];
});
});
};
/**
Loads quick reply messages that can be sent by a given quick reply shortcut. The loaded messages will be sent through
updateQuickReplyShortcutMessages.
*/
Tdjson.prototype.loadQuickReplyShortcutMessages = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'loadQuickReplyShortcutMessages' }))];
});
});
};
/**
Deletes specified quick reply messages.
*/
Tdjson.prototype.deleteQuickReplyShortcutMessages = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteQuickReplyShortcutMessages' }))];
});
});
};
/**
Adds a message to a quick reply shortcut. If shortcut doesn't exist and there are less than
getOption("quick_reply_shortcut_count_max") shortcuts, then a new shortcut is created. The shortcut must not contain
more than getOption("quick_reply_shortcut_message_count_max") messages after adding the new message. Returns the added
message.
*/
Tdjson.prototype.addQuickReplyShortcutMessage = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'addQuickReplyShortcutMessage' }))];
});
});
};
/**
Adds a message to a quick reply shortcut via inline bot. If shortcut doesn't exist and there are less than
getOption("quick_reply_shortcut_count_max") shortcuts, then a new shortcut is created. The shortcut must not contain
more than getOption("quick_reply_shortcut_message_count_max") messages after adding the new message. Returns the added
message.
*/
Tdjson.prototype.addQuickReplyShortcutInlineQueryResultMessage = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'addQuickReplyShortcutInlineQueryResultMessage' }))];
});
});
};
/**
Adds 2-10 messages grouped together into an album to a quick reply shortcut. Currently, only audio, document, photo and
video messages can be grouped into an album. Documents and audio files can be only grouped in an album with messages of
the same type. Returns sent messages.
*/
Tdjson.prototype.addQuickReplyShortcutMessageAlbum = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'addQuickReplyShortcutMessageAlbum' }))];
});
});
};
/**
Readds quick reply messages which failed to add. Can be called only for messages for which
messageSendingStateFailed.can_retry is true and after specified in messageSendingStateFailed.retry_after time passed. If
a message is readded, the corresponding failed to send message is deleted. Returns the sent messages in the same order
as the message identifiers passed in message_ids. If a message can't be readded, null will be returned instead of the
message.
*/
Tdjson.prototype.readdQuickReplyShortcutMessages = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'readdQuickReplyShortcutMessages' }))];
});
});
};
/**
Asynchronously edits the text, media or caption of a quick reply message. Use quickReplyMessage.can_be_edited to check
whether a message can be edited. Media message can be edited only to a media message. Checklist messages can be edited
only to a checklist message. The type of message content in an album can't be changed with exception of replacing a
photo with a video or vice versa.
*/
Tdjson.prototype.editQuickReplyMessage = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editQuickReplyMessage' }))];
});
});
};
/**
Returns the list of custom emoji, which can be used as forum topic icon by all users.
*/
Tdjson.prototype.getForumTopicDefaultIcons = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getForumTopicDefaultIcons',
})];
});
});
};
/**
Creates a topic in a forum supergroup chat; requires can_manage_topics administrator or can_create_topics member right
in the supergroup.
*/
Tdjson.prototype.createForumTopic = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'createForumTopic' }))];
});
});
};
/**
Edits title and icon of a topic in a forum supergroup chat; requires can_manage_topics administrator right in the
supergroup unless the user is creator of the topic.
*/
Tdjson.prototype.editForumTopic = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editForumTopic' }))];
});
});
};
/**
Returns information about a forum topic.
*/
Tdjson.prototype.getForumTopic = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getForumTopic' }))];
});
});
};
/**
Returns an HTTPS link to a topic in a forum chat. This is an offline method.
*/
Tdjson.prototype.getForumTopicLink = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getForumTopicLink' }))];
});
});
};
/**
Returns found forum topics in a forum chat. This is a temporary method for getting information about topic list from the
server.
*/
Tdjson.prototype.getForumTopics = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getForumTopics' }))];
});
});
};
/**
Changes the notification settings of a forum topic.
*/
Tdjson.prototype.setForumTopicNotificationSettings = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setForumTopicNotificationSettings' }))];
});
});
};
/**
Toggles whether a topic is closed in a forum supergroup chat; requires can_manage_topics administrator right in the
supergroup unless the user is creator of the topic.
*/
Tdjson.prototype.toggleForumTopicIsClosed = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleForumTopicIsClosed' }))];
});
});
};
/**
Toggles whether a General topic is hidden in a forum supergroup chat; requires can_manage_topics administrator right in
the supergroup.
*/
Tdjson.prototype.toggleGeneralForumTopicIsHidden = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleGeneralForumTopicIsHidden' }))];
});
});
};
/**
Changes the pinned state of a forum topic; requires can_manage_topics administrator right in the supergroup. There can
be up to getOption("pinned_forum_topic_count_max") pinned forum topics.
*/
Tdjson.prototype.toggleForumTopicIsPinned = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleForumTopicIsPinned' }))];
});
});
};
/**
Changes the order of pinned forum topics; requires can_manage_topics administrator right in the supergroup.
*/
Tdjson.prototype.setPinnedForumTopics = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setPinnedForumTopics' }))];
});
});
};
/**
Deletes all messages in a forum topic; requires can_delete_messages administrator right in the supergroup unless the
user is creator of the topic, the topic has no messages from other users and has at most 11 messages.
*/
Tdjson.prototype.deleteForumTopic = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteForumTopic' }))];
});
});
};
/**
Returns information about an emoji reaction. Returns a 404 error if the reaction is not found.
*/
Tdjson.prototype.getEmojiReaction = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getEmojiReaction' }))];
});
});
};
/**
Returns TGS stickers with generic animations for custom emoji reactions.
*/
Tdjson.prototype.getCustomEmojiReactionAnimations = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getCustomEmojiReactionAnimations',
})];
});
});
};
/**
Returns reactions, which can be added to a message. The list can change after updateActiveEmojiReactions,
updateChatAvailableReactions for the chat, or updateMessageInteractionInfo for the message.
*/
Tdjson.prototype.getMessageAvailableReactions = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getMessageAvailableReactions' }))];
});
});
};
/**
Clears the list of recently used reactions.
*/
Tdjson.prototype.clearRecentReactions = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'clearRecentReactions',
})];
});
});
};
/**
Adds a reaction or a tag to a message. Use getMessageAvailableReactions to receive the list of available reactions for
the message.
*/
Tdjson.prototype.addMessageReaction = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'addMessageReaction' }))];
});
});
};
/**
Removes a reaction from a message. A chosen reaction can always be removed.
*/
Tdjson.prototype.removeMessageReaction = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'removeMessageReaction' }))];
});
});
};
/**
Returns the list of message sender identifiers, which can be used to send a paid reaction in a chat.
*/
Tdjson.prototype.getChatAvailablePaidMessageReactionSenders = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatAvailablePaidMessageReactionSenders' }))];
});
});
};
/**
Adds the paid message reaction to a message. Use getMessageAvailableReactions to check whether the reaction is available
for the message.
*/
Tdjson.prototype.addPendingPaidMessageReaction = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'addPendingPaidMessageReaction' }))];
});
});
};
/**
Applies all pending paid reactions on a message.
*/
Tdjson.prototype.commitPendingPaidMessageReactions = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'commitPendingPaidMessageReactions' }))];
});
});
};
/**
Removes all pending paid reactions on a message.
*/
Tdjson.prototype.removePendingPaidMessageReactions = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'removePendingPaidMessageReactions' }))];
});
});
};
/**
Changes type of paid message reaction of the current user on a message. The message must have paid reaction added by the
current user.
*/
Tdjson.prototype.setPaidMessageReactionType = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setPaidMessageReactionType' }))];
});
});
};
/**
Sets reactions on a message; for bots only.
*/
Tdjson.prototype.setMessageReactions = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setMessageReactions' }))];
});
});
};
/**
Returns reactions added for a message, along with their sender.
*/
Tdjson.prototype.getMessageAddedReactions = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getMessageAddedReactions' }))];
});
});
};
/**
Changes type of default reaction for the current user.
*/
Tdjson.prototype.setDefaultReactionType = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setDefaultReactionType' }))];
});
});
};
/**
Returns tags used in Saved Messages or a Saved Messages topic.
*/
Tdjson.prototype.getSavedMessagesTags = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getSavedMessagesTags' }))];
});
});
};
/**
Changes label of a Saved Messages tag; for Telegram Premium users only.
*/
Tdjson.prototype.setSavedMessagesTagLabel = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setSavedMessagesTagLabel' }))];
});
});
};
/**
Returns information about a message effect. Returns a 404 error if the effect is not found.
*/
Tdjson.prototype.getMessageEffect = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getMessageEffect' }))];
});
});
};
/**
Searches for a given quote in a text. Returns found quote start position in UTF-16 code units. Returns a 404 error if
the quote is not found. Can be called synchronously.
*/
Tdjson.prototype.searchQuote = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchQuote' }))];
});
});
};
/**
Returns all entities (mentions, hashtags, cashtags, bot commands, bank card numbers, URLs, and email addresses) found in
the text. Can be called synchronously.
*/
Tdjson.prototype.getTextEntities = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getTextEntities' }))];
});
});
};
/**
Parses Bold, Italic, Underline, Strikethrough, Spoiler, CustomEmoji, BlockQuote, ExpandableBlockQuote, Code, Pre,
PreCode, TextUrl and MentionName entities from a marked-up text. Can be called synchronously.
*/
Tdjson.prototype.parseTextEntities = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'parseTextEntities' }))];
});
});
};
/**
Parses Markdown entities in a human-friendly format, ignoring markup errors. Can be called synchronously.
*/
Tdjson.prototype.parseMarkdown = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'parseMarkdown' }))];
});
});
};
/**
Replaces text entities with Markdown formatting in a human-friendly format. Entities that can't be represented in
Markdown unambiguously are kept as is. Can be called synchronously.
*/
Tdjson.prototype.getMarkdownText = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getMarkdownText' }))];
});
});
};
/**
Returns an emoji for the given country. Returns an empty string on failure. Can be called synchronously.
*/
Tdjson.prototype.getCountryFlagEmoji = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getCountryFlagEmoji' }))];
});
});
};
/**
Returns the MIME type of a file, guessed by its extension. Returns an empty string on failure. Can be called
synchronously.
*/
Tdjson.prototype.getFileMimeType = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getFileMimeType' }))];
});
});
};
/**
Returns the extension of a file, guessed by its MIME type. Returns an empty string on failure. Can be called
synchronously.
*/
Tdjson.prototype.getFileExtension = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getFileExtension' }))];
});
});
};
/**
Removes potentially dangerous characters from the name of a file. Returns an empty string on failure. Can be called
synchronously.
*/
Tdjson.prototype.cleanFileName = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'cleanFileName' }))];
});
});
};
/**
Returns a string stored in the local database from the specified localization target and language pack by its key.
Returns a 404 error if the string is not found. Can be called synchronously.
*/
Tdjson.prototype.getLanguagePackString = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getLanguagePackString' }))];
});
});
};
/**
Converts a JSON-serialized string to corresponding JsonValue object. Can be called synchronously.
*/
Tdjson.prototype.getJsonValue = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getJsonValue' }))];
});
});
};
/**
Converts a JsonValue object to corresponding JSON-serialized string. Can be called synchronously.
*/
Tdjson.prototype.getJsonString = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getJsonString' }))];
});
});
};
/**
Converts a themeParameters object to corresponding JSON-serialized string. Can be called synchronously.
*/
Tdjson.prototype.getThemeParametersJsonString = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getThemeParametersJsonString' }))];
});
});
};
/**
Changes the user answer to a poll. A poll in quiz mode can be answered only once.
*/
Tdjson.prototype.setPollAnswer = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setPollAnswer' }))];
});
});
};
/**
Returns message senders voted for the specified option in a non-anonymous polls. For optimal performance, the number of
returned users is chosen by TDLib.
*/
Tdjson.prototype.getPollVoters = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getPollVoters' }))];
});
});
};
/**
Stops a poll.
*/
Tdjson.prototype.stopPoll = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'stopPoll' }))];
});
});
};
/**
Adds tasks to a checklist in a message.
*/
Tdjson.prototype.addChecklistTasks = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'addChecklistTasks' }))];
});
});
};
/**
Adds tasks of a checklist in a message as done or not done.
*/
Tdjson.prototype.markChecklistTasksAsDone = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'markChecklistTasksAsDone' }))];
});
});
};
/**
Hides a suggested action.
*/
Tdjson.prototype.hideSuggestedAction = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'hideSuggestedAction' }))];
});
});
};
/**
Hides the list of contacts that have close birthdays for 24 hours.
*/
Tdjson.prototype.hideContactCloseBirthdays = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'hideContactCloseBirthdays',
})];
});
});
};
/**
Returns information about a business connection by its identifier; for bots only.
*/
Tdjson.prototype.getBusinessConnection = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getBusinessConnection' }))];
});
});
};
/**
Returns information about a button of type inlineKeyboardButtonTypeLoginUrl. The method needs to be called when the user
presses the button.
*/
Tdjson.prototype.getLoginUrlInfo = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getLoginUrlInfo' }))];
});
});
};
/**
Returns an HTTP URL which can be used to automatically authorize the user on a website after clicking an inline button
of type inlineKeyboardButtonTypeLoginUrl. Use the method getLoginUrlInfo to find whether a prior user confirmation is
needed. If an error is returned, then the button must be handled as an ordinary URL button.
*/
Tdjson.prototype.getLoginUrl = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getLoginUrl' }))];
});
});
};
/**
Shares users after pressing a keyboardButtonTypeRequestUsers button with the bot.
*/
Tdjson.prototype.shareUsersWithBot = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'shareUsersWithBot' }))];
});
});
};
/**
Shares a chat after pressing a keyboardButtonTypeRequestChat button with the bot.
*/
Tdjson.prototype.shareChatWithBot = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'shareChatWithBot' }))];
});
});
};
/**
Sends an inline query to a bot and returns its results. Returns an error with code 502 if the bot fails to answer the
query before the query timeout expires.
*/
Tdjson.prototype.getInlineQueryResults = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getInlineQueryResults' }))];
});
});
};
/**
Sets the result of an inline query; for bots only.
*/
Tdjson.prototype.answerInlineQuery = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'answerInlineQuery' }))];
});
});
};
/**
Saves an inline message to be sent by the given user; for bots only.
*/
Tdjson.prototype.savePreparedInlineMessage = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'savePreparedInlineMessage' }))];
});
});
};
/**
Saves an inline message to be sent by the given user.
*/
Tdjson.prototype.getPreparedInlineMessage = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getPreparedInlineMessage' }))];
});
});
};
/**
Returns the most grossing Web App bots.
*/
Tdjson.prototype.getGrossingWebAppBots = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getGrossingWebAppBots' }))];
});
});
};
/**
Returns information about a Web App by its short name. Returns a 404 error if the Web App is not found.
*/
Tdjson.prototype.searchWebApp = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchWebApp' }))];
});
});
};
/**
Returns a default placeholder for Web Apps of a bot. This is an offline method. Returns a 404 error if the placeholder
isn't known.
*/
Tdjson.prototype.getWebAppPlaceholder = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getWebAppPlaceholder' }))];
});
});
};
/**
Returns an HTTPS URL of a Web App to open after a link of the type internalLinkTypeWebApp is clicked.
*/
Tdjson.prototype.getWebAppLinkUrl = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getWebAppLinkUrl' }))];
});
});
};
/**
Returns information needed to open the main Web App of a bot.
*/
Tdjson.prototype.getMainWebApp = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getMainWebApp' }))];
});
});
};
/**
Returns an HTTPS URL of a Web App to open from the side menu, a keyboardButtonTypeWebApp button, or an
inlineQueryResultsButtonTypeWebApp button.
*/
Tdjson.prototype.getWebAppUrl = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getWebAppUrl' }))];
});
});
};
/**
Sends data received from a keyboardButtonTypeWebApp Web App to a bot.
*/
Tdjson.prototype.sendWebAppData = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'sendWebAppData' }))];
});
});
};
/**
Informs TDLib that a Web App is being opened from the attachment menu, a botMenuButton button, an
internalLinkTypeAttachmentMenuBot link, or an inlineKeyboardButtonTypeWebApp button. For each bot, a confirmation alert
about data sent to the bot must be shown once.
*/
Tdjson.prototype.openWebApp = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'openWebApp' }))];
});
});
};
/**
Informs TDLib that a previously opened Web App was closed.
*/
Tdjson.prototype.closeWebApp = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'closeWebApp' }))];
});
});
};
/**
Sets the result of interaction with a Web App and sends corresponding message on behalf of the user to the chat from
which the query originated; for bots only.
*/
Tdjson.prototype.answerWebAppQuery = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'answerWebAppQuery' }))];
});
});
};
/**
Checks whether a file can be downloaded and saved locally by Web App request.
*/
Tdjson.prototype.checkWebAppFileDownload = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'checkWebAppFileDownload' }))];
});
});
};
/**
Sends a callback query to a bot and returns an answer. Returns an error with code 502 if the bot fails to answer the
query before the query timeout expires.
*/
Tdjson.prototype.getCallbackQueryAnswer = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getCallbackQueryAnswer' }))];
});
});
};
/**
Sets the result of a callback query; for bots only.
*/
Tdjson.prototype.answerCallbackQuery = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'answerCallbackQuery' }))];
});
});
};
/**
Sets the result of a shipping query; for bots only.
*/
Tdjson.prototype.answerShippingQuery = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'answerShippingQuery' }))];
});
});
};
/**
Sets the result of a pre-checkout query; for bots only.
*/
Tdjson.prototype.answerPreCheckoutQuery = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'answerPreCheckoutQuery' }))];
});
});
};
/**
Updates the game score of the specified user in the game; for bots only.
*/
Tdjson.prototype.setGameScore = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setGameScore' }))];
});
});
};
/**
Updates the game score of the specified user in a game; for bots only.
*/
Tdjson.prototype.setInlineGameScore = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setInlineGameScore' }))];
});
});
};
/**
Returns the high scores for a game and some part of the high score table in the range of the specified user; for bots
only.
*/
Tdjson.prototype.getGameHighScores = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getGameHighScores' }))];
});
});
};
/**
Returns game high scores and some part of the high score table in the range of the specified user; for bots only.
*/
Tdjson.prototype.getInlineGameHighScores = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getInlineGameHighScores' }))];
});
});
};
/**
Deletes the default reply markup from a chat. Must be called after a one-time keyboard or a replyMarkupForceReply reply
markup has been used. An updateChatReplyMarkup update will be sent if the reply markup is changed.
*/
Tdjson.prototype.deleteChatReplyMarkup = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteChatReplyMarkup' }))];
});
});
};
/**
Sends a notification about user activity in a chat.
*/
Tdjson.prototype.sendChatAction = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'sendChatAction' }))];
});
});
};
/**
Informs TDLib that the chat is opened by the user. Many useful activities depend on the chat being opened or closed
(e.g., in supergroups and channels all updates are received only for opened chats).
*/
Tdjson.prototype.openChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'openChat' }))];
});
});
};
/**
Informs TDLib that the chat is closed by the user. Many useful activities depend on the chat being opened or closed.
*/
Tdjson.prototype.closeChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'closeChat' }))];
});
});
};
/**
Informs TDLib that messages are being viewed by the user. Sponsored messages must be marked as viewed only when the
entire text of the message is shown on the screen (excluding the button). Many useful activities depend on whether the
messages are currently being viewed or not (e.g., marking messages as read, incrementing a view counter, updating a view
counter, removing deleted messages in supergroups and channels).
*/
Tdjson.prototype.viewMessages = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'viewMessages' }))];
});
});
};
/**
Informs TDLib that the message content has been opened (e.g., the user has opened a photo, video, document, location or
venue, or has listened to an audio file or voice note message). An updateMessageContentOpened update will be generated
if something has changed.
*/
Tdjson.prototype.openMessageContent = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'openMessageContent' }))];
});
});
};
/**
Informs TDLib that a message with an animated emoji was clicked by the user. Returns a big animated sticker to be played
or a 404 error if usual animation needs to be played.
*/
Tdjson.prototype.clickAnimatedEmojiMessage = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'clickAnimatedEmojiMessage' }))];
});
});
};
/**
Returns an HTTPS or a tg: link with the given type. Can be called before authorization.
*/
Tdjson.prototype.getInternalLink = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getInternalLink' }))];
});
});
};
/**
Returns information about the type of internal link. Returns a 404 error if the link is not internal. Can be called
before authorization.
*/
Tdjson.prototype.getInternalLinkType = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getInternalLinkType' }))];
});
});
};
/**
Returns information about an action to be done when the current user clicks an external link. Don't use this method for
links from secret chats if link preview is disabled in secret chats.
*/
Tdjson.prototype.getExternalLinkInfo = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getExternalLinkInfo' }))];
});
});
};
/**
Returns an HTTP URL which can be used to automatically authorize the current user on a website after clicking an HTTP
link. Use the method getExternalLinkInfo to find whether a prior user confirmation is needed.
*/
Tdjson.prototype.getExternalLink = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getExternalLink' }))];
});
});
};
/**
Marks all mentions in a chat as read.
*/
Tdjson.prototype.readAllChatMentions = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'readAllChatMentions' }))];
});
});
};
/**
Marks all mentions in a forum topic as read.
*/
Tdjson.prototype.readAllMessageThreadMentions = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'readAllMessageThreadMentions' }))];
});
});
};
/**
Marks all reactions in a chat or a forum topic as read.
*/
Tdjson.prototype.readAllChatReactions = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'readAllChatReactions' }))];
});
});
};
/**
Marks all reactions in a forum topic as read.
*/
Tdjson.prototype.readAllMessageThreadReactions = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'readAllMessageThreadReactions' }))];
});
});
};
/**
Returns an existing chat corresponding to a given user.
*/
Tdjson.prototype.createPrivateChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'createPrivateChat' }))];
});
});
};
/**
Returns an existing chat corresponding to a known basic group.
*/
Tdjson.prototype.createBasicGroupChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'createBasicGroupChat' }))];
});
});
};
/**
Returns an existing chat corresponding to a known supergroup or channel.
*/
Tdjson.prototype.createSupergroupChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'createSupergroupChat' }))];
});
});
};
/**
Returns an existing chat corresponding to a known secret chat.
*/
Tdjson.prototype.createSecretChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'createSecretChat' }))];
});
});
};
/**
Creates a new basic group and sends a corresponding messageBasicGroupChatCreate. Returns information about the newly
created chat.
*/
Tdjson.prototype.createNewBasicGroupChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'createNewBasicGroupChat' }))];
});
});
};
/**
Creates a new supergroup or channel and sends a corresponding messageSupergroupChatCreate. Returns the newly created
chat.
*/
Tdjson.prototype.createNewSupergroupChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'createNewSupergroupChat' }))];
});
});
};
/**
Creates a new secret chat. Returns the newly created chat.
*/
Tdjson.prototype.createNewSecretChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'createNewSecretChat' }))];
});
});
};
/**
Creates a new supergroup from an existing basic group and sends a corresponding messageChatUpgradeTo and
messageChatUpgradeFrom; requires owner privileges. Deactivates the original basic group.
*/
Tdjson.prototype.upgradeBasicGroupChatToSupergroupChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'upgradeBasicGroupChatToSupergroupChat' }))];
});
});
};
/**
Returns chat lists to which the chat can be added. This is an offline method.
*/
Tdjson.prototype.getChatListsToAddChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatListsToAddChat' }))];
});
});
};
/**
Adds a chat to a chat list. A chat can't be simultaneously in Main and Archive chat lists, so it is automatically
removed from another one if needed.
*/
Tdjson.prototype.addChatToList = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'addChatToList' }))];
});
});
};
/**
Returns information about a chat folder by its identifier.
*/
Tdjson.prototype.getChatFolder = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatFolder' }))];
});
});
};
/**
Creates new chat folder. Returns information about the created chat folder. There can be up to
getOption("chat_folder_count_max") chat folders, but the limit can be increased with Telegram Premium.
*/
Tdjson.prototype.createChatFolder = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'createChatFolder' }))];
});
});
};
/**
Edits existing chat folder. Returns information about the edited chat folder.
*/
Tdjson.prototype.editChatFolder = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editChatFolder' }))];
});
});
};
/**
Deletes existing chat folder.
*/
Tdjson.prototype.deleteChatFolder = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteChatFolder' }))];
});
});
};
/**
Returns identifiers of pinned or always included chats from a chat folder, which are suggested to be left when the chat
folder is deleted.
*/
Tdjson.prototype.getChatFolderChatsToLeave = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatFolderChatsToLeave' }))];
});
});
};
/**
Returns approximate number of chats in a being created chat folder. Main and archive chat lists must be fully preloaded
for this function to work correctly.
*/
Tdjson.prototype.getChatFolderChatCount = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatFolderChatCount' }))];
});
});
};
/**
Changes the order of chat folders.
*/
Tdjson.prototype.reorderChatFolders = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'reorderChatFolders' }))];
});
});
};
/**
Toggles whether chat folder tags are enabled.
*/
Tdjson.prototype.toggleChatFolderTags = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleChatFolderTags' }))];
});
});
};
/**
Returns recommended chat folders for the current user.
*/
Tdjson.prototype.getRecommendedChatFolders = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getRecommendedChatFolders',
})];
});
});
};
/**
Returns default icon name for a folder. Can be called synchronously.
*/
Tdjson.prototype.getChatFolderDefaultIconName = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatFolderDefaultIconName' }))];
});
});
};
/**
Returns identifiers of chats from a chat folder, suitable for adding to a chat folder invite link.
*/
Tdjson.prototype.getChatsForChatFolderInviteLink = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatsForChatFolderInviteLink' }))];
});
});
};
/**
Creates a new invite link for a chat folder. A link can be created for a chat folder if it has only pinned and included
chats.
*/
Tdjson.prototype.createChatFolderInviteLink = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'createChatFolderInviteLink' }))];
});
});
};
/**
Returns invite links created by the current user for a shareable chat folder.
*/
Tdjson.prototype.getChatFolderInviteLinks = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatFolderInviteLinks' }))];
});
});
};
/**
Edits an invite link for a chat folder.
*/
Tdjson.prototype.editChatFolderInviteLink = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editChatFolderInviteLink' }))];
});
});
};
/**
Deletes an invite link for a chat folder.
*/
Tdjson.prototype.deleteChatFolderInviteLink = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteChatFolderInviteLink' }))];
});
});
};
/**
Checks the validity of an invite link for a chat folder and returns information about the corresponding chat folder.
*/
Tdjson.prototype.checkChatFolderInviteLink = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'checkChatFolderInviteLink' }))];
});
});
};
/**
Adds a chat folder by an invite link.
*/
Tdjson.prototype.addChatFolderByInviteLink = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'addChatFolderByInviteLink' }))];
});
});
};
/**
Returns new chats added to a shareable chat folder by its owner. The method must be called at most once in
getOption("chat_folder_new_chats_update_period") for the given chat folder.
*/
Tdjson.prototype.getChatFolderNewChats = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatFolderNewChats' }))];
});
});
};
/**
Process new chats added to a shareable chat folder by its owner.
*/
Tdjson.prototype.processChatFolderNewChats = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'processChatFolderNewChats' }))];
});
});
};
/**
Returns settings for automatic moving of chats to and from the Archive chat lists.
*/
Tdjson.prototype.getArchiveChatListSettings = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getArchiveChatListSettings',
})];
});
});
};
/**
Changes settings for automatic moving of chats to and from the Archive chat lists.
*/
Tdjson.prototype.setArchiveChatListSettings = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setArchiveChatListSettings' }))];
});
});
};
/**
Changes the chat title. Supported only for basic groups, supergroups and channels. Requires can_change_info member
right.
*/
Tdjson.prototype.setChatTitle = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setChatTitle' }))];
});
});
};
/**
Changes the photo of a chat. Supported only for basic groups, supergroups and channels. Requires can_change_info member
right.
*/
Tdjson.prototype.setChatPhoto = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setChatPhoto' }))];
});
});
};
/**
Changes accent color and background custom emoji of a channel chat. Requires can_change_info administrator right.
*/
Tdjson.prototype.setChatAccentColor = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setChatAccentColor' }))];
});
});
};
/**
Changes accent color and background custom emoji for profile of a supergroup or channel chat. Requires can_change_info
administrator right.
*/
Tdjson.prototype.setChatProfileAccentColor = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setChatProfileAccentColor' }))];
});
});
};
/**
Changes the message auto-delete or self-destruct (for secret chats) time in a chat. Requires change_info administrator
right in basic groups, supergroups and channels. Message auto-delete time can't be changed in a chat with the current
user (Saved Messages) and the chat 777000 (Telegram).
*/
Tdjson.prototype.setChatMessageAutoDeleteTime = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setChatMessageAutoDeleteTime' }))];
});
});
};
/**
Changes the emoji status of a chat. Use chatBoostLevelFeatures.can_set_emoji_status to check whether an emoji status can
be set. Requires can_change_info administrator right.
*/
Tdjson.prototype.setChatEmojiStatus = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setChatEmojiStatus' }))];
});
});
};
/**
Changes the chat members permissions. Supported only for basic groups and supergroups. Requires can_restrict_members
administrator right.
*/
Tdjson.prototype.setChatPermissions = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setChatPermissions' }))];
});
});
};
/**
Sets the background in a specific chat. Supported only in private and secret chats with non-deleted users, and in chats
with sufficient boost level and can_change_info administrator right.
*/
Tdjson.prototype.setChatBackground = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setChatBackground' }))];
});
});
};
/**
Deletes background in a specific chat.
*/
Tdjson.prototype.deleteChatBackground = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteChatBackground' }))];
});
});
};
/**
Changes the chat theme. Supported only in private and secret chats.
*/
Tdjson.prototype.setChatTheme = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setChatTheme' }))];
});
});
};
/**
Changes the draft message in a chat.
*/
Tdjson.prototype.setChatDraftMessage = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setChatDraftMessage' }))];
});
});
};
/**
Changes the notification settings of a chat. Notification settings of a chat with the current user (Saved Messages)
can't be changed.
*/
Tdjson.prototype.setChatNotificationSettings = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setChatNotificationSettings' }))];
});
});
};
/**
Changes the ability of users to save, forward, or copy chat content. Supported only for basic groups, supergroups and
channels. Requires owner privileges.
*/
Tdjson.prototype.toggleChatHasProtectedContent = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleChatHasProtectedContent' }))];
});
});
};
/**
Changes the view_as_topics setting of a forum chat or Saved Messages.
*/
Tdjson.prototype.toggleChatViewAsTopics = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleChatViewAsTopics' }))];
});
});
};
/**
Changes the translatable state of a chat.
*/
Tdjson.prototype.toggleChatIsTranslatable = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleChatIsTranslatable' }))];
});
});
};
/**
Changes the marked as unread state of a chat.
*/
Tdjson.prototype.toggleChatIsMarkedAsUnread = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleChatIsMarkedAsUnread' }))];
});
});
};
/**
Changes the value of the default disable_notification parameter, used when a message is sent to a chat.
*/
Tdjson.prototype.toggleChatDefaultDisableNotification = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleChatDefaultDisableNotification' }))];
});
});
};
/**
Changes reactions, available in a chat. Available for basic groups, supergroups, and channels. Requires can_change_info
member right.
*/
Tdjson.prototype.setChatAvailableReactions = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setChatAvailableReactions' }))];
});
});
};
/**
Changes application-specific data associated with a chat.
*/
Tdjson.prototype.setChatClientData = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setChatClientData' }))];
});
});
};
/**
Changes information about a chat. Available for basic groups, supergroups, and channels. Requires can_change_info member
right.
*/
Tdjson.prototype.setChatDescription = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setChatDescription' }))];
});
});
};
/**
Changes the discussion group of a channel chat; requires can_change_info administrator right in the channel if it is
specified.
*/
Tdjson.prototype.setChatDiscussionGroup = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setChatDiscussionGroup' }))];
});
});
};
/**
Changes direct messages group settings for a channel chat; requires owner privileges in the chat.
*/
Tdjson.prototype.setChatDirectMessagesGroup = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setChatDirectMessagesGroup' }))];
});
});
};
/**
Changes the location of a chat. Available only for some location-based supergroups, use
supergroupFullInfo.can_set_location to check whether the method is allowed to use.
*/
Tdjson.prototype.setChatLocation = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setChatLocation' }))];
});
});
};
/**
Changes the slow mode delay of a chat. Available only for supergroups; requires can_restrict_members right.
*/
Tdjson.prototype.setChatSlowModeDelay = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setChatSlowModeDelay' }))];
});
});
};
/**
Pins a message in a chat. A message can be pinned only if messageProperties.can_be_pinned.
*/
Tdjson.prototype.pinChatMessage = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'pinChatMessage' }))];
});
});
};
/**
Removes a pinned message from a chat; requires can_pin_messages member right if the chat is a basic group or supergroup,
or can_edit_messages administrator right if the chat is a channel.
*/
Tdjson.prototype.unpinChatMessage = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'unpinChatMessage' }))];
});
});
};
/**
Removes all pinned messages from a chat; requires can_pin_messages member right if the chat is a basic group or
supergroup, or can_edit_messages administrator right if the chat is a channel.
*/
Tdjson.prototype.unpinAllChatMessages = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'unpinAllChatMessages' }))];
});
});
};
/**
Removes all pinned messages from a forum topic; requires can_pin_messages member right in the supergroup.
*/
Tdjson.prototype.unpinAllMessageThreadMessages = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'unpinAllMessageThreadMessages' }))];
});
});
};
/**
Adds the current user as a new member to a chat. Private and secret chats can't be joined using this method. May return
an error with a message "INVITE_REQUEST_SENT" if only a join request was created.
*/
Tdjson.prototype.joinChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'joinChat' }))];
});
});
};
/**
Removes the current user from chat members. Private and secret chats can't be left using this method.
*/
Tdjson.prototype.leaveChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'leaveChat' }))];
});
});
};
/**
Adds a new member to a chat; requires can_invite_users member right. Members can't be added to private or secret chats.
Returns information about members that weren't added.
*/
Tdjson.prototype.addChatMember = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'addChatMember' }))];
});
});
};
/**
Adds multiple new members to a chat; requires can_invite_users member right. Currently, this method is only available
for supergroups and channels. This method can't be used to join a chat. Members can't be added to a channel if it has
more than 200 members. Returns information about members that weren't added.
*/
Tdjson.prototype.addChatMembers = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'addChatMembers' }))];
});
});
};
/**
Changes the status of a chat member; requires can_invite_users member right to add a chat member, can_promote_members
administrator right to change administrator rights of the member, and can_restrict_members administrator right to change
restrictions of a user. This function is currently not suitable for transferring chat ownership; use
transferChatOwnership instead. Use addChatMember or banChatMember if some additional parameters needs to be passed.
*/
Tdjson.prototype.setChatMemberStatus = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setChatMemberStatus' }))];
});
});
};
/**
Bans a member in a chat; requires can_restrict_members administrator right. Members can't be banned in private or secret
chats. In supergroups and channels, the user will not be able to return to the group on their own using invite links,
etc., unless unbanned first.
*/
Tdjson.prototype.banChatMember = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'banChatMember' }))];
});
});
};
/**
Checks whether the current session can be used to transfer a chat ownership to another user.
*/
Tdjson.prototype.canTransferOwnership = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'canTransferOwnership',
})];
});
});
};
/**
Changes the owner of a chat; requires owner privileges in the chat. Use the method canTransferOwnership to check whether
the ownership can be transferred from the current session. Available only for supergroups and channel chats.
*/
Tdjson.prototype.transferChatOwnership = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'transferChatOwnership' }))];
});
});
};
/**
Returns information about a single member of a chat.
*/
Tdjson.prototype.getChatMember = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatMember' }))];
});
});
};
/**
Searches for a specified query in the first name, last name and usernames of the members of a specified chat. Requires
administrator rights if the chat is a channel.
*/
Tdjson.prototype.searchChatMembers = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchChatMembers' }))];
});
});
};
/**
Returns a list of administrators of the chat with their custom titles.
*/
Tdjson.prototype.getChatAdministrators = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatAdministrators' }))];
});
});
};
/**
Clears message drafts in all chats.
*/
Tdjson.prototype.clearAllDraftMessages = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'clearAllDraftMessages' }))];
});
});
};
/**
Returns saved notification sound by its identifier. Returns a 404 error if there is no saved notification sound with the
specified identifier.
*/
Tdjson.prototype.getSavedNotificationSound = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getSavedNotificationSound' }))];
});
});
};
/**
Returns the list of saved notification sounds. If a sound isn't in the list, then default sound needs to be used.
*/
Tdjson.prototype.getSavedNotificationSounds = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getSavedNotificationSounds',
})];
});
});
};
/**
Adds a new notification sound to the list of saved notification sounds. The new notification sound is added to the top
of the list. If it is already in the list, its position isn't changed.
*/
Tdjson.prototype.addSavedNotificationSound = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'addSavedNotificationSound' }))];
});
});
};
/**
Removes a notification sound from the list of saved notification sounds.
*/
Tdjson.prototype.removeSavedNotificationSound = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'removeSavedNotificationSound' }))];
});
});
};
/**
Returns the list of chats with non-default notification settings for new messages.
*/
Tdjson.prototype.getChatNotificationSettingsExceptions = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatNotificationSettingsExceptions' }))];
});
});
};
/**
Returns the notification settings for chats of a given type.
*/
Tdjson.prototype.getScopeNotificationSettings = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getScopeNotificationSettings' }))];
});
});
};
/**
Changes notification settings for chats of a given type.
*/
Tdjson.prototype.setScopeNotificationSettings = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setScopeNotificationSettings' }))];
});
});
};
/**
Changes notification settings for reactions.
*/
Tdjson.prototype.setReactionNotificationSettings = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setReactionNotificationSettings' }))];
});
});
};
/**
Resets all chat and scope notification settings to their default values. By default, all chats are unmuted and message
previews are shown.
*/
Tdjson.prototype.resetAllNotificationSettings = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'resetAllNotificationSettings',
})];
});
});
};
/**
Changes the pinned state of a chat. There can be up to
getOption("pinned_chat_count_max")/getOption("pinned_archived_chat_count_max") pinned non-secret chats and the same
number of secret chats in the main/archive chat list. The limit can be increased with Telegram Premium.
*/
Tdjson.prototype.toggleChatIsPinned = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleChatIsPinned' }))];
});
});
};
/**
Changes the order of pinned chats.
*/
Tdjson.prototype.setPinnedChats = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setPinnedChats' }))];
});
});
};
/**
Traverse all chats in a chat list and marks all messages in the chats as read.
*/
Tdjson.prototype.readChatList = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'readChatList' }))];
});
});
};
/**
Returns the current weather in the given location.
*/
Tdjson.prototype.getCurrentWeather = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getCurrentWeather' }))];
});
});
};
/**
Returns a story.
*/
Tdjson.prototype.getStory = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getStory' }))];
});
});
};
/**
Returns supergroup and channel chats in which the current user has the right to post stories. The chats must be
rechecked with canPostStory before actually trying to post a story there.
*/
Tdjson.prototype.getChatsToPostStories = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getChatsToPostStories',
})];
});
});
};
/**
Checks whether the current user can post a story on behalf of a chat; requires can_post_stories right for supergroup and
channel chats.
*/
Tdjson.prototype.canPostStory = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'canPostStory' }))];
});
});
};
/**
Posts a new story on behalf of a chat; requires can_post_stories right for supergroup and channel chats. Returns a
temporary story.
*/
Tdjson.prototype.postStory = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'postStory' }))];
});
});
};
/**
Changes content and caption of a story. Can be called only if story.can_be_edited == true.
*/
Tdjson.prototype.editStory = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editStory' }))];
});
});
};
/**
Changes cover of a video story. Can be called only if story.can_be_edited == true and the story isn't being edited now.
*/
Tdjson.prototype.editStoryCover = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editStoryCover' }))];
});
});
};
/**
Changes privacy settings of a story. The method can be called only for stories posted on behalf of the current user and
if story.can_be_edited == true.
*/
Tdjson.prototype.setStoryPrivacySettings = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setStoryPrivacySettings' }))];
});
});
};
/**
Toggles whether a story is accessible after expiration. Can be called only if story.can_toggle_is_posted_to_chat_page ==
true.
*/
Tdjson.prototype.toggleStoryIsPostedToChatPage = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleStoryIsPostedToChatPage' }))];
});
});
};
/**
Deletes a previously posted story. Can be called only if story.can_be_deleted == true.
*/
Tdjson.prototype.deleteStory = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteStory' }))];
});
});
};
/**
Returns the list of chats with non-default notification settings for stories.
*/
Tdjson.prototype.getStoryNotificationSettingsExceptions = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getStoryNotificationSettingsExceptions',
})];
});
});
};
/**
Loads more active stories from a story list. The loaded stories will be sent through updates. Active stories are sorted
by the pair (active_stories.order, active_stories.story_poster_chat_id) in descending order. Returns a 404 error if all
active stories have been loaded.
*/
Tdjson.prototype.loadActiveStories = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'loadActiveStories' }))];
});
});
};
/**
Changes story list in which stories from the chat are shown.
*/
Tdjson.prototype.setChatActiveStoriesList = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setChatActiveStoriesList' }))];
});
});
};
/**
Returns the list of active stories posted by the given chat.
*/
Tdjson.prototype.getChatActiveStories = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatActiveStories' }))];
});
});
};
/**
Returns the list of stories that posted by the given chat to its chat page. If from_story_id == 0, then pinned stories
are returned first. Then, stories are returned in reverse chronological order (i.e., in order of decreasing story_id).
For optimal performance, the number of returned stories is chosen by TDLib.
*/
Tdjson.prototype.getChatPostedToChatPageStories = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatPostedToChatPageStories' }))];
});
});
};
/**
Returns the list of all stories posted by the given chat; requires can_edit_stories right in the chat. The stories are
returned in reverse chronological order (i.e., in order of decreasing story_id). For optimal performance, the number of
returned stories is chosen by TDLib.
*/
Tdjson.prototype.getChatArchivedStories = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatArchivedStories' }))];
});
});
};
/**
Changes the list of pinned stories on a chat page; requires can_edit_stories right in the chat.
*/
Tdjson.prototype.setChatPinnedStories = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setChatPinnedStories' }))];
});
});
};
/**
Informs TDLib that a story is opened and is being viewed by the user.
*/
Tdjson.prototype.openStory = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'openStory' }))];
});
});
};
/**
Informs TDLib that a story is closed by the user.
*/
Tdjson.prototype.closeStory = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'closeStory' }))];
});
});
};
/**
Returns reactions, which can be chosen for a story.
*/
Tdjson.prototype.getStoryAvailableReactions = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getStoryAvailableReactions' }))];
});
});
};
/**
Changes chosen reaction on a story that has already been sent.
*/
Tdjson.prototype.setStoryReaction = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setStoryReaction' }))];
});
});
};
/**
Returns interactions with a story. The method can be called only for stories posted on behalf of the current user.
*/
Tdjson.prototype.getStoryInteractions = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getStoryInteractions' }))];
});
});
};
/**
Returns interactions with a story posted in a chat. Can be used only if story is posted on behalf of a chat and the user
is an administrator in the chat.
*/
Tdjson.prototype.getChatStoryInteractions = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatStoryInteractions' }))];
});
});
};
/**
Reports a story to the Telegram moderators.
*/
Tdjson.prototype.reportStory = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'reportStory' }))];
});
});
};
/**
Activates stealth mode for stories, which hides all views of stories from the current user in the last
"story_stealth_mode_past_period" seconds and for the next "story_stealth_mode_future_period" seconds; for Telegram
Premium users only.
*/
Tdjson.prototype.activateStoryStealthMode = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'activateStoryStealthMode',
})];
});
});
};
/**
Returns forwards of a story as a message to public chats and reposts by public channels. Can be used only if the story
is posted on behalf of the current user or story.can_get_statistics == true. For optimal performance, the number of
returned messages and stories is chosen by TDLib.
*/
Tdjson.prototype.getStoryPublicForwards = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getStoryPublicForwards' }))];
});
});
};
/**
Returns the list of features available on the specific chat boost level. This is an offline method.
*/
Tdjson.prototype.getChatBoostLevelFeatures = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatBoostLevelFeatures' }))];
});
});
};
/**
Returns the list of features available for different chat boost levels. This is an offline method.
*/
Tdjson.prototype.getChatBoostFeatures = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatBoostFeatures' }))];
});
});
};
/**
Returns the list of available chat boost slots for the current user.
*/
Tdjson.prototype.getAvailableChatBoostSlots = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getAvailableChatBoostSlots',
})];
});
});
};
/**
Returns the current boost status for a supergroup or a channel chat.
*/
Tdjson.prototype.getChatBoostStatus = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatBoostStatus' }))];
});
});
};
/**
Boosts a chat and returns the list of available chat boost slots for the current user after the boost.
*/
Tdjson.prototype.boostChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'boostChat' }))];
});
});
};
/**
Returns an HTTPS link to boost the specified supergroup or channel chat.
*/
Tdjson.prototype.getChatBoostLink = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatBoostLink' }))];
});
});
};
/**
Returns information about a link to boost a chat. Can be called for any internal link of the type
internalLinkTypeChatBoost.
*/
Tdjson.prototype.getChatBoostLinkInfo = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatBoostLinkInfo' }))];
});
});
};
/**
Returns the list of boosts applied to a chat; requires administrator rights in the chat.
*/
Tdjson.prototype.getChatBoosts = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatBoosts' }))];
});
});
};
/**
Returns the list of boosts applied to a chat by a given user; requires administrator rights in the chat; for bots only.
*/
Tdjson.prototype.getUserChatBoosts = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getUserChatBoosts' }))];
});
});
};
/**
Returns information about a bot that can be added to attachment or side menu.
*/
Tdjson.prototype.getAttachmentMenuBot = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getAttachmentMenuBot' }))];
});
});
};
/**
Adds or removes a bot to attachment and side menu. Bot can be added to the menu, only if
userTypeBot.can_be_added_to_attachment_menu == true.
*/
Tdjson.prototype.toggleBotIsAddedToAttachmentMenu = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleBotIsAddedToAttachmentMenu' }))];
});
});
};
/**
Returns up to 8 emoji statuses, which must be shown right after the default Premium Badge in the emoji status list for
self status.
*/
Tdjson.prototype.getThemedEmojiStatuses = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getThemedEmojiStatuses',
})];
});
});
};
/**
Returns recent emoji statuses for self status.
*/
Tdjson.prototype.getRecentEmojiStatuses = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getRecentEmojiStatuses',
})];
});
});
};
/**
Returns available upgraded gift emoji statuses for self status.
*/
Tdjson.prototype.getUpgradedGiftEmojiStatuses = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getUpgradedGiftEmojiStatuses',
})];
});
});
};
/**
Returns default emoji statuses for self status.
*/
Tdjson.prototype.getDefaultEmojiStatuses = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getDefaultEmojiStatuses',
})];
});
});
};
/**
Clears the list of recently used emoji statuses for self status.
*/
Tdjson.prototype.clearRecentEmojiStatuses = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'clearRecentEmojiStatuses',
})];
});
});
};
/**
Returns up to 8 emoji statuses, which must be shown in the emoji status list for chats.
*/
Tdjson.prototype.getThemedChatEmojiStatuses = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getThemedChatEmojiStatuses',
})];
});
});
};
/**
Returns default emoji statuses for chats.
*/
Tdjson.prototype.getDefaultChatEmojiStatuses = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getDefaultChatEmojiStatuses',
})];
});
});
};
/**
Returns the list of emoji statuses, which can't be used as chat emoji status, even if they are from a sticker set with
is_allowed_as_chat_emoji_status == true.
*/
Tdjson.prototype.getDisallowedChatEmojiStatuses = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getDisallowedChatEmojiStatuses',
})];
});
});
};
/**
Downloads a file from the cloud. Download progress and completion of the download will be notified through updateFile
updates.
*/
Tdjson.prototype.downloadFile = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'downloadFile' }))];
});
});
};
/**
Returns file downloaded prefix size from a given offset, in bytes.
*/
Tdjson.prototype.getFileDownloadedPrefixSize = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getFileDownloadedPrefixSize' }))];
});
});
};
/**
Stops the downloading of a file. If a file has already been downloaded, does nothing.
*/
Tdjson.prototype.cancelDownloadFile = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'cancelDownloadFile' }))];
});
});
};
/**
Returns suggested name for saving a file in a given directory.
*/
Tdjson.prototype.getSuggestedFileName = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getSuggestedFileName' }))];
});
});
};
/**
Preliminary uploads a file to the cloud before sending it in a message, which can be useful for uploading of being
recorded voice and video notes. In all other cases there is no need to preliminary upload a file. Updates updateFile
will be used to notify about upload progress. The upload will not be completed until the file is sent in a message.
*/
Tdjson.prototype.preliminaryUploadFile = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'preliminaryUploadFile' }))];
});
});
};
/**
Stops the preliminary uploading of a file. Supported only for files uploaded by using preliminaryUploadFile.
*/
Tdjson.prototype.cancelPreliminaryUploadFile = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'cancelPreliminaryUploadFile' }))];
});
});
};
/**
Writes a part of a generated file. This method is intended to be used only if the application has no direct access to
TDLib's file system, because it is usually slower than a direct write to the destination file.
*/
Tdjson.prototype.writeGeneratedFilePart = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'writeGeneratedFilePart' }))];
});
});
};
/**
Informs TDLib on a file generation progress.
*/
Tdjson.prototype.setFileGenerationProgress = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setFileGenerationProgress' }))];
});
});
};
/**
Finishes the file generation.
*/
Tdjson.prototype.finishFileGeneration = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'finishFileGeneration' }))];
});
});
};
/**
Reads a part of a file from the TDLib file cache and returns read bytes. This method is intended to be used only if the
application has no direct access to TDLib's file system, because it is usually slower than a direct read from the file.
*/
Tdjson.prototype.readFilePart = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'readFilePart' }))];
});
});
};
/**
Deletes a file from the TDLib file cache.
*/
Tdjson.prototype.deleteFile = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteFile' }))];
});
});
};
/**
Adds a file from a message to the list of file downloads. Download progress and completion of the download will be
notified through updateFile updates. If message database is used, the list of file downloads is persistent across
application restarts. The downloading is independent of download using downloadFile, i.e. it continues if downloadFile
is canceled or is used to download a part of the file.
*/
Tdjson.prototype.addFileToDownloads = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'addFileToDownloads' }))];
});
});
};
/**
Changes pause state of a file in the file download list.
*/
Tdjson.prototype.toggleDownloadIsPaused = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleDownloadIsPaused' }))];
});
});
};
/**
Changes pause state of all files in the file download list.
*/
Tdjson.prototype.toggleAllDownloadsArePaused = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleAllDownloadsArePaused' }))];
});
});
};
/**
Removes a file from the file download list.
*/
Tdjson.prototype.removeFileFromDownloads = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'removeFileFromDownloads' }))];
});
});
};
/**
Removes all files from the file download list.
*/
Tdjson.prototype.removeAllFilesFromDownloads = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'removeAllFilesFromDownloads' }))];
});
});
};
/**
Searches for files in the file download list or recently downloaded files from the list.
*/
Tdjson.prototype.searchFileDownloads = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchFileDownloads' }))];
});
});
};
/**
Application or reCAPTCHA verification has been completed. Can be called before authorization.
*/
Tdjson.prototype.setApplicationVerificationToken = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setApplicationVerificationToken' }))];
});
});
};
/**
Returns information about a file with messages exported from another application.
*/
Tdjson.prototype.getMessageFileType = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getMessageFileType' }))];
});
});
};
/**
Returns a confirmation text to be shown to the user before starting message import.
*/
Tdjson.prototype.getMessageImportConfirmationText = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getMessageImportConfirmationText' }))];
});
});
};
/**
Imports messages exported from another app.
*/
Tdjson.prototype.importMessages = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'importMessages' }))];
});
});
};
/**
Replaces current primary invite link for a chat with a new primary invite link. Available for basic groups, supergroups,
and channels. Requires administrator privileges and can_invite_users right.
*/
Tdjson.prototype.replacePrimaryChatInviteLink = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'replacePrimaryChatInviteLink' }))];
});
});
};
/**
Creates a new invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator
privileges and can_invite_users right in the chat.
*/
Tdjson.prototype.createChatInviteLink = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'createChatInviteLink' }))];
});
});
};
/**
Creates a new subscription invite link for a channel chat. Requires can_invite_users right in the chat.
*/
Tdjson.prototype.createChatSubscriptionInviteLink = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'createChatSubscriptionInviteLink' }))];
});
});
};
/**
Edits a non-primary invite link for a chat. Available for basic groups, supergroups, and channels. If the link creates a
subscription, then expiration_date, member_limit and creates_join_request must not be used. Requires administrator
privileges and can_invite_users right in the chat for own links and owner privileges for other links.
*/
Tdjson.prototype.editChatInviteLink = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editChatInviteLink' }))];
});
});
};
/**
Edits a subscription invite link for a channel chat. Requires can_invite_users right in the chat for own links and owner
privileges for other links.
*/
Tdjson.prototype.editChatSubscriptionInviteLink = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editChatSubscriptionInviteLink' }))];
});
});
};
/**
Returns information about an invite link. Requires administrator privileges and can_invite_users right in the chat to
get own links and owner privileges to get other links.
*/
Tdjson.prototype.getChatInviteLink = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatInviteLink' }))];
});
});
};
/**
Returns the list of chat administrators with number of their invite links. Requires owner privileges in the chat.
*/
Tdjson.prototype.getChatInviteLinkCounts = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatInviteLinkCounts' }))];
});
});
};
/**
Returns invite links for a chat created by specified administrator. Requires administrator privileges and
can_invite_users right in the chat to get own links and owner privileges to get other links.
*/
Tdjson.prototype.getChatInviteLinks = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatInviteLinks' }))];
});
});
};
/**
Returns chat members joined a chat via an invite link. Requires administrator privileges and can_invite_users right in
the chat for own links and owner privileges for other links.
*/
Tdjson.prototype.getChatInviteLinkMembers = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatInviteLinkMembers' }))];
});
});
};
/**
Revokes invite link for a chat. Available for basic groups, supergroups, and channels. Requires administrator privileges
and can_invite_users right in the chat for own links and owner privileges for other links. If a primary link is revoked,
then additionally to the revoked link returns new primary link.
*/
Tdjson.prototype.revokeChatInviteLink = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'revokeChatInviteLink' }))];
});
});
};
/**
Deletes revoked chat invite links. Requires administrator privileges and can_invite_users right in the chat for own
links and owner privileges for other links.
*/
Tdjson.prototype.deleteRevokedChatInviteLink = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteRevokedChatInviteLink' }))];
});
});
};
/**
Deletes all revoked chat invite links created by a given chat administrator. Requires administrator privileges and
can_invite_users right in the chat for own links and owner privileges for other links.
*/
Tdjson.prototype.deleteAllRevokedChatInviteLinks = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteAllRevokedChatInviteLinks' }))];
});
});
};
/**
Checks the validity of an invite link for a chat and returns information about the corresponding chat.
*/
Tdjson.prototype.checkChatInviteLink = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'checkChatInviteLink' }))];
});
});
};
/**
Uses an invite link to add the current user to the chat if possible. May return an error with a message
"INVITE_REQUEST_SENT" if only a join request was created.
*/
Tdjson.prototype.joinChatByInviteLink = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'joinChatByInviteLink' }))];
});
});
};
/**
Returns pending join requests in a chat.
*/
Tdjson.prototype.getChatJoinRequests = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatJoinRequests' }))];
});
});
};
/**
Handles a pending join request in a chat.
*/
Tdjson.prototype.processChatJoinRequest = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'processChatJoinRequest' }))];
});
});
};
/**
Handles all pending join requests for a given link in a chat.
*/
Tdjson.prototype.processChatJoinRequests = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'processChatJoinRequests' }))];
});
});
};
/**
Approves a suggested post in a channel direct messages chat.
*/
Tdjson.prototype.approveSuggestedPost = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'approveSuggestedPost' }))];
});
});
};
/**
Declines a suggested post in a channel direct messages chat.
*/
Tdjson.prototype.declineSuggestedPost = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'declineSuggestedPost' }))];
});
});
};
/**
Sent a suggested post based on a previously sent message in a channel direct messages chat. Can be also used to suggest
price or time change for an existing suggested post. Returns the sent message.
*/
Tdjson.prototype.addOffer = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'addOffer' }))];
});
});
};
/**
Creates a new call.
*/
Tdjson.prototype.createCall = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'createCall' }))];
});
});
};
/**
Accepts an incoming call.
*/
Tdjson.prototype.acceptCall = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'acceptCall' }))];
});
});
};
/**
Sends call signaling data.
*/
Tdjson.prototype.sendCallSignalingData = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'sendCallSignalingData' }))];
});
});
};
/**
Discards a call.
*/
Tdjson.prototype.discardCall = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'discardCall' }))];
});
});
};
/**
Sends a call rating.
*/
Tdjson.prototype.sendCallRating = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'sendCallRating' }))];
});
});
};
/**
Sends debug information for a call to Telegram servers.
*/
Tdjson.prototype.sendCallDebugInformation = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'sendCallDebugInformation' }))];
});
});
};
/**
Sends log file for a call to Telegram servers.
*/
Tdjson.prototype.sendCallLog = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'sendCallLog' }))];
});
});
};
/**
Returns the list of participant identifiers, on whose behalf a video chat in the chat can be joined.
*/
Tdjson.prototype.getVideoChatAvailableParticipants = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getVideoChatAvailableParticipants' }))];
});
});
};
/**
Changes default participant identifier, on whose behalf a video chat in the chat will be joined.
*/
Tdjson.prototype.setVideoChatDefaultParticipant = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setVideoChatDefaultParticipant' }))];
});
});
};
/**
Creates a video chat (a group call bound to a chat). Available only for basic groups, supergroups and channels; requires
can_manage_video_chats administrator right.
*/
Tdjson.prototype.createVideoChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'createVideoChat' }))];
});
});
};
/**
Creates a new group call that isn't bound to a chat.
*/
Tdjson.prototype.createGroupCall = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'createGroupCall' }))];
});
});
};
/**
Returns RTMP URL for streaming to the video chat of a chat; requires can_manage_video_chats administrator right.
*/
Tdjson.prototype.getVideoChatRtmpUrl = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getVideoChatRtmpUrl' }))];
});
});
};
/**
Replaces the current RTMP URL for streaming to the video chat of a chat; requires owner privileges in the chat.
*/
Tdjson.prototype.replaceVideoChatRtmpUrl = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'replaceVideoChatRtmpUrl' }))];
});
});
};
/**
Returns information about a group call.
*/
Tdjson.prototype.getGroupCall = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getGroupCall' }))];
});
});
};
/**
Starts a scheduled video chat.
*/
Tdjson.prototype.startScheduledVideoChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'startScheduledVideoChat' }))];
});
});
};
/**
Toggles whether the current user will receive a notification when the video chat starts; for scheduled video chats only.
*/
Tdjson.prototype.toggleVideoChatEnabledStartNotification = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleVideoChatEnabledStartNotification' }))];
});
});
};
/**
Joins a group call that is not bound to a chat.
*/
Tdjson.prototype.joinGroupCall = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'joinGroupCall' }))];
});
});
};
/**
Joins an active video chat. Returns join response payload for tgcalls.
*/
Tdjson.prototype.joinVideoChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'joinVideoChat' }))];
});
});
};
/**
Starts screen sharing in a joined group call. Returns join response payload for tgcalls.
*/
Tdjson.prototype.startGroupCallScreenSharing = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'startGroupCallScreenSharing' }))];
});
});
};
/**
Pauses or unpauses screen sharing in a joined group call.
*/
Tdjson.prototype.toggleGroupCallScreenSharingIsPaused = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleGroupCallScreenSharingIsPaused' }))];
});
});
};
/**
Ends screen sharing in a joined group call.
*/
Tdjson.prototype.endGroupCallScreenSharing = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'endGroupCallScreenSharing' }))];
});
});
};
/**
Sets title of a video chat; requires groupCall.can_be_managed right.
*/
Tdjson.prototype.setVideoChatTitle = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setVideoChatTitle' }))];
});
});
};
/**
Toggles whether new participants of a video chat can be unmuted only by administrators of the video chat. Requires
groupCall.can_toggle_mute_new_participants right.
*/
Tdjson.prototype.toggleVideoChatMuteNewParticipants = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleVideoChatMuteNewParticipants' }))];
});
});
};
/**
Invites a user to an active group call; for group calls not bound to a chat only. Sends a service message of the type
messageGroupCall. The group call can have at most getOption("group_call_participant_count_max") participants.
*/
Tdjson.prototype.inviteGroupCallParticipant = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'inviteGroupCallParticipant' }))];
});
});
};
/**
Declines an invitation to an active group call via messageGroupCall. Can be called both by the sender and the receiver
of the invitation.
*/
Tdjson.prototype.declineGroupCallInvitation = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'declineGroupCallInvitation' }))];
});
});
};
/**
Bans users from a group call not bound to a chat; requires groupCall.is_owned. Only the owner of the group call can
invite the banned users back.
*/
Tdjson.prototype.banGroupCallParticipants = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'banGroupCallParticipants' }))];
});
});
};
/**
Invites users to an active video chat. Sends a service message of the type messageInviteVideoChatParticipants to the
chat bound to the group call.
*/
Tdjson.prototype.inviteVideoChatParticipants = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'inviteVideoChatParticipants' }))];
});
});
};
/**
Returns invite link to a video chat in a public chat.
*/
Tdjson.prototype.getVideoChatInviteLink = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getVideoChatInviteLink' }))];
});
});
};
/**
Revokes invite link for a group call. Requires groupCall.can_be_managed right for video chats or groupCall.is_owned
otherwise.
*/
Tdjson.prototype.revokeGroupCallInviteLink = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'revokeGroupCallInviteLink' }))];
});
});
};
/**
Starts recording of an active group call; for video chats only. Requires groupCall.can_be_managed right.
*/
Tdjson.prototype.startGroupCallRecording = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'startGroupCallRecording' }))];
});
});
};
/**
Ends recording of an active group call; for video chats only. Requires groupCall.can_be_managed right.
*/
Tdjson.prototype.endGroupCallRecording = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'endGroupCallRecording' }))];
});
});
};
/**
Toggles whether current user's video is paused.
*/
Tdjson.prototype.toggleGroupCallIsMyVideoPaused = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleGroupCallIsMyVideoPaused' }))];
});
});
};
/**
Toggles whether current user's video is enabled.
*/
Tdjson.prototype.toggleGroupCallIsMyVideoEnabled = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleGroupCallIsMyVideoEnabled' }))];
});
});
};
/**
Informs TDLib that speaking state of a participant of an active group call has changed. Returns identifier of the
participant if it is found.
*/
Tdjson.prototype.setGroupCallParticipantIsSpeaking = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setGroupCallParticipantIsSpeaking' }))];
});
});
};
/**
Toggles whether a participant of an active group call is muted, unmuted, or allowed to unmute themselves.
*/
Tdjson.prototype.toggleGroupCallParticipantIsMuted = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleGroupCallParticipantIsMuted' }))];
});
});
};
/**
Changes volume level of a participant of an active group call. If the current user can manage the group call or is the
owner of the group call, then the participant's volume level will be changed for all users with the default volume
level.
*/
Tdjson.prototype.setGroupCallParticipantVolumeLevel = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setGroupCallParticipantVolumeLevel' }))];
});
});
};
/**
Toggles whether a group call participant hand is rased; for video chats only.
*/
Tdjson.prototype.toggleGroupCallParticipantIsHandRaised = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleGroupCallParticipantIsHandRaised' }))];
});
});
};
/**
Returns information about participants of a non-joined group call that is not bound to a chat.
*/
Tdjson.prototype.getGroupCallParticipants = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getGroupCallParticipants' }))];
});
});
};
/**
Loads more participants of a group call. The loaded participants will be received through updates. Use the field
groupCall.loaded_all_participants to check whether all participants have already been loaded.
*/
Tdjson.prototype.loadGroupCallParticipants = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'loadGroupCallParticipants' }))];
});
});
};
/**
Leaves a group call.
*/
Tdjson.prototype.leaveGroupCall = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'leaveGroupCall' }))];
});
});
};
/**
Ends a group call. Requires groupCall.can_be_managed right for video chats or groupCall.is_owned otherwise.
*/
Tdjson.prototype.endGroupCall = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'endGroupCall' }))];
});
});
};
/**
Returns information about available video chat streams.
*/
Tdjson.prototype.getVideoChatStreams = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getVideoChatStreams' }))];
});
});
};
/**
Returns a file with a segment of a video chat stream in a modified OGG format for audio or MPEG-4 format for video.
*/
Tdjson.prototype.getVideoChatStreamSegment = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getVideoChatStreamSegment' }))];
});
});
};
/**
Encrypts group call data before sending them over network using tgcalls.
*/
Tdjson.prototype.encryptGroupCallData = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'encryptGroupCallData' }))];
});
});
};
/**
Decrypts group call data received by tgcalls.
*/
Tdjson.prototype.decryptGroupCallData = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'decryptGroupCallData' }))];
});
});
};
/**
Changes the block list of a message sender. Currently, only users and supergroup chats can be blocked.
*/
Tdjson.prototype.setMessageSenderBlockList = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setMessageSenderBlockList' }))];
});
});
};
/**
Blocks an original sender of a message in the Replies chat.
*/
Tdjson.prototype.blockMessageSenderFromReplies = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'blockMessageSenderFromReplies' }))];
});
});
};
/**
Returns users and chats that were blocked by the current user.
*/
Tdjson.prototype.getBlockedMessageSenders = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getBlockedMessageSenders' }))];
});
});
};
/**
Adds a user to the contact list or edits an existing contact by their user identifier.
*/
Tdjson.prototype.addContact = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'addContact' }))];
});
});
};
/**
Adds new contacts or edits existing contacts by their phone numbers; contacts' user identifiers are ignored.
*/
Tdjson.prototype.importContacts = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'importContacts' }))];
});
});
};
/**
Returns all contacts of the user.
*/
Tdjson.prototype.getContacts = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getContacts',
})];
});
});
};
/**
Searches for the specified query in the first names, last names and usernames of the known user contacts.
*/
Tdjson.prototype.searchContacts = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchContacts' }))];
});
});
};
/**
Removes users from the contact list.
*/
Tdjson.prototype.removeContacts = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'removeContacts' }))];
});
});
};
/**
Returns the total number of imported contacts.
*/
Tdjson.prototype.getImportedContactCount = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getImportedContactCount',
})];
});
});
};
/**
Changes imported contacts using the list of contacts saved on the device. Imports newly added contacts and, if at least
the file database is enabled, deletes recently deleted contacts. Query result depends on the result of the previous
query, so only one query is possible at the same time.
*/
Tdjson.prototype.changeImportedContacts = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'changeImportedContacts' }))];
});
});
};
/**
Clears all imported contacts, contact list remains unchanged.
*/
Tdjson.prototype.clearImportedContacts = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'clearImportedContacts',
})];
});
});
};
/**
Changes the list of close friends of the current user.
*/
Tdjson.prototype.setCloseFriends = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setCloseFriends' }))];
});
});
};
/**
Returns all close friends of the current user.
*/
Tdjson.prototype.getCloseFriends = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getCloseFriends',
})];
});
});
};
/**
Changes a personal profile photo of a contact user.
*/
Tdjson.prototype.setUserPersonalProfilePhoto = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setUserPersonalProfilePhoto' }))];
});
});
};
/**
Suggests a profile photo to another regular user with common messages and allowing non-paid messages.
*/
Tdjson.prototype.suggestUserProfilePhoto = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'suggestUserProfilePhoto' }))];
});
});
};
/**
Toggles whether the bot can manage emoji status of the current user.
*/
Tdjson.prototype.toggleBotCanManageEmojiStatus = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleBotCanManageEmojiStatus' }))];
});
});
};
/**
Changes the emoji status of a user; for bots only.
*/
Tdjson.prototype.setUserEmojiStatus = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setUserEmojiStatus' }))];
});
});
};
/**
Searches a user by their phone number. Returns a 404 error if the user can't be found.
*/
Tdjson.prototype.searchUserByPhoneNumber = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchUserByPhoneNumber' }))];
});
});
};
/**
Shares the phone number of the current user with a mutual contact. Supposed to be called when the user clicks on
chatActionBarSharePhoneNumber.
*/
Tdjson.prototype.sharePhoneNumber = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'sharePhoneNumber' }))];
});
});
};
/**
Returns the profile photos of a user. Personal and public photo aren't returned.
*/
Tdjson.prototype.getUserProfilePhotos = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getUserProfilePhotos' }))];
});
});
};
/**
Returns outline of a sticker. This is an offline method. Returns a 404 error if the outline isn't known.
*/
Tdjson.prototype.getStickerOutline = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getStickerOutline' }))];
});
});
};
/**
Returns stickers from the installed sticker sets that correspond to any of the given emoji or can be found by
sticker-specific keywords. If the query is non-empty, then favorite, recently used or trending stickers may also be
returned.
*/
Tdjson.prototype.getStickers = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getStickers' }))];
});
});
};
/**
Returns unique emoji that correspond to stickers to be found by the getStickers(sticker_type, query, 1000000, chat_id).
*/
Tdjson.prototype.getAllStickerEmojis = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getAllStickerEmojis' }))];
});
});
};
/**
Searches for stickers from public sticker sets that correspond to any of the given emoji.
*/
Tdjson.prototype.searchStickers = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchStickers' }))];
});
});
};
/**
Returns greeting stickers from regular sticker sets that can be used for the start page of other users.
*/
Tdjson.prototype.getGreetingStickers = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getGreetingStickers',
})];
});
});
};
/**
Returns premium stickers from regular sticker sets.
*/
Tdjson.prototype.getPremiumStickers = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getPremiumStickers' }))];
});
});
};
/**
Returns a list of installed sticker sets.
*/
Tdjson.prototype.getInstalledStickerSets = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getInstalledStickerSets' }))];
});
});
};
/**
Returns a list of archived sticker sets.
*/
Tdjson.prototype.getArchivedStickerSets = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getArchivedStickerSets' }))];
});
});
};
/**
Returns a list of trending sticker sets. For optimal performance, the number of returned sticker sets is chosen by
TDLib.
*/
Tdjson.prototype.getTrendingStickerSets = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getTrendingStickerSets' }))];
});
});
};
/**
Returns a list of sticker sets attached to a file, including regular, mask, and emoji sticker sets. Currently, only
animations, photos, and videos can have attached sticker sets.
*/
Tdjson.prototype.getAttachedStickerSets = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getAttachedStickerSets' }))];
});
});
};
/**
Returns information about a sticker set by its identifier.
*/
Tdjson.prototype.getStickerSet = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getStickerSet' }))];
});
});
};
/**
Returns name of a sticker set by its identifier.
*/
Tdjson.prototype.getStickerSetName = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getStickerSetName' }))];
});
});
};
/**
Searches for a sticker set by its name.
*/
Tdjson.prototype.searchStickerSet = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchStickerSet' }))];
});
});
};
/**
Searches for installed sticker sets by looking for specified query in their title and name.
*/
Tdjson.prototype.searchInstalledStickerSets = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchInstalledStickerSets' }))];
});
});
};
/**
Searches for sticker sets by looking for specified query in their title and name. Excludes installed sticker sets from
the results.
*/
Tdjson.prototype.searchStickerSets = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchStickerSets' }))];
});
});
};
/**
Installs/uninstalls or activates/archives a sticker set.
*/
Tdjson.prototype.changeStickerSet = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'changeStickerSet' }))];
});
});
};
/**
Informs the server that some trending sticker sets have been viewed by the user.
*/
Tdjson.prototype.viewTrendingStickerSets = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'viewTrendingStickerSets' }))];
});
});
};
/**
Changes the order of installed sticker sets.
*/
Tdjson.prototype.reorderInstalledStickerSets = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'reorderInstalledStickerSets' }))];
});
});
};
/**
Returns a list of recently used stickers.
*/
Tdjson.prototype.getRecentStickers = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getRecentStickers' }))];
});
});
};
/**
Manually adds a new sticker to the list of recently used stickers. The new sticker is added to the top of the list. If
the sticker was already in the list, it is removed from the list first. Only stickers belonging to a sticker set or in
WEBP or WEBM format can be added to this list. Emoji stickers can't be added to recent stickers.
*/
Tdjson.prototype.addRecentSticker = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'addRecentSticker' }))];
});
});
};
/**
Removes a sticker from the list of recently used stickers.
*/
Tdjson.prototype.removeRecentSticker = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'removeRecentSticker' }))];
});
});
};
/**
Clears the list of recently used stickers.
*/
Tdjson.prototype.clearRecentStickers = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'clearRecentStickers' }))];
});
});
};
/**
Returns favorite stickers.
*/
Tdjson.prototype.getFavoriteStickers = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getFavoriteStickers',
})];
});
});
};
/**
Adds a new sticker to the list of favorite stickers. The new sticker is added to the top of the list. If the sticker was
already in the list, it is removed from the list first. Only stickers belonging to a sticker set or in WEBP or WEBM
format can be added to this list. Emoji stickers can't be added to favorite stickers.
*/
Tdjson.prototype.addFavoriteSticker = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'addFavoriteSticker' }))];
});
});
};
/**
Removes a sticker from the list of favorite stickers.
*/
Tdjson.prototype.removeFavoriteSticker = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'removeFavoriteSticker' }))];
});
});
};
/**
Returns emoji corresponding to a sticker. The list is only for informational purposes, because a sticker is always sent
with a fixed emoji from the corresponding Sticker object.
*/
Tdjson.prototype.getStickerEmojis = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getStickerEmojis' }))];
});
});
};
/**
Searches for emojis by keywords. Supported only if the file database is enabled. Order of results is unspecified.
*/
Tdjson.prototype.searchEmojis = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchEmojis' }))];
});
});
};
/**
Return emojis matching the keyword. Supported only if the file database is enabled. Order of results is unspecified.
*/
Tdjson.prototype.getKeywordEmojis = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getKeywordEmojis' }))];
});
});
};
/**
Returns available emoji categories.
*/
Tdjson.prototype.getEmojiCategories = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getEmojiCategories' }))];
});
});
};
/**
Returns an animated emoji corresponding to a given emoji. Returns a 404 error if the emoji has no animated emoji.
*/
Tdjson.prototype.getAnimatedEmoji = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getAnimatedEmoji' }))];
});
});
};
/**
Returns an HTTP URL which can be used to automatically log in to the translation platform and suggest new emoji
replacements. The URL will be valid for 30 seconds after generation.
*/
Tdjson.prototype.getEmojiSuggestionsUrl = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getEmojiSuggestionsUrl' }))];
});
});
};
/**
Returns the list of custom emoji stickers by their identifiers. Stickers are returned in arbitrary order. Only found
stickers are returned.
*/
Tdjson.prototype.getCustomEmojiStickers = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getCustomEmojiStickers' }))];
});
});
};
/**
Returns default list of custom emoji stickers for placing on a chat photo.
*/
Tdjson.prototype.getDefaultChatPhotoCustomEmojiStickers = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getDefaultChatPhotoCustomEmojiStickers',
})];
});
});
};
/**
Returns default list of custom emoji stickers for placing on a profile photo.
*/
Tdjson.prototype.getDefaultProfilePhotoCustomEmojiStickers = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getDefaultProfilePhotoCustomEmojiStickers',
})];
});
});
};
/**
Returns default list of custom emoji stickers for reply background.
*/
Tdjson.prototype.getDefaultBackgroundCustomEmojiStickers = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getDefaultBackgroundCustomEmojiStickers',
})];
});
});
};
/**
Returns saved animations.
*/
Tdjson.prototype.getSavedAnimations = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getSavedAnimations',
})];
});
});
};
/**
Manually adds a new animation to the list of saved animations. The new animation is added to the beginning of the list.
If the animation was already in the list, it is removed first. Only non-secret video animations with MIME type
"video/mp4" can be added to the list.
*/
Tdjson.prototype.addSavedAnimation = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'addSavedAnimation' }))];
});
});
};
/**
Removes an animation from the list of saved animations.
*/
Tdjson.prototype.removeSavedAnimation = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'removeSavedAnimation' }))];
});
});
};
/**
Returns up to 20 recently used inline bots in the order of their last usage.
*/
Tdjson.prototype.getRecentInlineBots = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getRecentInlineBots',
})];
});
});
};
/**
Returns the list of bots owned by the current user.
*/
Tdjson.prototype.getOwnedBots = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getOwnedBots',
})];
});
});
};
/**
Searches for recently used hashtags by their prefix.
*/
Tdjson.prototype.searchHashtags = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchHashtags' }))];
});
});
};
/**
Removes a hashtag from the list of recently used hashtags.
*/
Tdjson.prototype.removeRecentHashtag = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'removeRecentHashtag' }))];
});
});
};
/**
Returns a link preview by the text of a message. Do not call this function too often. Returns a 404 error if the text
has no link preview.
*/
Tdjson.prototype.getLinkPreview = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getLinkPreview' }))];
});
});
};
/**
Returns an instant view version of a web page if available. This is an offline method if only_local is true. Returns a
404 error if the web page has no instant view page.
*/
Tdjson.prototype.getWebPageInstantView = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getWebPageInstantView' }))];
});
});
};
/**
Changes a profile photo for the current user.
*/
Tdjson.prototype.setProfilePhoto = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setProfilePhoto' }))];
});
});
};
/**
Deletes a profile photo.
*/
Tdjson.prototype.deleteProfilePhoto = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteProfilePhoto' }))];
});
});
};
/**
Changes accent color and background custom emoji for the current user; for Telegram Premium users only.
*/
Tdjson.prototype.setAccentColor = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setAccentColor' }))];
});
});
};
/**
Changes accent color and background custom emoji for profile of the current user; for Telegram Premium users only.
*/
Tdjson.prototype.setProfileAccentColor = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setProfileAccentColor' }))];
});
});
};
/**
Changes the first and last name of the current user.
*/
Tdjson.prototype.setName = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setName' }))];
});
});
};
/**
Changes the bio of the current user.
*/
Tdjson.prototype.setBio = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setBio' }))];
});
});
};
/**
Changes the editable username of the current user.
*/
Tdjson.prototype.setUsername = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setUsername' }))];
});
});
};
/**
Changes active state for a username of the current user. The editable username can't be disabled. May return an error
with a message "USERNAMES_ACTIVE_TOO_MUCH" if the maximum number of active usernames has been reached.
*/
Tdjson.prototype.toggleUsernameIsActive = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleUsernameIsActive' }))];
});
});
};
/**
Changes order of active usernames of the current user.
*/
Tdjson.prototype.reorderActiveUsernames = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'reorderActiveUsernames' }))];
});
});
};
/**
Changes the birthdate of the current user.
*/
Tdjson.prototype.setBirthdate = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setBirthdate' }))];
});
});
};
/**
Changes the personal chat of the current user.
*/
Tdjson.prototype.setPersonalChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setPersonalChat' }))];
});
});
};
/**
Changes the emoji status of the current user; for Telegram Premium users only.
*/
Tdjson.prototype.setEmojiStatus = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setEmojiStatus' }))];
});
});
};
/**
Toggles whether the current user has sponsored messages enabled. The setting has no effect for users without Telegram
Premium for which sponsored messages are always enabled.
*/
Tdjson.prototype.toggleHasSponsoredMessagesEnabled = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleHasSponsoredMessagesEnabled' }))];
});
});
};
/**
Changes the business location of the current user. Requires Telegram Business subscription.
*/
Tdjson.prototype.setBusinessLocation = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setBusinessLocation' }))];
});
});
};
/**
Changes the business opening hours of the current user. Requires Telegram Business subscription.
*/
Tdjson.prototype.setBusinessOpeningHours = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setBusinessOpeningHours' }))];
});
});
};
/**
Changes the business greeting message settings of the current user. Requires Telegram Business subscription.
*/
Tdjson.prototype.setBusinessGreetingMessageSettings = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setBusinessGreetingMessageSettings' }))];
});
});
};
/**
Changes the business away message settings of the current user. Requires Telegram Business subscription.
*/
Tdjson.prototype.setBusinessAwayMessageSettings = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setBusinessAwayMessageSettings' }))];
});
});
};
/**
Changes the business start page of the current user. Requires Telegram Business subscription.
*/
Tdjson.prototype.setBusinessStartPage = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setBusinessStartPage' }))];
});
});
};
/**
Sends a code to the specified phone number. Aborts previous phone number verification if there was one. On success,
returns information about the sent code.
*/
Tdjson.prototype.sendPhoneNumberCode = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'sendPhoneNumberCode' }))];
});
});
};
/**
Sends Firebase Authentication SMS to the specified phone number. Works only when received a code of the type
authenticationCodeTypeFirebaseAndroid or authenticationCodeTypeFirebaseIos.
*/
Tdjson.prototype.sendPhoneNumberFirebaseSms = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'sendPhoneNumberFirebaseSms' }))];
});
});
};
/**
Reports that authentication code wasn't delivered via SMS to the specified phone number; for official mobile
applications only.
*/
Tdjson.prototype.reportPhoneNumberCodeMissing = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'reportPhoneNumberCodeMissing' }))];
});
});
};
/**
Resends the authentication code sent to a phone number. Works only if the previously received authenticationCodeInfo
next_code_type was not null and the server-specified timeout has passed.
*/
Tdjson.prototype.resendPhoneNumberCode = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'resendPhoneNumberCode' }))];
});
});
};
/**
Check the authentication code and completes the request for which the code was sent if appropriate.
*/
Tdjson.prototype.checkPhoneNumberCode = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'checkPhoneNumberCode' }))];
});
});
};
/**
Returns the business bot that is connected to the current user account. Returns a 404 error if there is no connected
bot.
*/
Tdjson.prototype.getBusinessConnectedBot = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getBusinessConnectedBot',
})];
});
});
};
/**
Adds or changes business bot that is connected to the current user account.
*/
Tdjson.prototype.setBusinessConnectedBot = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setBusinessConnectedBot' }))];
});
});
};
/**
Deletes the business bot that is connected to the current user account.
*/
Tdjson.prototype.deleteBusinessConnectedBot = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteBusinessConnectedBot' }))];
});
});
};
/**
Pauses or resumes the connected business bot in a specific chat.
*/
Tdjson.prototype.toggleBusinessConnectedBotChatIsPaused = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleBusinessConnectedBotChatIsPaused' }))];
});
});
};
/**
Removes the connected business bot from a specific chat by adding the chat to businessRecipients.excluded_chat_ids.
*/
Tdjson.prototype.removeBusinessConnectedBotFromChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'removeBusinessConnectedBotFromChat' }))];
});
});
};
/**
Returns business chat links created for the current account.
*/
Tdjson.prototype.getBusinessChatLinks = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getBusinessChatLinks',
})];
});
});
};
/**
Creates a business chat link for the current account. Requires Telegram Business subscription. There can be up to
getOption("business_chat_link_count_max") links created. Returns the created link.
*/
Tdjson.prototype.createBusinessChatLink = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'createBusinessChatLink' }))];
});
});
};
/**
Edits a business chat link of the current account. Requires Telegram Business subscription. Returns the edited link.
*/
Tdjson.prototype.editBusinessChatLink = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editBusinessChatLink' }))];
});
});
};
/**
Deletes a business chat link of the current account.
*/
Tdjson.prototype.deleteBusinessChatLink = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteBusinessChatLink' }))];
});
});
};
/**
Returns information about a business chat link.
*/
Tdjson.prototype.getBusinessChatLinkInfo = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getBusinessChatLinkInfo' }))];
});
});
};
/**
Returns an HTTPS link, which can be used to get information about the current user.
*/
Tdjson.prototype.getUserLink = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getUserLink',
})];
});
});
};
/**
Searches a user by a token from the user's link.
*/
Tdjson.prototype.searchUserByToken = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchUserByToken' }))];
});
});
};
/**
Sets the list of commands supported by the bot for the given user scope and language; for bots only.
*/
Tdjson.prototype.setCommands = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setCommands' }))];
});
});
};
/**
Deletes commands supported by the bot for the given user scope and language; for bots only.
*/
Tdjson.prototype.deleteCommands = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteCommands' }))];
});
});
};
/**
Returns the list of commands supported by the bot for the given user scope and language; for bots only.
*/
Tdjson.prototype.getCommands = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getCommands' }))];
});
});
};
/**
Sets menu button for the given user or for all users; for bots only.
*/
Tdjson.prototype.setMenuButton = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setMenuButton' }))];
});
});
};
/**
Returns menu button set by the bot for the given user; for bots only.
*/
Tdjson.prototype.getMenuButton = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getMenuButton' }))];
});
});
};
/**
Sets default administrator rights for adding the bot to basic group and supergroup chats; for bots only.
*/
Tdjson.prototype.setDefaultGroupAdministratorRights = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setDefaultGroupAdministratorRights' }))];
});
});
};
/**
Sets default administrator rights for adding the bot to channel chats; for bots only.
*/
Tdjson.prototype.setDefaultChannelAdministratorRights = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setDefaultChannelAdministratorRights' }))];
});
});
};
/**
Checks whether the specified bot can send messages to the user. Returns a 404 error if can't and the access can be
granted by call to allowBotToSendMessages.
*/
Tdjson.prototype.canBotSendMessages = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'canBotSendMessages' }))];
});
});
};
/**
Allows the specified bot to send messages to the user.
*/
Tdjson.prototype.allowBotToSendMessages = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'allowBotToSendMessages' }))];
});
});
};
/**
Sends a custom request from a Web App.
*/
Tdjson.prototype.sendWebAppCustomRequest = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'sendWebAppCustomRequest' }))];
});
});
};
/**
Returns the list of media previews of a bot.
*/
Tdjson.prototype.getBotMediaPreviews = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getBotMediaPreviews' }))];
});
});
};
/**
Returns the list of media previews for the given language and the list of languages for which the bot has dedicated
previews.
*/
Tdjson.prototype.getBotMediaPreviewInfo = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getBotMediaPreviewInfo' }))];
});
});
};
/**
Adds a new media preview to the beginning of the list of media previews of a bot. Returns the added preview after
addition is completed server-side. The total number of previews must not exceed getOption("bot_media_preview_count_max")
for the given language.
*/
Tdjson.prototype.addBotMediaPreview = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'addBotMediaPreview' }))];
});
});
};
/**
Replaces media preview in the list of media previews of a bot. Returns the new preview after edit is completed
server-side.
*/
Tdjson.prototype.editBotMediaPreview = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editBotMediaPreview' }))];
});
});
};
/**
Changes order of media previews in the list of media previews of a bot.
*/
Tdjson.prototype.reorderBotMediaPreviews = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'reorderBotMediaPreviews' }))];
});
});
};
/**
Delete media previews from the list of media previews of a bot.
*/
Tdjson.prototype.deleteBotMediaPreviews = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteBotMediaPreviews' }))];
});
});
};
/**
Sets the name of a bot. Can be called only if userTypeBot.can_be_edited == true.
*/
Tdjson.prototype.setBotName = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setBotName' }))];
});
});
};
/**
Returns the name of a bot in the given language. Can be called only if userTypeBot.can_be_edited == true.
*/
Tdjson.prototype.getBotName = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getBotName' }))];
});
});
};
/**
Changes a profile photo for a bot.
*/
Tdjson.prototype.setBotProfilePhoto = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setBotProfilePhoto' }))];
});
});
};
/**
Changes active state for a username of a bot. The editable username can't be disabled. May return an error with a
message "USERNAMES_ACTIVE_TOO_MUCH" if the maximum number of active usernames has been reached. Can be called only if
userTypeBot.can_be_edited == true.
*/
Tdjson.prototype.toggleBotUsernameIsActive = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleBotUsernameIsActive' }))];
});
});
};
/**
Changes order of active usernames of a bot. Can be called only if userTypeBot.can_be_edited == true.
*/
Tdjson.prototype.reorderBotActiveUsernames = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'reorderBotActiveUsernames' }))];
});
});
};
/**
Sets the text shown in the chat with a bot if the chat is empty. Can be called only if userTypeBot.can_be_edited ==
true.
*/
Tdjson.prototype.setBotInfoDescription = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setBotInfoDescription' }))];
});
});
};
/**
Returns the text shown in the chat with a bot if the chat is empty in the given language. Can be called only if
userTypeBot.can_be_edited == true.
*/
Tdjson.prototype.getBotInfoDescription = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getBotInfoDescription' }))];
});
});
};
/**
Sets the text shown on a bot's profile page and sent together with the link when users share the bot. Can be called only
if userTypeBot.can_be_edited == true.
*/
Tdjson.prototype.setBotInfoShortDescription = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setBotInfoShortDescription' }))];
});
});
};
/**
Returns the text shown on a bot's profile page and sent together with the link when users share the bot in the given
language. Can be called only if userTypeBot.can_be_edited == true.
*/
Tdjson.prototype.getBotInfoShortDescription = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getBotInfoShortDescription' }))];
});
});
};
/**
Changes the verification status of a user or a chat by an owned bot.
*/
Tdjson.prototype.setMessageSenderBotVerification = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setMessageSenderBotVerification' }))];
});
});
};
/**
Removes the verification status of a user or a chat by an owned bot.
*/
Tdjson.prototype.removeMessageSenderBotVerification = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'removeMessageSenderBotVerification' }))];
});
});
};
/**
Returns all active sessions of the current user.
*/
Tdjson.prototype.getActiveSessions = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getActiveSessions',
})];
});
});
};
/**
Terminates a session of the current user.
*/
Tdjson.prototype.terminateSession = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'terminateSession' }))];
});
});
};
/**
Terminates all other sessions of the current user.
*/
Tdjson.prototype.terminateAllOtherSessions = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'terminateAllOtherSessions',
})];
});
});
};
/**
Confirms an unconfirmed session of the current user from another device.
*/
Tdjson.prototype.confirmSession = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'confirmSession' }))];
});
});
};
/**
Toggles whether a session can accept incoming calls.
*/
Tdjson.prototype.toggleSessionCanAcceptCalls = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleSessionCanAcceptCalls' }))];
});
});
};
/**
Toggles whether a session can accept incoming secret chats.
*/
Tdjson.prototype.toggleSessionCanAcceptSecretChats = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleSessionCanAcceptSecretChats' }))];
});
});
};
/**
Changes the period of inactivity after which sessions will automatically be terminated.
*/
Tdjson.prototype.setInactiveSessionTtl = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setInactiveSessionTtl' }))];
});
});
};
/**
Returns all website where the current user used Telegram to log in.
*/
Tdjson.prototype.getConnectedWebsites = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getConnectedWebsites',
})];
});
});
};
/**
Disconnects website from the current user's Telegram account.
*/
Tdjson.prototype.disconnectWebsite = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'disconnectWebsite' }))];
});
});
};
/**
Disconnects all websites from the current user's Telegram account.
*/
Tdjson.prototype.disconnectAllWebsites = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'disconnectAllWebsites',
})];
});
});
};
/**
Changes the editable username of a supergroup or channel, requires owner privileges in the supergroup or channel.
*/
Tdjson.prototype.setSupergroupUsername = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setSupergroupUsername' }))];
});
});
};
/**
Changes active state for a username of a supergroup or channel, requires owner privileges in the supergroup or channel.
The editable username can't be disabled. May return an error with a message "USERNAMES_ACTIVE_TOO_MUCH" if the maximum
number of active usernames has been reached.
*/
Tdjson.prototype.toggleSupergroupUsernameIsActive = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleSupergroupUsernameIsActive' }))];
});
});
};
/**
Disables all active non-editable usernames of a supergroup or channel, requires owner privileges in the supergroup or
channel.
*/
Tdjson.prototype.disableAllSupergroupUsernames = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'disableAllSupergroupUsernames' }))];
});
});
};
/**
Changes order of active usernames of a supergroup or channel, requires owner privileges in the supergroup or channel.
*/
Tdjson.prototype.reorderSupergroupActiveUsernames = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'reorderSupergroupActiveUsernames' }))];
});
});
};
/**
Changes the sticker set of a supergroup; requires can_change_info administrator right.
*/
Tdjson.prototype.setSupergroupStickerSet = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setSupergroupStickerSet' }))];
});
});
};
/**
Changes the custom emoji sticker set of a supergroup; requires can_change_info administrator right. The chat must have
at least chatBoostFeatures.min_custom_emoji_sticker_set_boost_level boost level to pass the corresponding color.
*/
Tdjson.prototype.setSupergroupCustomEmojiStickerSet = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setSupergroupCustomEmojiStickerSet' }))];
});
});
};
/**
Changes the number of times the supergroup must be boosted by a user to ignore slow mode and chat permission
restrictions; requires can_restrict_members administrator right.
*/
Tdjson.prototype.setSupergroupUnrestrictBoostCount = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setSupergroupUnrestrictBoostCount' }))];
});
});
};
/**
Toggles whether sender signature or link to the account is added to sent messages in a channel; requires can_change_info
member right.
*/
Tdjson.prototype.toggleSupergroupSignMessages = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleSupergroupSignMessages' }))];
});
});
};
/**
Toggles whether joining is mandatory to send messages to a discussion supergroup; requires can_restrict_members
administrator right.
*/
Tdjson.prototype.toggleSupergroupJoinToSendMessages = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleSupergroupJoinToSendMessages' }))];
});
});
};
/**
Toggles whether all users directly joining the supergroup need to be approved by supergroup administrators; requires
can_restrict_members administrator right.
*/
Tdjson.prototype.toggleSupergroupJoinByRequest = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleSupergroupJoinByRequest' }))];
});
});
};
/**
Toggles whether the message history of a supergroup is available to new members; requires can_change_info member right.
*/
Tdjson.prototype.toggleSupergroupIsAllHistoryAvailable = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleSupergroupIsAllHistoryAvailable' }))];
});
});
};
/**
Toggles whether sponsored messages are shown in the channel chat; requires owner privileges in the channel. The chat
must have at least chatBoostFeatures.min_sponsored_message_disable_boost_level boost level to disable sponsored
messages.
*/
Tdjson.prototype.toggleSupergroupCanHaveSponsoredMessages = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleSupergroupCanHaveSponsoredMessages' }))];
});
});
};
/**
Toggles whether messages are automatically translated in the channel chat; requires can_change_info administrator right
in the channel. The chat must have at least chatBoostFeatures.min_automatic_translation_boost_level boost level to
enable automatic translation.
*/
Tdjson.prototype.toggleSupergroupHasAutomaticTranslation = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleSupergroupHasAutomaticTranslation' }))];
});
});
};
/**
Toggles whether non-administrators can receive only administrators and bots using getSupergroupMembers or
searchChatMembers. Can be called only if supergroupFullInfo.can_hide_members == true.
*/
Tdjson.prototype.toggleSupergroupHasHiddenMembers = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleSupergroupHasHiddenMembers' }))];
});
});
};
/**
Toggles whether aggressive anti-spam checks are enabled in the supergroup. Can be called only if
supergroupFullInfo.can_toggle_aggressive_anti_spam == true.
*/
Tdjson.prototype.toggleSupergroupHasAggressiveAntiSpamEnabled = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleSupergroupHasAggressiveAntiSpamEnabled' }))];
});
});
};
/**
Toggles whether the supergroup is a forum; requires owner privileges in the supergroup. Discussion supergroups can't be
converted to forums.
*/
Tdjson.prototype.toggleSupergroupIsForum = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleSupergroupIsForum' }))];
});
});
};
/**
Upgrades supergroup to a broadcast group; requires owner privileges in the supergroup.
*/
Tdjson.prototype.toggleSupergroupIsBroadcastGroup = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleSupergroupIsBroadcastGroup' }))];
});
});
};
/**
Reports messages in a supergroup as spam; requires administrator rights in the supergroup.
*/
Tdjson.prototype.reportSupergroupSpam = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'reportSupergroupSpam' }))];
});
});
};
/**
Reports a false deletion of a message by aggressive anti-spam checks; requires administrator rights in the supergroup.
Can be called only for messages from chatEventMessageDeleted with can_report_anti_spam_false_positive == true.
*/
Tdjson.prototype.reportSupergroupAntiSpamFalsePositive = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'reportSupergroupAntiSpamFalsePositive' }))];
});
});
};
/**
Returns information about members or banned users in a supergroup or channel. Can be used only if
supergroupFullInfo.can_get_members == true; additionally, administrator privileges may be required for some filters.
*/
Tdjson.prototype.getSupergroupMembers = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getSupergroupMembers' }))];
});
});
};
/**
Closes a secret chat, effectively transferring its state to secretChatStateClosed.
*/
Tdjson.prototype.closeSecretChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'closeSecretChat' }))];
});
});
};
/**
Returns a list of service actions taken by chat members and administrators in the last 48 hours. Available only for
supergroups and channels. Requires administrator rights. Returns results in reverse chronological order (i.e., in order
of decreasing event_id).
*/
Tdjson.prototype.getChatEventLog = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatEventLog' }))];
});
});
};
/**
Returns the list of supported time zones.
*/
Tdjson.prototype.getTimeZones = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getTimeZones',
})];
});
});
};
/**
Returns an invoice payment form. This method must be called when the user presses inline button of the type
inlineKeyboardButtonTypeBuy, or wants to buy access to media in a messagePaidMedia message.
*/
Tdjson.prototype.getPaymentForm = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getPaymentForm' }))];
});
});
};
/**
Validates the order information provided by a user and returns the available shipping options for a flexible invoice.
*/
Tdjson.prototype.validateOrderInfo = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'validateOrderInfo' }))];
});
});
};
/**
Sends a filled-out payment form to the bot for final verification.
*/
Tdjson.prototype.sendPaymentForm = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'sendPaymentForm' }))];
});
});
};
/**
Returns information about a successful payment.
*/
Tdjson.prototype.getPaymentReceipt = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getPaymentReceipt' }))];
});
});
};
/**
Returns saved order information. Returns a 404 error if there is no saved order information.
*/
Tdjson.prototype.getSavedOrderInfo = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getSavedOrderInfo',
})];
});
});
};
/**
Deletes saved order information.
*/
Tdjson.prototype.deleteSavedOrderInfo = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'deleteSavedOrderInfo',
})];
});
});
};
/**
Deletes saved credentials for all payment provider bots.
*/
Tdjson.prototype.deleteSavedCredentials = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'deleteSavedCredentials',
})];
});
});
};
/**
Changes settings for gift receiving for the current user.
*/
Tdjson.prototype.setGiftSettings = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setGiftSettings' }))];
});
});
};
/**
Returns gifts that can be sent to other users and channel chats.
*/
Tdjson.prototype.getAvailableGifts = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getAvailableGifts',
})];
});
});
};
/**
Sends a gift to another user or channel chat. May return an error with a message "STARGIFT_USAGE_LIMITED" if the gift
was sold out.
*/
Tdjson.prototype.sendGift = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'sendGift' }))];
});
});
};
/**
Sells a gift for Telegram Stars; requires owner privileges for gifts owned by a chat.
*/
Tdjson.prototype.sellGift = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'sellGift' }))];
});
});
};
/**
Toggles whether a gift is shown on the current user's or the channel's profile page; requires can_post_messages
administrator right in the channel chat.
*/
Tdjson.prototype.toggleGiftIsSaved = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleGiftIsSaved' }))];
});
});
};
/**
Changes the list of pinned gifts on the current user's or the channel's profile page; requires can_post_messages
administrator right in the channel chat.
*/
Tdjson.prototype.setPinnedGifts = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setPinnedGifts' }))];
});
});
};
/**
Toggles whether notifications for new gifts received by a channel chat are sent to the current user; requires
can_post_messages administrator right in the chat.
*/
Tdjson.prototype.toggleChatGiftNotifications = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'toggleChatGiftNotifications' }))];
});
});
};
/**
Returns examples of possible upgraded gifts for a regular gift.
*/
Tdjson.prototype.getGiftUpgradePreview = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getGiftUpgradePreview' }))];
});
});
};
/**
Upgrades a regular gift.
*/
Tdjson.prototype.upgradeGift = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'upgradeGift' }))];
});
});
};
/**
Sends an upgraded gift to another user or a channel chat.
*/
Tdjson.prototype.transferGift = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'transferGift' }))];
});
});
};
/**
Sends an upgraded gift that is available for resale to another user or channel chat; gifts already owned by the current
user must be transferred using transferGift and can't be passed to the method.
*/
Tdjson.prototype.sendResoldGift = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'sendResoldGift' }))];
});
});
};
/**
Returns gifts received by the given user or chat.
*/
Tdjson.prototype.getReceivedGifts = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getReceivedGifts' }))];
});
});
};
/**
Returns information about a received gift.
*/
Tdjson.prototype.getReceivedGift = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getReceivedGift' }))];
});
});
};
/**
Returns information about an upgraded gift by its name.
*/
Tdjson.prototype.getUpgradedGift = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getUpgradedGift' }))];
});
});
};
/**
Returns a URL for upgraded gift withdrawal in the TON blockchain as an NFT; requires owner privileges for gifts owned by
a chat.
*/
Tdjson.prototype.getUpgradedGiftWithdrawalUrl = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getUpgradedGiftWithdrawalUrl' }))];
});
});
};
/**
Changes resale price of a unique gift owned by the current user.
*/
Tdjson.prototype.setGiftResalePrice = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setGiftResalePrice' }))];
});
});
};
/**
Returns upgraded gifts that can be bought from other owners using sendResoldGift.
*/
Tdjson.prototype.searchGiftsForResale = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchGiftsForResale' }))];
});
});
};
/**
Creates a link for the given invoice; for bots only.
*/
Tdjson.prototype.createInvoiceLink = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'createInvoiceLink' }))];
});
});
};
/**
Refunds a previously done payment in Telegram Stars; for bots only.
*/
Tdjson.prototype.refundStarPayment = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'refundStarPayment' }))];
});
});
};
/**
Returns a user that can be contacted to get support.
*/
Tdjson.prototype.getSupportUser = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getSupportUser',
})];
});
});
};
/**
Constructs a persistent HTTP URL for a background.
*/
Tdjson.prototype.getBackgroundUrl = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getBackgroundUrl' }))];
});
});
};
/**
Searches for a background by its name.
*/
Tdjson.prototype.searchBackground = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchBackground' }))];
});
});
};
/**
Sets default background for chats; adds the background to the list of installed backgrounds.
*/
Tdjson.prototype.setDefaultBackground = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setDefaultBackground' }))];
});
});
};
/**
Deletes default background for chats.
*/
Tdjson.prototype.deleteDefaultBackground = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteDefaultBackground' }))];
});
});
};
/**
Returns backgrounds installed by the user.
*/
Tdjson.prototype.getInstalledBackgrounds = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getInstalledBackgrounds' }))];
});
});
};
/**
Removes background from the list of installed backgrounds.
*/
Tdjson.prototype.removeInstalledBackground = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'removeInstalledBackground' }))];
});
});
};
/**
Resets list of installed backgrounds to its default value.
*/
Tdjson.prototype.resetInstalledBackgrounds = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'resetInstalledBackgrounds',
})];
});
});
};
/**
Returns information about the current localization target. This is an offline method if only_local is true. Can be
called before authorization.
*/
Tdjson.prototype.getLocalizationTargetInfo = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getLocalizationTargetInfo' }))];
});
});
};
/**
Returns information about a language pack. Returned language pack identifier may be different from a provided one. Can
be called before authorization.
*/
Tdjson.prototype.getLanguagePackInfo = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getLanguagePackInfo' }))];
});
});
};
/**
Returns strings from a language pack in the current localization target by their keys. Can be called before
authorization.
*/
Tdjson.prototype.getLanguagePackStrings = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getLanguagePackStrings' }))];
});
});
};
/**
Fetches the latest versions of all strings from a language pack in the current localization target from the server. This
method doesn't need to be called explicitly for the current used/base language packs. Can be called before
authorization.
*/
Tdjson.prototype.synchronizeLanguagePack = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'synchronizeLanguagePack' }))];
});
});
};
/**
Adds a custom server language pack to the list of installed language packs in current localization target. Can be called
before authorization.
*/
Tdjson.prototype.addCustomServerLanguagePack = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'addCustomServerLanguagePack' }))];
});
});
};
/**
Adds or changes a custom local language pack to the current localization target.
*/
Tdjson.prototype.setCustomLanguagePack = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setCustomLanguagePack' }))];
});
});
};
/**
Edits information about a custom local language pack in the current localization target. Can be called before
authorization.
*/
Tdjson.prototype.editCustomLanguagePackInfo = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editCustomLanguagePackInfo' }))];
});
});
};
/**
Adds, edits or deletes a string in a custom local language pack. Can be called before authorization.
*/
Tdjson.prototype.setCustomLanguagePackString = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setCustomLanguagePackString' }))];
});
});
};
/**
Deletes all information about a language pack in the current localization target. The language pack which is currently
in use (including base language pack) or is being synchronized can't be deleted. Can be called before authorization.
*/
Tdjson.prototype.deleteLanguagePack = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteLanguagePack' }))];
});
});
};
/**
Registers the currently used device for receiving push notifications. Returns a globally unique identifier of the push
notification subscription.
*/
Tdjson.prototype.registerDevice = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'registerDevice' }))];
});
});
};
/**
Handles a push notification. Returns error with code 406 if the push notification is not supported and connection to the
server is required to fetch new data. Can be called before authorization.
*/
Tdjson.prototype.processPushNotification = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'processPushNotification' }))];
});
});
};
/**
Returns a globally unique push notification subscription identifier for identification of an account, which has received
a push notification. Can be called synchronously.
*/
Tdjson.prototype.getPushReceiverId = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getPushReceiverId' }))];
});
});
};
/**
Returns t.me URLs recently visited by a newly registered user.
*/
Tdjson.prototype.getRecentlyVisitedTMeUrls = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getRecentlyVisitedTMeUrls' }))];
});
});
};
/**
Changes user privacy settings.
*/
Tdjson.prototype.setUserPrivacySettingRules = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setUserPrivacySettingRules' }))];
});
});
};
/**
Returns the current privacy settings.
*/
Tdjson.prototype.getUserPrivacySettingRules = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getUserPrivacySettingRules' }))];
});
});
};
/**
Changes privacy settings for message read date.
*/
Tdjson.prototype.setReadDatePrivacySettings = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setReadDatePrivacySettings' }))];
});
});
};
/**
Returns privacy settings for message read date.
*/
Tdjson.prototype.getReadDatePrivacySettings = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getReadDatePrivacySettings',
})];
});
});
};
/**
Changes privacy settings for new chat creation; can be used only if getOption("can_set_new_chat_privacy_settings").
*/
Tdjson.prototype.setNewChatPrivacySettings = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setNewChatPrivacySettings' }))];
});
});
};
/**
Returns privacy settings for new chat creation.
*/
Tdjson.prototype.getNewChatPrivacySettings = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getNewChatPrivacySettings',
})];
});
});
};
/**
Returns the total number of Telegram Stars received by the current user for paid messages from the given user.
*/
Tdjson.prototype.getPaidMessageRevenue = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getPaidMessageRevenue' }))];
});
});
};
/**
Allows the specified user to send unpaid private messages to the current user by adding a rule to
userPrivacySettingAllowUnpaidMessages.
*/
Tdjson.prototype.allowUnpaidMessagesFromUser = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'allowUnpaidMessagesFromUser' }))];
});
});
};
/**
Changes the amount of Telegram Stars that must be paid to send a message to a supergroup chat; requires
can_restrict_members administrator right and supergroupFullInfo.can_enable_paid_messages.
*/
Tdjson.prototype.setChatPaidMessageStarCount = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setChatPaidMessageStarCount' }))];
});
});
};
/**
Check whether the current user can message another user or try to create a chat with them.
*/
Tdjson.prototype.canSendMessageToUser = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'canSendMessageToUser' }))];
});
});
};
/**
Returns the value of an option by its name. (Check the list of available options on
https://core.telegram.org/tdlib/options.) Can be called before authorization. Can be called synchronously for options
"version" and "commit_hash".
*/
Tdjson.prototype.getOption = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getOption' }))];
});
});
};
/**
Sets the value of an option. (Check the list of available options on https://core.telegram.org/tdlib/options.) Only
writable options can be set. Can be called before authorization.
*/
Tdjson.prototype.setOption = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setOption' }))];
});
});
};
/**
Changes the period of inactivity after which the account of the current user will automatically be deleted.
*/
Tdjson.prototype.setAccountTtl = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setAccountTtl' }))];
});
});
};
/**
Returns the period of inactivity after which the account of the current user will automatically be deleted.
*/
Tdjson.prototype.getAccountTtl = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getAccountTtl',
})];
});
});
};
/**
Deletes the account of the current user, deleting all information associated with the user from the server. The phone
number of the account can be used to create a new account. Can be called before authorization when the current
authorization state is authorizationStateWaitPassword.
*/
Tdjson.prototype.deleteAccount = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteAccount' }))];
});
});
};
/**
Changes the default message auto-delete time for new chats.
*/
Tdjson.prototype.setDefaultMessageAutoDeleteTime = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setDefaultMessageAutoDeleteTime' }))];
});
});
};
/**
Returns default message auto-delete time setting for new chats.
*/
Tdjson.prototype.getDefaultMessageAutoDeleteTime = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getDefaultMessageAutoDeleteTime',
})];
});
});
};
/**
Removes a chat action bar without any other action.
*/
Tdjson.prototype.removeChatActionBar = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'removeChatActionBar' }))];
});
});
};
/**
Reports a chat to the Telegram moderators. A chat can be reported only from the chat action bar, or if
chat.can_be_reported.
*/
Tdjson.prototype.reportChat = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'reportChat' }))];
});
});
};
/**
Reports a chat photo to the Telegram moderators. A chat photo can be reported only if chat.can_be_reported.
*/
Tdjson.prototype.reportChatPhoto = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'reportChatPhoto' }))];
});
});
};
/**
Reports reactions set on a message to the Telegram moderators. Reactions on a message can be reported only if
messageProperties.can_report_reactions.
*/
Tdjson.prototype.reportMessageReactions = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'reportMessageReactions' }))];
});
});
};
/**
Returns detailed revenue statistics about a chat. Currently, this method can be used only for channels if
supergroupFullInfo.can_get_revenue_statistics == true or bots if userFullInfo.bot_info.can_get_revenue_statistics ==
true.
*/
Tdjson.prototype.getChatRevenueStatistics = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatRevenueStatistics' }))];
});
});
};
/**
Returns a URL for chat revenue withdrawal; requires owner privileges in the channel chat or the bot. Currently, this
method can be used only if getOption("can_withdraw_chat_revenue") for channels with
supergroupFullInfo.can_get_revenue_statistics == true or bots with userFullInfo.bot_info.can_get_revenue_statistics ==
true.
*/
Tdjson.prototype.getChatRevenueWithdrawalUrl = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatRevenueWithdrawalUrl' }))];
});
});
};
/**
Returns the list of revenue transactions for a chat. Currently, this method can be used only for channels if
supergroupFullInfo.can_get_revenue_statistics == true or bots if userFullInfo.bot_info.can_get_revenue_statistics ==
true.
*/
Tdjson.prototype.getChatRevenueTransactions = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatRevenueTransactions' }))];
});
});
};
/**
Returns the list of Toncoin transactions of the current user.
*/
Tdjson.prototype.getTonTransactions = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getTonTransactions' }))];
});
});
};
/**
Returns detailed Telegram Star revenue statistics.
*/
Tdjson.prototype.getStarRevenueStatistics = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getStarRevenueStatistics' }))];
});
});
};
/**
Returns a URL for Telegram Star withdrawal.
*/
Tdjson.prototype.getStarWithdrawalUrl = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getStarWithdrawalUrl' }))];
});
});
};
/**
Returns a URL for a Telegram Ad platform account that can be used to set up advertisements for the chat paid in the
owned Telegram Stars.
*/
Tdjson.prototype.getStarAdAccountUrl = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getStarAdAccountUrl' }))];
});
});
};
/**
Returns detailed statistics about a chat. Currently, this method can be used only for supergroups and channels. Can be
used only if supergroupFullInfo.can_get_statistics == true.
*/
Tdjson.prototype.getChatStatistics = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getChatStatistics' }))];
});
});
};
/**
Returns detailed statistics about a message. Can be used only if messageProperties.can_get_statistics == true.
*/
Tdjson.prototype.getMessageStatistics = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getMessageStatistics' }))];
});
});
};
/**
Returns forwarded copies of a channel message to different public channels and public reposts as a story. Can be used
only if messageProperties.can_get_statistics == true. For optimal performance, the number of returned messages and
stories is chosen by TDLib.
*/
Tdjson.prototype.getMessagePublicForwards = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getMessagePublicForwards' }))];
});
});
};
/**
Returns detailed statistics about a story. Can be used only if story.can_get_statistics == true.
*/
Tdjson.prototype.getStoryStatistics = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getStoryStatistics' }))];
});
});
};
/**
Loads an asynchronous or a zoomed in statistical graph.
*/
Tdjson.prototype.getStatisticalGraph = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getStatisticalGraph' }))];
});
});
};
/**
Returns storage usage statistics. Can be called before authorization.
*/
Tdjson.prototype.getStorageStatistics = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getStorageStatistics' }))];
});
});
};
/**
Quickly returns approximate storage usage statistics. Can be called before authorization.
*/
Tdjson.prototype.getStorageStatisticsFast = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getStorageStatisticsFast',
})];
});
});
};
/**
Returns database statistics.
*/
Tdjson.prototype.getDatabaseStatistics = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getDatabaseStatistics',
})];
});
});
};
/**
Optimizes storage usage, i.e. deletes some files and returns new storage usage statistics. Secret thumbnails can't be
deleted.
*/
Tdjson.prototype.optimizeStorage = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'optimizeStorage' }))];
});
});
};
/**
Sets the current network type. Can be called before authorization. Calling this method forces all network connections to
reopen, mitigating the delay in switching between different networks, so it must be called whenever the network is
changed, even if the network type remains the same. Network type is used to check whether the library can use the
network at all and also for collecting detailed network data usage statistics.
*/
Tdjson.prototype.setNetworkType = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setNetworkType' }))];
});
});
};
/**
Returns network data usage statistics. Can be called before authorization.
*/
Tdjson.prototype.getNetworkStatistics = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getNetworkStatistics' }))];
});
});
};
/**
Adds the specified data to data usage statistics. Can be called before authorization.
*/
Tdjson.prototype.addNetworkStatistics = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'addNetworkStatistics' }))];
});
});
};
/**
Resets all network data usage statistics to zero. Can be called before authorization.
*/
Tdjson.prototype.resetNetworkStatistics = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'resetNetworkStatistics',
})];
});
});
};
/**
Returns auto-download settings presets for the current user.
*/
Tdjson.prototype.getAutoDownloadSettingsPresets = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getAutoDownloadSettingsPresets',
})];
});
});
};
/**
Sets auto-download settings.
*/
Tdjson.prototype.setAutoDownloadSettings = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setAutoDownloadSettings' }))];
});
});
};
/**
Returns autosave settings for the current user.
*/
Tdjson.prototype.getAutosaveSettings = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getAutosaveSettings',
})];
});
});
};
/**
Sets autosave settings for the given scope. The method is guaranteed to work only after at least one call to
getAutosaveSettings.
*/
Tdjson.prototype.setAutosaveSettings = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setAutosaveSettings' }))];
});
});
};
/**
Clears the list of all autosave settings exceptions. The method is guaranteed to work only after at least one call to
getAutosaveSettings.
*/
Tdjson.prototype.clearAutosaveSettingsExceptions = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'clearAutosaveSettingsExceptions',
})];
});
});
};
/**
Returns information about a bank card.
*/
Tdjson.prototype.getBankCardInfo = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getBankCardInfo' }))];
});
});
};
/**
Returns one of the available Telegram Passport elements.
*/
Tdjson.prototype.getPassportElement = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getPassportElement' }))];
});
});
};
/**
Returns all available Telegram Passport elements.
*/
Tdjson.prototype.getAllPassportElements = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getAllPassportElements' }))];
});
});
};
/**
Adds an element to the user's Telegram Passport. May return an error with a message "PHONE_VERIFICATION_NEEDED" or
"EMAIL_VERIFICATION_NEEDED" if the chosen phone number or the chosen email address must be verified first.
*/
Tdjson.prototype.setPassportElement = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setPassportElement' }))];
});
});
};
/**
Deletes a Telegram Passport element.
*/
Tdjson.prototype.deletePassportElement = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deletePassportElement' }))];
});
});
};
/**
Informs the user that some of the elements in their Telegram Passport contain errors; for bots only. The user will not
be able to resend the elements, until the errors are fixed.
*/
Tdjson.prototype.setPassportElementErrors = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setPassportElementErrors' }))];
});
});
};
/**
Returns an IETF language tag of the language preferred in the country, which must be used to fill native fields in
Telegram Passport personal details. Returns a 404 error if unknown.
*/
Tdjson.prototype.getPreferredCountryLanguage = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getPreferredCountryLanguage' }))];
});
});
};
/**
Sends a code to verify an email address to be added to a user's Telegram Passport.
*/
Tdjson.prototype.sendEmailAddressVerificationCode = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'sendEmailAddressVerificationCode' }))];
});
});
};
/**
Resends the code to verify an email address to be added to a user's Telegram Passport.
*/
Tdjson.prototype.resendEmailAddressVerificationCode = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'resendEmailAddressVerificationCode',
})];
});
});
};
/**
Checks the email address verification code for Telegram Passport.
*/
Tdjson.prototype.checkEmailAddressVerificationCode = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'checkEmailAddressVerificationCode' }))];
});
});
};
/**
Returns a Telegram Passport authorization form for sharing data with a service.
*/
Tdjson.prototype.getPassportAuthorizationForm = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getPassportAuthorizationForm' }))];
});
});
};
/**
Returns already available Telegram Passport elements suitable for completing a Telegram Passport authorization form.
Result can be received only once for each authorization form.
*/
Tdjson.prototype.getPassportAuthorizationFormAvailableElements = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getPassportAuthorizationFormAvailableElements' }))];
});
});
};
/**
Sends a Telegram Passport authorization form, effectively sharing data with the service. This method must be called
after getPassportAuthorizationFormAvailableElements if some previously available elements are going to be reused.
*/
Tdjson.prototype.sendPassportAuthorizationForm = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'sendPassportAuthorizationForm' }))];
});
});
};
/**
Informs the server about the number of pending bot updates if they haven't been processed for a long time; for bots
only.
*/
Tdjson.prototype.setBotUpdatesStatus = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setBotUpdatesStatus' }))];
});
});
};
/**
Uploads a file with a sticker; returns the uploaded file.
*/
Tdjson.prototype.uploadStickerFile = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'uploadStickerFile' }))];
});
});
};
/**
Returns a suggested name for a new sticker set with a given title.
*/
Tdjson.prototype.getSuggestedStickerSetName = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getSuggestedStickerSetName' }))];
});
});
};
/**
Checks whether a name can be used for a new sticker set.
*/
Tdjson.prototype.checkStickerSetName = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'checkStickerSetName' }))];
});
});
};
/**
Creates a new sticker set. Returns the newly created sticker set.
*/
Tdjson.prototype.createNewStickerSet = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'createNewStickerSet' }))];
});
});
};
/**
Adds a new sticker to a set.
*/
Tdjson.prototype.addStickerToSet = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'addStickerToSet' }))];
});
});
};
/**
Replaces existing sticker in a set. The function is equivalent to removeStickerFromSet, then addStickerToSet, then
setStickerPositionInSet.
*/
Tdjson.prototype.replaceStickerInSet = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'replaceStickerInSet' }))];
});
});
};
/**
Sets a sticker set thumbnail.
*/
Tdjson.prototype.setStickerSetThumbnail = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setStickerSetThumbnail' }))];
});
});
};
/**
Sets a custom emoji sticker set thumbnail.
*/
Tdjson.prototype.setCustomEmojiStickerSetThumbnail = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setCustomEmojiStickerSetThumbnail' }))];
});
});
};
/**
Sets a sticker set title.
*/
Tdjson.prototype.setStickerSetTitle = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setStickerSetTitle' }))];
});
});
};
/**
Completely deletes a sticker set.
*/
Tdjson.prototype.deleteStickerSet = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'deleteStickerSet' }))];
});
});
};
/**
Changes the position of a sticker in the set to which it belongs. The sticker set must be owned by the current user.
*/
Tdjson.prototype.setStickerPositionInSet = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setStickerPositionInSet' }))];
});
});
};
/**
Removes a sticker from the set to which it belongs. The sticker set must be owned by the current user.
*/
Tdjson.prototype.removeStickerFromSet = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'removeStickerFromSet' }))];
});
});
};
/**
Changes the list of emojis corresponding to a sticker. The sticker must belong to a regular or custom emoji sticker set
that is owned by the current user.
*/
Tdjson.prototype.setStickerEmojis = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setStickerEmojis' }))];
});
});
};
/**
Changes the list of keywords of a sticker. The sticker must belong to a regular or custom emoji sticker set that is
owned by the current user.
*/
Tdjson.prototype.setStickerKeywords = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setStickerKeywords' }))];
});
});
};
/**
Changes the mask position of a mask sticker. The sticker must belong to a mask sticker set that is owned by the current
user.
*/
Tdjson.prototype.setStickerMaskPosition = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setStickerMaskPosition' }))];
});
});
};
/**
Returns sticker sets owned by the current user.
*/
Tdjson.prototype.getOwnedStickerSets = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getOwnedStickerSets' }))];
});
});
};
/**
Returns information about a file with a map thumbnail in PNG format. Only map thumbnail files with size less than 1MB
can be downloaded.
*/
Tdjson.prototype.getMapThumbnailFile = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getMapThumbnailFile' }))];
});
});
};
/**
Returns information about a limit, increased for Premium users. Returns a 404 error if the limit is unknown.
*/
Tdjson.prototype.getPremiumLimit = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getPremiumLimit' }))];
});
});
};
/**
Returns information about features, available to Premium users.
*/
Tdjson.prototype.getPremiumFeatures = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getPremiumFeatures' }))];
});
});
};
/**
Returns examples of premium stickers for demonstration purposes.
*/
Tdjson.prototype.getPremiumStickerExamples = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getPremiumStickerExamples',
})];
});
});
};
/**
Returns the sticker to be used as representation of the Telegram Premium subscription.
*/
Tdjson.prototype.getPremiumInfoSticker = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getPremiumInfoSticker' }))];
});
});
};
/**
Informs TDLib that the user viewed detailed information about a Premium feature on the Premium features screen.
*/
Tdjson.prototype.viewPremiumFeature = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'viewPremiumFeature' }))];
});
});
};
/**
Informs TDLib that the user clicked Premium subscription button on the Premium features screen.
*/
Tdjson.prototype.clickPremiumSubscriptionButton = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'clickPremiumSubscriptionButton',
})];
});
});
};
/**
Returns state of Telegram Premium subscription and promotion videos for Premium features.
*/
Tdjson.prototype.getPremiumState = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getPremiumState',
})];
});
});
};
/**
Returns available options for gifting Telegram Premium to a user.
*/
Tdjson.prototype.getPremiumGiftPaymentOptions = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getPremiumGiftPaymentOptions',
})];
});
});
};
/**
Returns available options for creating of Telegram Premium giveaway or manual distribution of Telegram Premium among
chat members.
*/
Tdjson.prototype.getPremiumGiveawayPaymentOptions = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getPremiumGiveawayPaymentOptions' }))];
});
});
};
/**
Return information about a Telegram Premium gift code.
*/
Tdjson.prototype.checkPremiumGiftCode = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'checkPremiumGiftCode' }))];
});
});
};
/**
Applies a Telegram Premium gift code.
*/
Tdjson.prototype.applyPremiumGiftCode = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'applyPremiumGiftCode' }))];
});
});
};
/**
Allows to buy a Telegram Premium subscription for another user with payment in Telegram Stars; for bots only.
*/
Tdjson.prototype.giftPremiumWithStars = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'giftPremiumWithStars' }))];
});
});
};
/**
Launches a prepaid giveaway.
*/
Tdjson.prototype.launchPrepaidGiveaway = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'launchPrepaidGiveaway' }))];
});
});
};
/**
Returns information about a giveaway.
*/
Tdjson.prototype.getGiveawayInfo = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getGiveawayInfo' }))];
});
});
};
/**
Returns available options for Telegram Stars purchase.
*/
Tdjson.prototype.getStarPaymentOptions = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getStarPaymentOptions',
})];
});
});
};
/**
Returns available options for Telegram Stars gifting.
*/
Tdjson.prototype.getStarGiftPaymentOptions = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getStarGiftPaymentOptions' }))];
});
});
};
/**
Returns available options for Telegram Star giveaway creation.
*/
Tdjson.prototype.getStarGiveawayPaymentOptions = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getStarGiveawayPaymentOptions',
})];
});
});
};
/**
Returns the list of Telegram Star transactions for the specified owner.
*/
Tdjson.prototype.getStarTransactions = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getStarTransactions' }))];
});
});
};
/**
Returns the list of Telegram Star subscriptions for the current user.
*/
Tdjson.prototype.getStarSubscriptions = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getStarSubscriptions' }))];
});
});
};
/**
Checks whether an in-store purchase is possible. Must be called before any in-store purchase. For official applications
only.
*/
Tdjson.prototype.canPurchaseFromStore = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'canPurchaseFromStore' }))];
});
});
};
/**
Informs server about an in-store purchase. For official applications only.
*/
Tdjson.prototype.assignStoreTransaction = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'assignStoreTransaction' }))];
});
});
};
/**
Cancels or re-enables Telegram Star subscription.
*/
Tdjson.prototype.editStarSubscription = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editStarSubscription' }))];
});
});
};
/**
Cancels or re-enables Telegram Star subscription for a user; for bots only.
*/
Tdjson.prototype.editUserStarSubscription = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editUserStarSubscription' }))];
});
});
};
/**
Reuses an active Telegram Star subscription to a channel chat and joins the chat again.
*/
Tdjson.prototype.reuseStarSubscription = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'reuseStarSubscription' }))];
});
});
};
/**
Changes affiliate program for a bot.
*/
Tdjson.prototype.setChatAffiliateProgram = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setChatAffiliateProgram' }))];
});
});
};
/**
Searches a chat with an affiliate program. Returns the chat if found and the program is active.
*/
Tdjson.prototype.searchChatAffiliateProgram = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchChatAffiliateProgram' }))];
});
});
};
/**
Searches affiliate programs that can be connected to the given affiliate.
*/
Tdjson.prototype.searchAffiliatePrograms = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchAffiliatePrograms' }))];
});
});
};
/**
Connects an affiliate program to the given affiliate. Returns information about the connected affiliate program.
*/
Tdjson.prototype.connectAffiliateProgram = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'connectAffiliateProgram' }))];
});
});
};
/**
Disconnects an affiliate program from the given affiliate and immediately deactivates its referral link. Returns updated
information about the disconnected affiliate program.
*/
Tdjson.prototype.disconnectAffiliateProgram = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'disconnectAffiliateProgram' }))];
});
});
};
/**
Returns an affiliate program that were connected to the given affiliate by identifier of the bot that created the
program.
*/
Tdjson.prototype.getConnectedAffiliateProgram = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getConnectedAffiliateProgram' }))];
});
});
};
/**
Returns affiliate programs that were connected to the given affiliate.
*/
Tdjson.prototype.getConnectedAffiliatePrograms = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getConnectedAffiliatePrograms' }))];
});
});
};
/**
Returns information about features, available to Business users.
*/
Tdjson.prototype.getBusinessFeatures = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getBusinessFeatures' }))];
});
});
};
/**
Accepts Telegram terms of services.
*/
Tdjson.prototype.acceptTermsOfService = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'acceptTermsOfService' }))];
});
});
};
/**
Searches specified query by word prefixes in the provided strings. Returns 0-based positions of strings that matched.
Can be called synchronously.
*/
Tdjson.prototype.searchStringsByPrefix = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'searchStringsByPrefix' }))];
});
});
};
/**
Sends a custom request; for bots only.
*/
Tdjson.prototype.sendCustomRequest = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'sendCustomRequest' }))];
});
});
};
/**
Answers a custom query; for bots only.
*/
Tdjson.prototype.answerCustomQuery = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'answerCustomQuery' }))];
});
});
};
/**
Succeeds after a specified amount of time has passed. Can be called before initialization.
*/
Tdjson.prototype.setAlarm = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setAlarm' }))];
});
});
};
/**
Returns information about existing countries. Can be called before authorization.
*/
Tdjson.prototype.getCountries = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getCountries',
})];
});
});
};
/**
Uses the current IP address to find the current country. Returns two-letter ISO 3166-1 alpha-2 country code. Can be
called before authorization.
*/
Tdjson.prototype.getCountryCode = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getCountryCode',
})];
});
});
};
/**
Returns information about a phone number by its prefix. Can be called before authorization.
*/
Tdjson.prototype.getPhoneNumberInfo = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getPhoneNumberInfo' }))];
});
});
};
/**
Returns information about a phone number by its prefix synchronously. getCountries must be called at least once after
changing localization to the specified language if properly localized country information is expected. Can be called
synchronously.
*/
Tdjson.prototype.getPhoneNumberInfoSync = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getPhoneNumberInfoSync' }))];
});
});
};
/**
Returns information about a given collectible item that was purchased at https://fragment.com.
*/
Tdjson.prototype.getCollectibleItemInfo = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getCollectibleItemInfo' }))];
});
});
};
/**
Returns information about a tg:// deep link. Use "tg://need_update_for_some_feature" or "tg:some_unsupported_feature"
for testing. Returns a 404 error for unknown links. Can be called before authorization.
*/
Tdjson.prototype.getDeepLinkInfo = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getDeepLinkInfo' }))];
});
});
};
/**
Returns application config, provided by the server. Can be called before authorization.
*/
Tdjson.prototype.getApplicationConfig = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getApplicationConfig',
})];
});
});
};
/**
Saves application log event on the server. Can be called before authorization.
*/
Tdjson.prototype.saveApplicationLogEvent = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'saveApplicationLogEvent' }))];
});
});
};
/**
Returns the link for downloading official Telegram application to be used when the current user invites friends to
Telegram.
*/
Tdjson.prototype.getApplicationDownloadLink = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getApplicationDownloadLink',
})];
});
});
};
/**
Adds a proxy server for network requests. Can be called before authorization.
*/
Tdjson.prototype.addProxy = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'addProxy' }))];
});
});
};
/**
Edits an existing proxy server for network requests. Can be called before authorization.
*/
Tdjson.prototype.editProxy = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'editProxy' }))];
});
});
};
/**
Enables a proxy. Only one proxy can be enabled at a time. Can be called before authorization.
*/
Tdjson.prototype.enableProxy = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'enableProxy' }))];
});
});
};
/**
Disables the currently enabled proxy. Can be called before authorization.
*/
Tdjson.prototype.disableProxy = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'disableProxy',
})];
});
});
};
/**
Removes a proxy server. Can be called before authorization.
*/
Tdjson.prototype.removeProxy = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'removeProxy' }))];
});
});
};
/**
Returns the list of proxies that are currently set up. Can be called before authorization.
*/
Tdjson.prototype.getProxies = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getProxies',
})];
});
});
};
/**
Returns an HTTPS link, which can be used to add a proxy. Available only for SOCKS5 and MTProto proxies. Can be called
before authorization.
*/
Tdjson.prototype.getProxyLink = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getProxyLink' }))];
});
});
};
/**
Computes time needed to receive a response from a Telegram server through a proxy. Can be called before authorization.
*/
Tdjson.prototype.pingProxy = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'pingProxy' }))];
});
});
};
/**
Sets new log stream for internal logging of TDLib. Can be called synchronously.
*/
Tdjson.prototype.setLogStream = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setLogStream' }))];
});
});
};
/**
Returns information about currently used log stream for internal logging of TDLib. Can be called synchronously.
*/
Tdjson.prototype.getLogStream = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getLogStream',
})];
});
});
};
/**
Sets the verbosity level of the internal logging of TDLib. Can be called synchronously.
*/
Tdjson.prototype.setLogVerbosityLevel = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setLogVerbosityLevel' }))];
});
});
};
/**
Returns current verbosity level of the internal logging of TDLib. Can be called synchronously.
*/
Tdjson.prototype.getLogVerbosityLevel = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getLogVerbosityLevel',
})];
});
});
};
/**
Returns the list of available TDLib internal log tags, for example, ["actor", "binlog", "connections", "notifications",
"proxy"]. Can be called synchronously.
*/
Tdjson.prototype.getLogTags = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getLogTags',
})];
});
});
};
/**
Sets the verbosity level for a specified TDLib internal log tag. Can be called synchronously.
*/
Tdjson.prototype.setLogTagVerbosityLevel = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setLogTagVerbosityLevel' }))];
});
});
};
/**
Returns current verbosity level for a specified TDLib internal log tag. Can be called synchronously.
*/
Tdjson.prototype.getLogTagVerbosityLevel = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getLogTagVerbosityLevel' }))];
});
});
};
/**
Adds a message to TDLib internal log. Can be called synchronously.
*/
Tdjson.prototype.addLogMessage = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'addLogMessage' }))];
});
});
};
/**
Returns support information for the given user; for Telegram support only.
*/
Tdjson.prototype.getUserSupportInfo = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'getUserSupportInfo' }))];
});
});
};
/**
Sets support information for the given user; for Telegram support only.
*/
Tdjson.prototype.setUserSupportInfo = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'setUserSupportInfo' }))];
});
});
};
/**
Returns localized name of the Telegram support user; for Telegram support only.
*/
Tdjson.prototype.getSupportName = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'getSupportName',
})];
});
});
};
/**
Does nothing; for testing only. This is an offline method. Can be called before authorization.
*/
Tdjson.prototype.testCallEmpty = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'testCallEmpty',
})];
});
});
};
/**
Returns the received string; for testing only. This is an offline method. Can be called before authorization.
*/
Tdjson.prototype.testCallString = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'testCallString' }))];
});
});
};
/**
Returns the received bytes; for testing only. This is an offline method. Can be called before authorization.
*/
Tdjson.prototype.testCallBytes = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'testCallBytes' }))];
});
});
};
/**
Returns the received vector of numbers; for testing only. This is an offline method. Can be called before authorization.
*/
Tdjson.prototype.testCallVectorInt = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'testCallVectorInt' }))];
});
});
};
/**
Returns the received vector of objects containing a number; for testing only. This is an offline method. Can be called
before authorization.
*/
Tdjson.prototype.testCallVectorIntObject = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'testCallVectorIntObject' }))];
});
});
};
/**
Returns the received vector of strings; for testing only. This is an offline method. Can be called before authorization.
*/
Tdjson.prototype.testCallVectorString = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'testCallVectorString' }))];
});
});
};
/**
Returns the received vector of objects containing a string; for testing only. This is an offline method. Can be called
before authorization.
*/
Tdjson.prototype.testCallVectorStringObject = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'testCallVectorStringObject' }))];
});
});
};
/**
Returns the squared received number; for testing only. This is an offline method. Can be called before authorization.
*/
Tdjson.prototype.testSquareInt = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'testSquareInt' }))];
});
});
};
/**
Sends a simple network request to the Telegram servers; for testing only. Can be called before authorization.
*/
Tdjson.prototype.testNetwork = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'testNetwork',
})];
});
});
};
/**
Sends a simple network request to the Telegram servers via proxy; for testing only. Can be called before authorization.
*/
Tdjson.prototype.testProxy = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'testProxy' }))];
});
});
};
/**
Forces an updates.getDifference call to the Telegram servers; for testing only.
*/
Tdjson.prototype.testGetDifference = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'testGetDifference',
})];
});
});
};
/**
Does nothing and ensures that the Update object is used; for testing only. This is an offline method. Can be called
before authorization.
*/
Tdjson.prototype.testUseUpdate = function () {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request({
'@type': 'testUseUpdate',
})];
});
});
};
/**
Returns the specified error and ensures that the Error object is used; for testing only. Can be called synchronously.
*/
Tdjson.prototype.testReturnError = function (options) {
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
return [2 /*return*/, this._request(__assign(__assign({}, options), { '@type': 'testReturnError' }))];
});
});
};
return Tdjson;
}());
exports.Tdjson = Tdjson;
//# sourceMappingURL=tdjson.js.map