diff --git a/packages/client/src/client.ts b/packages/client/src/client.ts index ff8319fd..e0519d3c 100644 --- a/packages/client/src/client.ts +++ b/packages/client/src/client.ts @@ -97,6 +97,7 @@ import { forwardMessages } from './methods/messages/forward-messages' import { _getDiscussionMessage } from './methods/messages/get-discussion-message' import { getHistory } from './methods/messages/get-history' import { getMessageGroup } from './methods/messages/get-message-group' +import { getMessagesUnsafe } from './methods/messages/get-messages-unsafe' import { getMessages } from './methods/messages/get-messages' import { iterHistory } from './methods/messages/iter-history' import { _normalizeInline } from './methods/messages/normalize-inline' @@ -2101,9 +2102,42 @@ export interface TelegramClient extends BaseTelegramClient { */ getMessageGroup(chatId: InputPeerLike, message: number): Promise /** - * Get a single message in chat by its ID + * Get a single message from PM or legacy group by its ID. + * For channels, use {@link getMessages}. * - * **Note**: this method might return empty message + * Unlike {@link getMessages}, this method does not + * check if the message belongs to some chat. + * + * @param messageId Messages ID + * @param [fromReply=false] + * Whether the reply to a given message should be fetched + * (i.e. `getMessages(msg.chat.id, msg.id, true).id === msg.replyToMessageId`) + */ + getMessagesUnsafe( + messageId: number, + fromReply?: boolean + ): Promise + /** + * Get messages from PM or legacy group by their IDs. + * For channels, use {@link getMessages}. + * + * Unlike {@link getMessages}, this method does not + * check if the message belongs to some chat. + * + * Fot messages that were not found, `null` will be + * returned at that position. + * + * @param messageIds Messages IDs + * @param [fromReply=false] + * Whether the reply to a given message should be fetched + * (i.e. `getMessages(msg.chat.id, msg.id, true).id === msg.replyToMessageId`) + */ + getMessagesUnsafe( + messageIds: number[], + fromReply?: boolean + ): Promise<(Message | null)[]> + /** + * Get a single message in chat by its ID * * @param chatId Chat's marked ID, its username, phone or `"me"` or `"self"` * @param messageId Messages ID @@ -2115,11 +2149,12 @@ export interface TelegramClient extends BaseTelegramClient { chatId: InputPeerLike, messageId: number, fromReply?: boolean - ): Promise + ): Promise /** * Get messages in chat by their IDs * - * **Note**: this method might return empty messages + * Fot messages that were not found, `null` will be + * returned at that position. * * @param chatId Chat's marked ID, its username, phone or `"me"` or `"self"` * @param messageIds Messages IDs @@ -2131,7 +2166,7 @@ export interface TelegramClient extends BaseTelegramClient { chatId: InputPeerLike, messageIds: number[], fromReply?: boolean - ): Promise + ): Promise<(Message | null)[]> /** * Iterate through a chat history sequentially. * @@ -2569,6 +2604,19 @@ export interface TelegramClient extends BaseTelegramClient { */ replyTo?: number | Message + /** + * Whether to throw an error if {@link replyTo} + * message does not exist. + * + * If that message was not found, `NotFoundError` is thrown, + * with `text` set to `MESSAGE_NOT_FOUND`. + * + * Incurs an additional request, so only use when really needed. + * + * Defaults to `false` + */ + mustReply?: boolean + /** * Message to comment to. Either a message object or message ID. * @@ -3321,6 +3369,7 @@ export class TelegramClient extends BaseTelegramClient { protected _getDiscussionMessage = _getDiscussionMessage getHistory = getHistory getMessageGroup = getMessageGroup + getMessagesUnsafe = getMessagesUnsafe getMessages = getMessages iterHistory = iterHistory protected _normalizeInline = _normalizeInline diff --git a/packages/client/src/methods/messages/get-message-group.ts b/packages/client/src/methods/messages/get-message-group.ts index d2125555..1b11539c 100644 --- a/packages/client/src/methods/messages/get-message-group.ts +++ b/packages/client/src/methods/messages/get-message-group.ts @@ -1,5 +1,6 @@ import { TelegramClient } from '../../client' import { InputPeerLike, MtCuteArgumentError, Message } from '../../types' +import { isInputPeerChannel } from '../../utils/peer-utils' /** * Get all messages inside of a message group @@ -15,16 +16,25 @@ export async function getMessageGroup( ): Promise { // awesome hack stolen from pyrogram // groups have no more than 10 items + // however, since for non-channels message ids are shared, + // we use larger number. + // still, this might not be enough :shrug: + + const peer = await this.resolvePeer(chatId) + + const delta = isInputPeerChannel(peer) ? 9 : 19 const ids: number[] = [] - for (let i = Math.max(message - 9, 0); i <= message + 9; i++) { + for (let i = Math.max(message - delta, 0); i <= message + delta; i++) { ids.push(i) } const messages = await this.getMessages(chatId, ids) - const groupedId = messages.find((it) => it.id === message)!.groupedId + const groupedId = messages.find((it) => it?.id === message)!.groupedId if (!groupedId) throw new MtCuteArgumentError('This message is not grouped') - return messages.filter((it) => it.groupedId?.eq(groupedId)) + return messages.filter( + (it) => it && it.groupedId?.eq(groupedId) + ) as Message[] } diff --git a/packages/client/src/methods/messages/get-messages-unsafe.ts b/packages/client/src/methods/messages/get-messages-unsafe.ts new file mode 100644 index 00000000..47e6ec94 --- /dev/null +++ b/packages/client/src/methods/messages/get-messages-unsafe.ts @@ -0,0 +1,86 @@ +import { TelegramClient } from '../../client' +import { MaybeArray } from '@mtcute/core' +import { + createUsersChatsIndex, +} from '../../utils/peer-utils' +import { tl } from '@mtcute/tl' +import { Message, MtCuteTypeAssertionError } from '../../types' + +/** + * Get a single message from PM or legacy group by its ID. + * For channels, use {@link getMessages}. + * + * Unlike {@link getMessages}, this method does not + * check if the message belongs to some chat. + * + * @param messageId Messages ID + * @param [fromReply=false] + * Whether the reply to a given message should be fetched + * (i.e. `getMessages(msg.chat.id, msg.id, true).id === msg.replyToMessageId`) + * @internal + */ +export async function getMessagesUnsafe( + this: TelegramClient, + messageId: number, + fromReply?: boolean +): Promise +/** + * Get messages from PM or legacy group by their IDs. + * For channels, use {@link getMessages}. + * + * Unlike {@link getMessages}, this method does not + * check if the message belongs to some chat. + * + * Fot messages that were not found, `null` will be + * returned at that position. + * + * @param messageIds Messages IDs + * @param [fromReply=false] + * Whether the reply to a given message should be fetched + * (i.e. `getMessages(msg.chat.id, msg.id, true).id === msg.replyToMessageId`) + * @internal + */ +export async function getMessagesUnsafe( + this: TelegramClient, + messageIds: number[], + fromReply?: boolean +): Promise<(Message | null)[]> + +/** @internal */ +export async function getMessagesUnsafe( + this: TelegramClient, + messageIds: MaybeArray, + fromReply = false +): Promise> { + const isSingle = !Array.isArray(messageIds) + if (isSingle) messageIds = [messageIds as number] + + const type = fromReply ? 'inputMessageReplyTo' : 'inputMessageID' + const ids: tl.TypeInputMessage[] = (messageIds as number[]).map((it) => ({ + _: type, + id: it, + })) + + const res = await this.call({ + _: 'messages.getMessages', + id: ids, + }) + + if (res._ === 'messages.messagesNotModified') + throw new MtCuteTypeAssertionError( + 'getMessages', + '!messages.messagesNotModified', + res._ + ) + + const { users, chats } = createUsersChatsIndex(res) + + const ret = res.messages + .map((msg) => { + if (msg._ === 'messageEmpty') return null + + return new Message(this, msg, users, chats) + }) + + return isSingle ? ret[0] : ret +} diff --git a/packages/client/src/methods/messages/get-messages.ts b/packages/client/src/methods/messages/get-messages.ts index 2b08a699..30e293a3 100644 --- a/packages/client/src/methods/messages/get-messages.ts +++ b/packages/client/src/methods/messages/get-messages.ts @@ -11,8 +11,6 @@ import { Message, InputPeerLike, MtCuteTypeAssertionError } from '../../types' /** * Get a single message in chat by its ID * - * **Note**: this method might return empty message - * * @param chatId Chat's marked ID, its username, phone or `"me"` or `"self"` * @param messageId Messages ID * @param [fromReply=false] @@ -25,11 +23,12 @@ export async function getMessages( chatId: InputPeerLike, messageId: number, fromReply?: boolean -): Promise +): Promise /** * Get messages in chat by their IDs * - * **Note**: this method might return empty messages + * Fot messages that were not found, `null` will be + * returned at that position. * * @param chatId Chat's marked ID, its username, phone or `"me"` or `"self"` * @param messageIds Messages IDs @@ -43,7 +42,7 @@ export async function getMessages( chatId: InputPeerLike, messageIds: number[], fromReply?: boolean -): Promise +): Promise<(Message | null)[]> /** @internal */ export async function getMessages( @@ -51,7 +50,7 @@ export async function getMessages( chatId: InputPeerLike, messageIds: MaybeArray, fromReply = false -): Promise> { +): Promise> { const peer = await this.resolvePeer(chatId) const isSingle = !Array.isArray(messageIds) @@ -63,12 +62,14 @@ export async function getMessages( id: it, })) + const isChannel = isInputPeerChannel(peer) + const res = await this.call( - isInputPeerChannel(peer) + isChannel ? { _: 'channels.getMessages', id: ids, - channel: normalizeToInputChannel(peer), + channel: normalizeToInputChannel(peer)!, } : { _: 'messages.getMessages', @@ -85,9 +86,31 @@ export async function getMessages( const { users, chats } = createUsersChatsIndex(res) - const ret = res.messages - .filter((msg) => msg._ !== 'messageEmpty') - .map((msg) => new Message(this, msg, users, chats)) + const ret = res.messages.map((msg) => { + if (msg._ === 'messageEmpty') return null + + if (!isChannel) { + // make sure that the messages belong to the given chat + // (channels have their own message numbering) + switch (peer._) { + case 'inputPeerSelf': + if (!(msg.peerId._ === 'peerUser' && msg.peerId.userId === this._userId)) + return null + break; + case 'inputPeerUser': + case 'inputPeerUserFromMessage': + if (!(msg.peerId._ === 'peerUser' && msg.peerId.userId === peer.userId)) + return null + break; + case 'inputPeerChat': + if (!(msg.peerId._ === 'peerChat' && msg.peerId.chatId === peer.chatId)) + return null + break; + } + } + + return new Message(this, msg, users, chats) + }) return isSingle ? ret[0] : ret } diff --git a/packages/client/src/methods/messages/send-copy.ts b/packages/client/src/methods/messages/send-copy.ts index 155c35e5..f45f4cbc 100644 --- a/packages/client/src/methods/messages/send-copy.ts +++ b/packages/client/src/methods/messages/send-copy.ts @@ -1,6 +1,7 @@ import { TelegramClient } from '../../client' import { InputPeerLike, Message, ReplyMarkup } from '../../types' import { tl } from '@mtcute/tl' +import { MessageNotFoundError } from '@mtcute/tl/errors' /** * Copy a message (i.e. send the same message, @@ -84,5 +85,8 @@ export async function sendCopy( const fromPeer = await this.resolvePeer(fromChatId) const msg = await this.getMessages(fromPeer, message) + + if (!msg) throw new MessageNotFoundError() + return msg.sendCopy(toChatId, params) } diff --git a/packages/client/src/methods/messages/send-text.ts b/packages/client/src/methods/messages/send-text.ts index 21e91ba5..f0941471 100644 --- a/packages/client/src/methods/messages/send-text.ts +++ b/packages/client/src/methods/messages/send-text.ts @@ -1,6 +1,6 @@ import { TelegramClient } from '../../client' import { tl } from '@mtcute/tl' -import { inputPeerToPeer, normalizeToInputUser } from '../../utils/peer-utils' +import { inputPeerToPeer } from '../../utils/peer-utils' import { normalizeDate, normalizeMessageId, @@ -14,8 +14,9 @@ import { UsersIndex, MtCuteTypeAssertionError, ChatsIndex, + MtCuteArgumentError, } from '../../types' -import { getMarkedPeerId } from '@mtcute/core' +import { getMarkedPeerId, MessageNotFoundError } from '@mtcute/core' import { createDummyUpdate } from '../../utils/updates-utils' /** @@ -36,6 +37,19 @@ export async function sendText( */ replyTo?: number | Message + /** + * Whether to throw an error if {@link replyTo} + * message does not exist. + * + * If that message was not found, `NotFoundError` is thrown, + * with `text` set to `MESSAGE_NOT_FOUND`. + * + * Incurs an additional request, so only use when really needed. + * + * Defaults to `false` + */ + mustReply?: boolean + /** * Message to comment to. Either a message object or message ID. * @@ -111,6 +125,18 @@ export async function sendText( ) } + if (params.mustReply) { + if (!replyTo) + throw new MtCuteArgumentError( + 'mustReply used, but replyTo was not passed' + ) + + const msg = await this.getMessages(peer, replyTo) + + if (!msg) + throw new MessageNotFoundError() + } + const res = await this.call({ _: 'messages.sendMessage', peer, @@ -124,6 +150,9 @@ export async function sendText( entities, clearDraft: params.clearDraft, }) + // } catch (e) { + // + // } if (res._ === 'updateShortSentMessage') { const msg: tl.RawMessage = { @@ -157,7 +186,7 @@ export async function sendText( // we need to do it manually cached = await this.call({ _: 'messages.getChats', - id: [peer.chatId] + id: [peer.chatId], }).then((res) => res.chats[0]) break default: diff --git a/packages/client/src/methods/messages/send-vote.ts b/packages/client/src/methods/messages/send-vote.ts index 8b66d63b..49c1bc9c 100644 --- a/packages/client/src/methods/messages/send-vote.ts +++ b/packages/client/src/methods/messages/send-vote.ts @@ -5,7 +5,7 @@ import { MtCuteTypeAssertionError, Poll, } from '../../types' -import { MaybeArray } from '@mtcute/core' +import { MaybeArray, MessageNotFoundError } from '@mtcute/core' import { createUsersChatsIndex } from '../../utils/peer-utils' import { assertTypeIs } from '../../utils/type-assertion' import { assertIsUpdatesGroup } from '../../utils/updates-utils' @@ -36,6 +36,9 @@ export async function sendVote( let poll: Poll | undefined = undefined if (options.some((it) => typeof it === 'number')) { const msg = await this.getMessages(peer, message) + + if (!msg) throw new MessageNotFoundError() + if (!(msg.media instanceof Poll)) throw new MtCuteArgumentError( 'This message does not contain a poll' diff --git a/packages/client/src/types/bots/callback-query.ts b/packages/client/src/types/bots/callback-query.ts index 918dabaa..ab96fb42 100644 --- a/packages/client/src/types/bots/callback-query.ts +++ b/packages/client/src/types/bots/callback-query.ts @@ -6,6 +6,7 @@ import { MtCuteArgumentError } from '../errors' import { BasicPeerType, getBasicPeerType, getMarkedPeerId } from '@mtcute/core' import { encodeInlineMessageId } from '../../utils/inline-utils' import { User, UsersIndex } from '../peers' +import { MessageNotFoundError } from '@mtcute/core' /** * An incoming callback query, originated from a callback button @@ -179,6 +180,9 @@ export class CallbackQuery { /** * Message that contained the callback button that was clicked. * + * Note that the message may have been deleted, in which case + * `MessageNotFoundError` is thrown. + * * Can only be used if `isInline = false` */ async getMessage(): Promise { @@ -187,10 +191,13 @@ export class CallbackQuery { 'Cannot get a message for inline callback' ) - return this.client.getMessages( + const msg = await this.client.getMessages( getMarkedPeerId(this.raw.peer), this.raw.msgId ) + if (!msg) throw new MessageNotFoundError() + + return msg } /** diff --git a/packages/client/src/types/errors.ts b/packages/client/src/types/errors.ts index 28cac29e..bf4704bb 100644 --- a/packages/client/src/types/errors.ts +++ b/packages/client/src/types/errors.ts @@ -69,7 +69,8 @@ export class MtCuteInvalidPeerTypeError extends MtCuteError { } /** - * Trying to access to some property on an "empty" object. + * Trying to access to some property on an object that does not + * contain that information. */ export class MtCuteEmptyError extends MtCuteError { constructor() { diff --git a/packages/client/src/types/messages/dialog.ts b/packages/client/src/types/messages/dialog.ts index 72a41470..ff83802f 100644 --- a/packages/client/src/types/messages/dialog.ts +++ b/packages/client/src/types/messages/dialog.ts @@ -4,8 +4,7 @@ import { Chat, ChatsIndex, UsersIndex } from '../peers' import { Message } from './message' import { DraftMessage } from './draft-message' import { makeInspectable } from '../utils' -import { getMarkedPeerId } from '@mtcute/core' -import { MtCuteEmptyError } from '../errors' +import { getMarkedPeerId, MessageNotFoundError } from '@mtcute/core' /** * A dialog. @@ -191,6 +190,8 @@ export class Dialog { private _lastMessage?: Message /** * The latest message sent in this chat + * + * Throws `MessageNotFoundError` if it was not found */ get lastMessage(): Message { if (!this._lastMessage) { @@ -203,7 +204,7 @@ export class Dialog { this._chats ) } else { - throw new MtCuteEmptyError() + throw new MessageNotFoundError() } } diff --git a/packages/client/src/types/messages/message.ts b/packages/client/src/types/messages/message.ts index 0618e60f..22a7cafb 100644 --- a/packages/client/src/types/messages/message.ts +++ b/packages/client/src/types/messages/message.ts @@ -4,7 +4,6 @@ import { BotKeyboard, ReplyMarkup } from '../bots' import { getMarkedPeerId, MAX_CHANNEL_ID } from '@mtcute/core' import { MtCuteArgumentError, - MtCuteEmptyError, MtCuteTypeAssertionError, } from '../errors' import { TelegramClient } from '../../client' @@ -534,13 +533,18 @@ export class Message { /** * For replies, fetch the message that is being replied. * - * @throws MtCuteArgumentError In case the message is not a reply + * Note that even if a message has {@link replyToMessageId}, + * the message itself may have been deleted, in which case + * this method will also return `null`. */ - getReplyTo(): Promise { + getReplyTo(): Promise { if (!this.replyToMessageId) - throw new MtCuteArgumentError('This message is not a reply!') + return Promise.resolve(null) - return this.client.getMessages(this.chat.inputPeer, this.id, true) + if (this.raw.peerId._ === 'peerChannel') + return this.client.getMessages(this.chat.inputPeer, this.id, true) + + return this.client.getMessagesUnsafe(this.id, true) } /** diff --git a/packages/tl/raw-errors.json b/packages/tl/raw-errors.json index 8154cdfd..f45b6f6b 100644 --- a/packages/tl/raw-errors.json +++ b/packages/tl/raw-errors.json @@ -1 +1 @@ -[{"codes":"400","name":"BAD_REQUEST","description":"The query contains errors. In the event that a request was created using a form and contains user generated data, the user should be notified that the data must be corrected before the query is repeated","base":true},{"codes":"401","name":"UNAUTHORIZED","description":"There was an unauthorized attempt to use functionality available only to authorized users.","base":true},{"codes":"403","name":"FORBIDDEN","description":"Privacy violation. For example, an attempt to write a message to someone who has blacklisted the current user.","base":true},{"codes":"404","name":"NOT_FOUND","description":"An attempt to invoke a non-existent object, such as a method.","base":true},{"codes":"420","name":"FLOOD","description":"The maximum allowed number of attempts to invoke the given methodwith the given input parameters has been exceeded. For example, in anattempt to request a large number of text messages (SMS) for the samephone number.","base":true},{"codes":"303","name":"SEE_OTHER","description":"The request must be repeated, but directed to a different data center","base":true},{"codes":"406","name":"NOT_ACCEPTABLE","description":"Similar to 400 BAD_REQUEST, but the app should not display any error messages to user in UI as a result of this response. The error message will be delivered via updateServiceNotification instead.","base":true},{"codes":"500","name":"INTERNAL","description":"An internal server error occurred while a request was being processed; for example, there was a disruption while accessing a database or file storage.","base":true},{"name":"2FA_CONFIRM_WAIT_X","codes":"420","description":"The account is 2FA protected so it will be deleted in a week. Otherwise it can be reset in {seconds}"},{"name":"ABOUT_TOO_LONG","codes":"400","description":"The provided bio is too long"},{"name":"ACCESS_TOKEN_EXPIRED","codes":"400","description":"Bot token expired"},{"name":"ACCESS_TOKEN_INVALID","codes":"400","description":"The provided token is not valid"},{"name":"ACTIVE_USER_REQUIRED","codes":"401","description":"The method is only available to already activated users"},{"name":"ADMINS_TOO_MUCH","codes":"400","description":"Too many admins"},{"name":"ADMIN_RANK_EMOJI_NOT_ALLOWED","codes":"400","description":"Emoji are not allowed in admin titles or ranks"},{"name":"ADMIN_RANK_INVALID","codes":"400","description":"The given admin title or rank was invalid (possibly larger than 16 characters)"},{"name":"ALBUM_PHOTOS_TOO_MANY","codes":"400","description":"Too many photos were included in the album"},{"name":"API_ID_INVALID","codes":"400","description":"The api_id/api_hash combination is invalid"},{"name":"API_ID_PUBLISHED_FLOOD","codes":"400","description":"This API id was published somewhere, you can't use it now"},{"name":"ARTICLE_TITLE_EMPTY","codes":"400","description":"The title of the article is empty"},{"name":"AUDIO_TITLE_EMPTY","codes":"400","description":"The title attribute of the audio must be non-empty"},{"name":"AUDIO_CONTENT_URL_EMPTY","codes":"400","description":""},{"name":"AUTH_BYTES_INVALID","codes":"400","description":"The provided authorization is invalid"},{"name":"AUTH_KEY_DUPLICATED","codes":"406","description":"The authorization key (session file) was used under two different IP addresses simultaneously, and can no longer be used. Use the same session exclusively, or use different sessions"},{"name":"AUTH_KEY_INVALID","codes":"401","description":"The key is invalid"},{"name":"AUTH_KEY_PERM_EMPTY","codes":"401","description":"The method is unavailable for temporary authorization key, not bound to permanent"},{"name":"AUTH_KEY_UNREGISTERED","codes":"401","description":"The key is not registered in the system"},{"name":"AUTH_RESTART","codes":"500","description":"Restart the authorization process"},{"name":"AUTH_TOKEN_ALREADY_ACCEPTED","codes":"400","description":"The authorization token was already used"},{"name":"AUTH_TOKEN_EXPIRED","codes":"400","description":"The provided authorization token has expired and the updated QR-code must be re-scanned"},{"name":"AUTH_TOKEN_INVALID","codes":"400","description":"An invalid authorization token was provided"},{"name":"AUTOARCHIVE_NOT_AVAILABLE","codes":"400","description":"You cannot use this feature yet"},{"name":"BANK_CARD_NUMBER_INVALID","codes":"400","description":"Incorrect credit card number"},{"name":"BASE_PORT_LOC_INVALID","codes":"400","description":"Base port location invalid"},{"name":"BANNED_RIGHTS_INVALID","codes":"400","description":"You cannot use that set of permissions in this request, i.e. restricting view_messages as a default"},{"name":"BOTS_TOO_MUCH","codes":"400","description":"There are too many bots in this chat/channel"},{"name":"BOT_CHANNELS_NA","codes":"400","description":"Bots can't edit admin privileges"},{"name":"BOT_COMMAND_DESCRIPTION_INVALID","codes":"400","description":"The command description was empty, too long or had invalid characters used"},{"name":"BOT_COMMAND_INVALID","codes":"400","description":""},{"name":"BOT_DOMAIN_INVALID","codes":"400","description":"The domain used for the auth button does not match the one configured in @BotFather"},{"name":"BOT_GAMES_DISABLED","codes":"400","description":"Bot games cannot be used in this type of chat"},{"name":"BOT_GROUPS_BLOCKED","codes":"400","description":"This bot can't be added to groups"},{"name":"BOT_INLINE_DISABLED","codes":"400","description":"This bot can't be used in inline mode"},{"name":"BOT_INVALID","codes":"400","description":"This is not a valid bot"},{"name":"BOT_METHOD_INVALID","codes":"400","description":"The API access for bot users is restricted. The method you tried to invoke cannot be executed as a bot"},{"name":"BOT_MISSING","codes":"400","description":"This method can only be run by a bot"},{"name":"BOT_PAYMENTS_DISABLED","codes":"400","description":"This method can only be run by a bot"},{"name":"BOT_POLLS_DISABLED","codes":"400","description":"You cannot create polls under a bot account"},{"name":"BOT_RESPONSE_TIMEOUT","codes":"400","description":"The bot did not answer to the callback query in time"},{"name":"BROADCAST_CALLS_DISABLED","codes":"400","description":""},{"name":"BROADCAST_FORBIDDEN","codes":"403","description":"The request cannot be used in broadcast channels"},{"name":"BROADCAST_ID_INVALID","codes":"400","description":"The channel is invalid"},{"name":"BROADCAST_PUBLIC_VOTERS_FORBIDDEN","codes":"400","description":"You cannot broadcast polls where the voters are public"},{"name":"BROADCAST_REQUIRED","codes":"400","description":"The request can only be used with a broadcast channel"},{"name":"BUTTON_DATA_INVALID","codes":"400","description":"The provided button data is invalid"},{"name":"BUTTON_TYPE_INVALID","codes":"400","description":"The type of one of the buttons you provided is invalid"},{"name":"BUTTON_URL_INVALID","codes":"400","description":"Button URL invalid"},{"name":"CALL_ALREADY_ACCEPTED","codes":"400","description":"The call was already accepted"},{"name":"CALL_ALREADY_DECLINED","codes":"400","description":"The call was already declined"},{"name":"CALL_OCCUPY_FAILED","codes":"500","description":"The call failed because the user is already making another call"},{"name":"CALL_PEER_INVALID","codes":"400","description":"The provided call peer object is invalid"},{"name":"CALL_PROTOCOL_FLAGS_INVALID","codes":"400","description":"Call protocol flags invalid"},{"name":"CDN_METHOD_INVALID","codes":"400","description":"This method cannot be invoked on a CDN server. Refer to https://core.telegram.org/cdn#schema for available methods"},{"name":"CHANNELS_ADMIN_PUBLIC_TOO_MUCH","codes":"400","description":"You're admin of too many public channels, make some channels private to change the username of this channel"},{"name":"CHANNELS_TOO_MUCH","codes":"400","description":"You have joined too many channels/supergroups"},{"name":"CHANNEL_BANNED","codes":"400","description":"The channel is banned"},{"name":"CHANNEL_INVALID","codes":"400","description":"Invalid channel object. Make sure to pass the right types, for instance making sure that the request is designed for channels or otherwise look for a different one more suited"},{"name":"CHANNEL_PRIVATE","codes":"400","description":"The channel specified is private and you lack permission to access it. Another reason may be that you were banned from it"},{"name":"CHANNEL_PUBLIC_GROUP_NA","codes":"403","description":"channel/supergroup not available"},{"name":"CHAT_ABOUT_NOT_MODIFIED","codes":"400","description":"About text has not changed"},{"name":"CHAT_ABOUT_TOO_LONG","codes":"400","description":"Chat about too long"},{"name":"CHAT_ADMIN_INVITE_REQUIRED","codes":"403","description":"You do not have the rights to do this"},{"name":"CHAT_ADMIN_REQUIRED","codes":"400","description":"Chat admin privileges are required to do that in the specified chat (for example, to send a message in a channel which is not yours), or invalid permissions used for the channel or group"},{"name":"CHAT_FORBIDDEN","codes":"403","description":"You cannot write in this chat"},{"name":"CHAT_ID_EMPTY","codes":"400","description":"The provided chat ID is empty"},{"name":"CHAT_ID_INVALID","codes":"400","description":"Invalid object ID for a chat. Make sure to pass the right types, for instance making sure that the request is designed for chats (not channels/megagroups) or otherwise look for a different one more suited\\nAn example working with a megagroup and AddChatUserRequest, it will fail because megagroups are channels. Use InviteToChannelRequest instead"},{"name":"CHAT_INVALID","codes":"400","description":"The chat is invalid for this request"},{"name":"CHAT_LINK_EXISTS","codes":"400","description":"The chat is linked to a channel and cannot be used in that request"},{"name":"CHAT_NOT_MODIFIED","codes":"400","description":"The chat or channel wasn't modified (title, invites, username, admins, etc. are the same)"},{"name":"CHAT_RESTRICTED","codes":"400","description":"The chat is restricted and cannot be used in that request"},{"name":"CHAT_SEND_GIFS_FORBIDDEN","codes":"403","description":"You can't send gifs in this chat"},{"name":"CHAT_SEND_INLINE_FORBIDDEN","codes":"400","description":"You cannot send inline results in this chat"},{"name":"CHAT_SEND_MEDIA_FORBIDDEN","codes":"403","description":"You can't send media in this chat"},{"name":"CHAT_SEND_STICKERS_FORBIDDEN","codes":"403","description":"You can't send stickers in this chat"},{"name":"CHAT_TITLE_EMPTY","codes":"400","description":"No chat title provided"},{"name":"CHAT_WRITE_FORBIDDEN","codes":"403","description":"You can't write in this chat"},{"name":"CHP_CALL_FAIL","codes":"500","description":"The statistics cannot be retrieved at this time"},{"name":"CODE_EMPTY","codes":"400","description":"The provided code is empty"},{"name":"CODE_HASH_INVALID","codes":"400","description":"Code hash invalid"},{"name":"CODE_INVALID","codes":"400","description":"Code invalid (i.e. from email)"},{"name":"CONNECTION_API_ID_INVALID","codes":"400","description":"The provided API id is invalid"},{"name":"CONNECTION_DEVICE_MODEL_EMPTY","codes":"400","description":"Device model empty"},{"name":"CONNECTION_LANG_PACK_INVALID","codes":"400","description":"The specified language pack is not valid. This is meant to be used by official applications only so far, leave it empty"},{"name":"CONNECTION_LAYER_INVALID","codes":"400","description":"The very first request must always be InvokeWithLayerRequest"},{"name":"CONNECTION_NOT_INITED","codes":"400","description":"Connection not initialized"},{"name":"CONNECTION_SYSTEM_EMPTY","codes":"400","description":"Connection system empty"},{"name":"CONNECTION_SYSTEM_LANG_CODE_EMPTY","codes":"400","description":"The system language string was empty during connection"},{"name":"CONTACT_ID_INVALID","codes":"400","description":"The provided contact ID is invalid"},{"name":"CONTACT_NAME_EMPTY","codes":"400","description":"The provided contact name cannot be empty"},{"name":"DATA_INVALID","codes":"400","description":"Encrypted data invalid"},{"name":"DATA_JSON_INVALID","codes":"400","description":"The provided JSON data is invalid"},{"name":"DATE_EMPTY","codes":"400","description":"Date empty"},{"name":"DC_ID_INVALID","codes":"400","description":"This occurs when an authorization is tried to be exported for the same data center one is currently connected to"},{"name":"DH_G_A_INVALID","codes":"400","description":"g_a invalid"},{"name":"DOCUMENT_INVALID","codes":"400","description":"The document file was invalid and can't be used in inline mode"},{"name":"EMAIL_HASH_EXPIRED","codes":"400","description":"The email hash expired and cannot be used to verify it"},{"name":"EMAIL_INVALID","codes":"400","description":"The given email is invalid"},{"name":"EMAIL_UNCONFIRMED_X","codes":"400","description":"Email unconfirmed, the length of the code must be {code_length}"},{"name":"EMOTICON_EMPTY","codes":"400","description":"The emoticon field cannot be empty"},{"name":"EMOTICON_INVALID","codes":"400","description":"The specified emoticon cannot be used or was not a emoticon"},{"name":"EMOTICON_STICKERPACK_MISSING","codes":"400","description":"The emoticon sticker pack you are trying to get is missing"},{"name":"ENCRYPTED_MESSAGE_INVALID","codes":"400","description":"Encrypted message invalid"},{"name":"ENCRYPTION_ALREADY_ACCEPTED","codes":"400","description":"Secret chat already accepted"},{"name":"ENCRYPTION_ALREADY_DECLINED","codes":"400","description":"The secret chat was already declined"},{"name":"ENCRYPTION_DECLINED","codes":"400","description":"The secret chat was declined"},{"name":"ENCRYPTION_ID_INVALID","codes":"400","description":"The provided secret chat ID is invalid"},{"name":"ENCRYPTION_OCCUPY_FAILED","codes":"500","description":"TDLib developer claimed it is not an error while accepting secret chats and 500 is used instead of 420"},{"name":"ENTITIES_TOO_LONG","codes":"400","description":"It is no longer possible to send such long data inside entity tags (for example inline text URLs)"},{"name":"ENTITY_MENTION_USER_INVALID","codes":"400","description":"You can't use this entity"},{"name":"ERROR_TEXT_EMPTY","codes":"400","description":"The provided error message is empty"},{"name":"EXPIRE_FORBIDDEN","codes":"400","description":""},{"name":"EXPORT_CARD_INVALID","codes":"400","description":"Provided card is invalid"},{"name":"EXTERNAL_URL_INVALID","codes":"400","description":"External URL invalid"},{"name":"FIELD_NAME_EMPTY","codes":"400","description":"The field with the name FIELD_NAME is missing"},{"name":"FIELD_NAME_INVALID","codes":"400","description":"The field with the name FIELD_NAME is invalid"},{"name":"FILEREF_UPGRADE_NEEDED","codes":"406","description":"The file reference needs to be refreshed before being used again"},{"name":"FILE_ID_INVALID","codes":"400","description":"The provided file id is invalid. Make sure all parameters are present, have the correct type and are not empty (ID, access hash, file reference, thumb size ...)"},{"name":"FILE_MIGRATE_X","codes":"303","description":"The file to be accessed is currently stored in DC {new_dc}"},{"name":"FILE_PARTS_INVALID","codes":"400","description":"The number of file parts is invalid"},{"name":"FILE_PART_0_MISSING","codes":"400","description":"File part 0 missing"},{"name":"FILE_PART_EMPTY","codes":"400","description":"The provided file part is empty"},{"name":"FILE_PART_INVALID","codes":"400","description":"The file part number is invalid"},{"name":"FILE_PART_LENGTH_INVALID","codes":"400","description":"The length of a file part is invalid"},{"name":"FILE_PART_SIZE_CHANGED","codes":"400","description":"The file part size (chunk size) cannot change during upload"},{"name":"FILE_PART_SIZE_INVALID","codes":"400","description":"The provided file part size is invalid"},{"name":"FILE_PART_X_MISSING","codes":"400","description":"Part {which} of the file is missing from storage"},{"name":"FILE_REFERENCE_EMPTY","codes":"400","description":"The file reference must exist to access the media and it cannot be empty"},{"name":"FILE_REFERENCE_EXPIRED","codes":"400","description":"The file reference has expired and is no longer valid or it belongs to self-destructing media and cannot be resent"},{"name":"FILE_REFERENCE_INVALID","codes":"400","description":"The file reference is invalid or you can't do that operation on such message"},{"name":"FIRSTNAME_INVALID","codes":"400","description":"The first name is invalid"},{"name":"FLOOD_TEST_PHONE_WAIT_X","codes":"420","description":"A wait of {seconds} seconds is required in the test servers"},{"name":"FLOOD_WAIT_X","codes":"420","description":"A wait of {seconds} seconds is required"},{"name":"FOLDER_ID_EMPTY","codes":"400","description":"The folder you tried to delete was already empty"},{"name":"FOLDER_ID_INVALID","codes":"400","description":"The folder you tried to use was not valid"},{"name":"FRESH_CHANGE_ADMINS_FORBIDDEN","codes":"400","description":"Recently logged-in users cannot add or change admins"},{"name":"FRESH_CHANGE_PHONE_FORBIDDEN","codes":"406","description":"Recently logged-in users cannot use this request"},{"name":"FRESH_RESET_AUTHORISATION_FORBIDDEN","codes":"406","description":"The current session is too new and cannot be used to reset other authorisations yet"},{"name":"FROM_PEER_INVALID","codes":"400","description":"The given from_user peer cannot be used for the parameter"},{"name":"GAME_BOT_INVALID","codes":"400","description":"You cannot send that game with the current bot"},{"name":"GIF_CONTENT_TYPE_INVALID","codes":"400","description":""},{"name":"GIF_ID_INVALID","codes":"400","description":"The provided GIF ID is invalid"},{"name":"GRAPH_INVALID_RELOAD","codes":"400","description":""},{"name":"GRAPH_OUTDATED_RELOAD","codes":"400","description":"Data can't be used for the channel statistics, graphs outdated"},{"name":"GROUPCALL_FORBIDDEN","codes":"403","description":""},{"name":"GROUPCALL_JOIN_MISSING","codes":"400","description":""},{"name":"GROUPCALL_SSRC_DUPLICATE_MUCH","codes":"400","description":""},{"name":"GROUPCALL_NOT_MODIFIED","codes":"400","description":""},{"name":"GROUPED_MEDIA_INVALID","codes":"400","description":"Invalid grouped media"},{"name":"GROUP_CALL_INVALID","codes":"400","description":"Group call invalid"},{"name":"HASH_INVALID","codes":"400","description":"The provided hash is invalid"},{"name":"HISTORY_GET_FAILED","codes":"500","description":"Fetching of history failed"},{"name":"IMAGE_PROCESS_FAILED","codes":"400","description":"Failure while processing image"},{"name":"IMPORT_FILE_INVALID","codes":"400","description":"The file is too large to be imported"},{"name":"IMPORT_FORMAT_UNRECOGNIZED","codes":"400","description":"Unknown import format"},{"name":"IMPORT_ID_INVALID","codes":"400","description":""},{"name":"INLINE_BOT_REQUIRED","codes":"403","description":"The action must be performed through an inline bot callback"},{"name":"INLINE_RESULT_EXPIRED","codes":"400","description":"The inline query expired"},{"name":"INPUT_CONSTRUCTOR_INVALID","codes":"400","description":"The provided constructor is invalid"},{"name":"INPUT_FETCH_ERROR","codes":"400","description":"An error occurred while deserializing TL parameters"},{"name":"INPUT_FETCH_FAIL","codes":"400","description":"Failed deserializing TL payload"},{"name":"INPUT_FILTER_INVALID","codes":"400","description":"The search query filter is invalid"},{"name":"INPUT_LAYER_INVALID","codes":"400","description":"The provided layer is invalid"},{"name":"INPUT_METHOD_INVALID","codes":"400","description":"The invoked method does not exist anymore or has never existed"},{"name":"INPUT_REQUEST_TOO_LONG","codes":"400","description":"The input request was too long. This may be a bug in the library as it can occur when serializing more bytes than it should (like appending the vector constructor code at the end of a message)"},{"name":"INPUT_USER_DEACTIVATED","codes":"400","description":"The specified user was deleted"},{"name":"INTERDC_X_CALL_ERROR","codes":"500","description":"An error occurred while communicating with DC {dc}"},{"name":"INTERDC_X_CALL_RICH_ERROR","codes":"500","description":"A rich error occurred while communicating with DC {dc}"},{"name":"INVITE_HASH_EMPTY","codes":"400","description":"The invite hash is empty"},{"name":"INVITE_HASH_EXPIRED","codes":"400","description":"The chat the user tried to join has expired and is not valid anymore"},{"name":"INVITE_HASH_INVALID","codes":"400","description":"The invite hash is invalid"},{"name":"LANG_PACK_INVALID","codes":"400","description":"The provided language pack is invalid"},{"name":"LASTNAME_INVALID","codes":"400","description":"The last name is invalid"},{"name":"LIMIT_INVALID","codes":"400","description":"An invalid limit was provided. See https://core.telegram.org/api/files#downloading-files"},{"name":"LINK_NOT_MODIFIED","codes":"400","description":"The channel is already linked to this group"},{"name":"LOCATION_INVALID","codes":"400","description":"The location given for a file was invalid. See https://core.telegram.org/api/files#downloading-files"},{"name":"MAX_ID_INVALID","codes":"400","description":"The provided max ID is invalid"},{"name":"MAX_QTS_INVALID","codes":"400","description":"The provided QTS were invalid"},{"name":"MD5_CHECKSUM_INVALID","codes":"400","description":"The MD5 check-sums do not match"},{"name":"MEDIA_CAPTION_TOO_LONG","codes":"400","description":"The caption is too long"},{"name":"MEDIA_EMPTY","codes":"400","description":"The provided media object is invalid or the current account may not be able to send it (such as games as users)"},{"name":"MEDIA_GROUPED_INVALID","codes":"400","description":""},{"name":"MEDIA_INVALID","codes":"400","description":"Media invalid"},{"name":"MEDIA_NEW_INVALID","codes":"400","description":"The new media to edit the message with is invalid (such as stickers or voice notes)"},{"name":"MEDIA_PREV_INVALID","codes":"400","description":"The old media cannot be edited with anything else (such as stickers or voice notes)"},{"name":"MEDIA_TTL_INVALID","codes":"400","description":""},{"name":"MEGAGROUP_ID_INVALID","codes":"400","description":"The group is invalid"},{"name":"MEGAGROUP_PREHISTORY_HIDDEN","codes":"400","description":"You can't set this discussion group because it's history is hidden"},{"name":"MEGAGROUP_REQUIRED","codes":"400","description":"The request can only be used with a megagroup channel"},{"name":"MEMBER_NO_LOCATION","codes":"500","description":"An internal failure occurred while fetching user info (couldn't find location)"},{"name":"MEMBER_OCCUPY_PRIMARY_LOC_FAILED","codes":"500","description":"Occupation of primary member location failed"},{"name":"MESSAGE_AUTHOR_REQUIRED","codes":"403","description":"Message author required"},{"name":"MESSAGE_DELETE_FORBIDDEN","codes":"403","description":"You can't delete one of the messages you tried to delete, most likely because it is a service message."},{"name":"MESSAGE_EDIT_TIME_EXPIRED","codes":"400","description":"You can't edit this message anymore, too much time has passed since its creation."},{"name":"MESSAGE_EMPTY","codes":"400","description":"Empty or invalid UTF-8 message was sent"},{"name":"MESSAGE_IDS_EMPTY","codes":"400","description":"No message ids were provided"},{"name":"MESSAGE_ID_INVALID","codes":"400","description":"The specified message ID is invalid or you can't do that operation on such message"},{"name":"MESSAGE_NOT_MODIFIED","codes":"400","description":"Content of the message was not modified"},{"name":"MESSAGE_POLL_CLOSED","codes":"400","description":"The poll was closed and can no longer be voted on"},{"name":"MESSAGE_TOO_LONG","codes":"400","description":"Message was too long. Current maximum length is 4096 UTF-8 characters"},{"name":"METHOD_INVALID","codes":"400","description":"The API method is invalid and cannot be used"},{"name":"MSGID_DECREASE_RETRY","codes":"500","description":"The request should be retried with a lower message ID"},{"name":"MSG_ID_INVALID","codes":"400","description":"The message ID used in the peer was invalid"},{"name":"MSG_WAIT_FAILED","codes":"400","description":"A waiting call returned an error"},{"name":"MT_SEND_QUEUE_TOO_LONG","codes":"500","description":""},{"name":"MULTI_MEDIA_TOO_LONG","codes":"400","description":"Too many media files were included in the same album"},{"name":"NEED_CHAT_INVALID","codes":"500","description":"The provided chat is invalid"},{"name":"NEED_MEMBER_INVALID","codes":"500","description":"The provided member is invalid or does not exist (for example a thumb size)"},{"name":"NETWORK_MIGRATE_X","codes":"303","description":"The source IP address is associated with DC {new_dc}"},{"name":"NEW_SALT_INVALID","codes":"400","description":"The new salt is invalid"},{"name":"NEW_SETTINGS_INVALID","codes":"400","description":"The new settings are invalid"},{"name":"NEXT_OFFSET_INVALID","codes":"400","description":"The value for next_offset is invalid. Check that it has normal characters and is not too long"},{"name":"OFFSET_INVALID","codes":"400","description":"The given offset was invalid, it must be divisible by 1KB. See https://core.telegram.org/api/files#downloading-files"},{"name":"OFFSET_PEER_ID_INVALID","codes":"400","description":"The provided offset peer is invalid"},{"name":"OPTIONS_TOO_MUCH","codes":"400","description":"You defined too many options for the poll"},{"name":"OPTION_INVALID","codes":"400","description":"The option specified is invalid and does not exist in the target poll"},{"name":"PACK_SHORT_NAME_INVALID","codes":"400","description":"Invalid sticker pack name. It must begin with a letter, can't contain consecutive underscores and must end in \"_by_\"."},{"name":"PACK_SHORT_NAME_OCCUPIED","codes":"400","description":"A stickerpack with this name already exists"},{"name":"PARTICIPANTS_TOO_FEW","codes":"400","description":"Not enough participants"},{"name":"PARTICIPANT_CALL_FAILED","codes":"500","description":"Failure while making call"},{"name":"PARTICIPANT_JOIN_MISSING","codes":"403","description":""},{"name":"PARTICIPANT_VERSION_OUTDATED","codes":"400","description":"The other participant does not use an up to date telegram client with support for calls"},{"name":"PASSWORD_EMPTY","codes":"400","description":"The provided password is empty"},{"name":"PASSWORD_HASH_INVALID","codes":"400","description":"The password (and thus its hash value) you entered is invalid"},{"name":"PASSWORD_MISSING","codes":"400","description":"The account must have 2-factor authentication enabled (a password) before this method can be used"},{"name":"PASSWORD_REQUIRED","codes":"400","description":"The account must have 2-factor authentication enabled (a password) before this method can be used"},{"name":"PASSWORD_TOO_FRESH_X","codes":"400","description":"The password was added too recently and {seconds} seconds must pass before using the method"},{"name":"PAYMENT_PROVIDER_INVALID","codes":"400","description":"The payment provider was not recognised or its token was invalid"},{"name":"PEER_FLOOD","codes":"400","description":"Too many requests"},{"name":"PEER_ID_INVALID","codes":"400","description":"An invalid Peer was used. Make sure to pass the right peer type and that the value is valid (for instance, bots cannot start conversations)"},{"name":"PEER_ID_NOT_SUPPORTED","codes":"400","description":"The provided peer ID is not supported"},{"name":"PERSISTENT_TIMESTAMP_EMPTY","codes":"400","description":"Persistent timestamp empty"},{"name":"PERSISTENT_TIMESTAMP_INVALID","codes":"400","description":"Persistent timestamp invalid"},{"name":"PERSISTENT_TIMESTAMP_OUTDATED","codes":"500","description":"Persistent timestamp outdated"},{"name":"PHONE_CODE_EMPTY","codes":"400","description":"The phone code is missing"},{"name":"PHONE_CODE_EXPIRED","codes":"400","description":"The confirmation code has expired"},{"name":"PHONE_CODE_HASH_EMPTY","codes":"400","description":"The phone code hash is missing"},{"name":"PHONE_CODE_INVALID","codes":"400","description":"The phone code entered was invalid"},{"name":"PHONE_MIGRATE_X","codes":"303","description":"The phone number a user is trying to use for authorization is associated with DC {new_dc}"},{"name":"PHONE_NUMBER_APP_SIGNUP_FORBIDDEN","codes":"400","description":"You can't sign up using this app"},{"name":"PHONE_NUMBER_BANNED","codes":"400","description":"The used phone number has been banned from Telegram and cannot be used anymore. Maybe check https://www.telegram.org/faq_spam"},{"name":"PHONE_NUMBER_FLOOD","codes":"400","description":"You asked for the code too many times."},{"name":"PHONE_NUMBER_INVALID","codes":"400 406","description":"The phone number is invalid"},{"name":"PHONE_NUMBER_OCCUPIED","codes":"400","description":"The phone number is already in use"},{"name":"PHONE_NUMBER_UNOCCUPIED","codes":"400","description":"The phone number is not yet being used"},{"name":"PHONE_PASSWORD_FLOOD","codes":"406","description":"You have tried logging in too many times"},{"name":"PHONE_PASSWORD_PROTECTED","codes":"400","description":"This phone is password protected"},{"name":"PHOTO_CONTENT_TYPE_INVALID","codes":"400","description":""},{"name":"PHOTO_CONTENT_URL_EMPTY","codes":"400","description":"The content from the URL used as a photo appears to be empty or has caused another HTTP error"},{"name":"PHOTO_CROP_SIZE_SMALL","codes":"400","description":"Photo is too small"},{"name":"PHOTO_EXT_INVALID","codes":"400","description":"The extension of the photo is invalid"},{"name":"PHOTO_ID_INVALID","codes":"400","description":"Photo id is invalid"},{"name":"PHOTO_INVALID","codes":"400","description":"Photo invalid"},{"name":"PHOTO_INVALID_DIMENSIONS","codes":"400","description":"The photo dimensions are invalid (hint: `pip install pillow` for `send_file` to resize images)"},{"name":"PHOTO_SAVE_FILE_INVALID","codes":"400","description":"The photo you tried to send cannot be saved by Telegram. A reason may be that it exceeds 10MB. Try resizing it locally"},{"name":"PHOTO_THUMB_URL_EMPTY","codes":"400","description":"The URL used as a thumbnail appears to be empty or has caused another HTTP error"},{"name":"PIN_RESTRICTED","codes":"400","description":"You can't pin messages in private chats with other people"},{"name":"POLL_ANSWERS_INVALID","codes":"400","description":"The poll did not have enough answers or had too many"},{"name":"POLL_OPTION_DUPLICATE","codes":"400","description":"A duplicate option was sent in the same poll"},{"name":"POLL_OPTION_INVALID","codes":"400","description":"A poll option used invalid data (the data may be too long)"},{"name":"POLL_QUESTION_INVALID","codes":"400","description":"The poll question was either empty or too long"},{"name":"POLL_UNSUPPORTED","codes":"400","description":"This layer does not support polls in the issued method"},{"name":"PREVIOUS_CHAT_IMPORT_ACTIVE_WAIT_XMIN","codes":"406","description":"Similar to a flood wait, must wait {minutes} minutes"},{"name":"PRIVACY_KEY_INVALID","codes":"400","description":"The privacy key is invalid"},{"name":"PRIVACY_TOO_LONG","codes":"400","description":"Cannot add that many entities in a single request"},{"name":"PRIVACY_VALUE_INVALID","codes":"400","description":"The privacy value is invalid"},{"name":"PTS_CHANGE_EMPTY","codes":"500","description":"No PTS change"},{"name":"QUERY_ID_EMPTY","codes":"400","description":"The query ID is empty"},{"name":"QUERY_ID_INVALID","codes":"400","description":"The query ID is invalid"},{"name":"QUERY_TOO_SHORT","codes":"400","description":"The query string is too short"},{"name":"QUIZ_CORRECT_ANSWERS_EMPTY","codes":"400","description":"A quiz must specify one correct answer"},{"name":"QUIZ_CORRECT_ANSWERS_TOO_MUCH","codes":"400","description":"There can only be one correct answer"},{"name":"QUIZ_CORRECT_ANSWER_INVALID","codes":"400","description":"The correct answer is not an existing answer"},{"name":"QUIZ_MULTIPLE_INVALID","codes":"400","description":"A poll cannot be both multiple choice and quiz"},{"name":"RANDOM_ID_DUPLICATE","codes":"500","description":"You provided a random ID that was already used"},{"name":"RANDOM_ID_INVALID","codes":"400","description":"A provided random ID is invalid"},{"name":"RANDOM_LENGTH_INVALID","codes":"400","description":"Random length invalid"},{"name":"RANGES_INVALID","codes":"400","description":"Invalid range provided"},{"name":"REACTION_EMPTY","codes":"400","description":"No reaction provided"},{"name":"REACTION_INVALID","codes":"400","description":"Invalid reaction provided (only emoji are allowed)"},{"name":"REFLECTOR_NOT_AVAILABLE","codes":"400","description":"Invalid call reflector server"},{"name":"REG_ID_GENERATE_FAILED","codes":"500","description":"Failure while generating registration ID"},{"name":"REPLY_MARKUP_GAME_EMPTY","codes":"400","description":"The provided reply markup for the game is empty"},{"name":"REPLY_MARKUP_INVALID","codes":"400","description":"The provided reply markup is invalid"},{"name":"REPLY_MARKUP_TOO_LONG","codes":"400","description":"The data embedded in the reply markup buttons was too much"},{"name":"RESULTS_TOO_MUCH","codes":"400","description":"You sent too many results, see https://core.telegram.org/bots/api#answerinlinequery for the current limit"},{"name":"RESULT_ID_DUPLICATE","codes":"400","description":"Duplicated IDs on the sent results. Make sure to use unique IDs"},{"name":"RESULT_ID_INVALID","codes":"400","description":"The given result cannot be used to send the selection to the bot"},{"name":"RESULT_TYPE_INVALID","codes":"400","description":"Result type invalid"},{"name":"RIGHT_FORBIDDEN","codes":"403","description":"Either your admin rights do not allow you to do this or you passed the wrong rights combination (some rights only apply to channels and vice versa)"},{"name":"RPC_CALL_FAIL","codes":"500","description":"Telegram is having internal issues, please try again later."},{"name":"RPC_MCGET_FAIL","codes":"500","description":"Telegram is having internal issues, please try again later."},{"name":"RSA_DECRYPT_FAILED","codes":"400","description":"Internal RSA decryption failed"},{"name":"SCHEDULE_BOT_NOT_ALLOWED","codes":"400","description":"Bots are not allowed to schedule messages"},{"name":"SCHEDULE_DATE_INVALID","codes":"400","description":""},{"name":"SCHEDULE_DATE_TOO_LATE","codes":"400","description":"The date you tried to schedule is too far in the future (last known limit of 1 year and a few hours)"},{"name":"SCHEDULE_STATUS_PRIVATE","codes":"400","description":"You cannot schedule a message until the person comes online if their privacy does not show this information"},{"name":"SCHEDULE_TOO_MUCH","codes":"400","description":"You cannot schedule more messages in this chat (last known limit of 100 per chat)"},{"name":"SEARCH_QUERY_EMPTY","codes":"400","description":"The search query is empty"},{"name":"SECONDS_INVALID","codes":"400","description":"Slow mode only supports certain values (e.g. 0, 10s, 30s, 1m, 5m, 15m and 1h)"},{"name":"SEND_MESSAGE_MEDIA_INVALID","codes":"400","description":"The message media was invalid or not specified"},{"name":"SEND_MESSAGE_TYPE_INVALID","codes":"400","description":"The message type is invalid"},{"name":"SENSITIVE_CHANGE_FORBIDDEN","codes":"403","description":"Your sensitive content settings cannot be changed at this time"},{"name":"SESSION_EXPIRED","codes":"401","description":"The authorization has expired"},{"name":"SESSION_PASSWORD_NEEDED","codes":"401","description":"Two-steps verification is enabled and a password is required"},{"name":"SESSION_REVOKED","codes":"401","description":"The authorization has been invalidated, because of the user terminating all sessions"},{"name":"SESSION_TOO_FRESH_X","codes":"400","description":"The session logged in too recently and {seconds} seconds must pass before calling the method"},{"name":"SHA256_HASH_INVALID","codes":"400","description":"The provided SHA256 hash is invalid"},{"name":"SHORTNAME_OCCUPY_FAILED","codes":"400","description":"An error occurred when trying to register the short-name used for the sticker pack. Try a different name"},{"name":"SLOWMODE_WAIT_X","codes":"420","description":"A wait of {seconds} seconds is required before sending another message in this chat"},{"name":"SRP_ID_INVALID","codes":"400","description":""},{"name":"START_PARAM_EMPTY","codes":"400","description":"The start parameter is empty"},{"name":"START_PARAM_INVALID","codes":"400","description":"Start parameter invalid"},{"name":"STATS_MIGRATE_X","codes":"303","description":"The channel statistics must be fetched from DC {dc}"},{"name":"STICKERSET_INVALID","codes":"400","description":"The provided sticker set is invalid"},{"name":"STICKERSET_OWNER_ANONYMOUS","codes":"406","description":"This sticker set can't be used as the group's official stickers because it was created by one of its anonymous admins"},{"name":"STICKERS_EMPTY","codes":"400","description":"No sticker provided"},{"name":"STICKER_DOCUMENT_INVALID","codes":"400","description":"The sticker file was invalid (this file has failed Telegram internal checks, make sure to use the correct format and comply with https://core.telegram.org/animated_stickers)"},{"name":"STICKER_EMOJI_INVALID","codes":"400","description":"Sticker emoji invalid"},{"name":"STICKER_FILE_INVALID","codes":"400","description":"Sticker file invalid"},{"name":"STICKER_ID_INVALID","codes":"400","description":"The provided sticker ID is invalid"},{"name":"STICKER_INVALID","codes":"400","description":"The provided sticker is invalid"},{"name":"STICKER_PNG_DIMENSIONS","codes":"400","description":"Sticker png dimensions invalid"},{"name":"STICKER_PNG_NOPNG","codes":"400","description":"Stickers must be a png file but the used image was not a png"},{"name":"STICKER_TGS_NODOC","codes":"400","description":""},{"name":"STICKER_TGS_NOTGS","codes":"400","description":"Stickers must be a tgs file but the used file was not a tgs"},{"name":"STICKER_THUMB_PNG_NOPNG","codes":"400","description":"Stickerset thumb must be a png file but the used file was not png"},{"name":"STICKER_THUMB_TGS_NOTGS","codes":"400","description":"Stickerset thumb must be a tgs file but the used file was not tgs"},{"name":"STORAGE_CHECK_FAILED","codes":"500","description":"Server storage check failed"},{"name":"STORE_INVALID_SCALAR_TYPE","codes":"500","description":""},{"name":"TAKEOUT_INIT_DELAY_X","codes":"420","description":"A wait of {seconds} seconds is required before being able to initiate the takeout"},{"name":"TAKEOUT_INVALID","codes":"400","description":"The takeout session has been invalidated by another data export session"},{"name":"TAKEOUT_REQUIRED","codes":"400","description":"You must initialize a takeout request first"},{"name":"TEMP_AUTH_KEY_EMPTY","codes":"400","description":"No temporary auth key provided"},{"name":"TIMEOUT","codes":"500","description":"A timeout occurred while fetching data from the worker"},{"name":"THEME_INVALID","codes":"400","description":"Theme invalid"},{"name":"THEME_MIME_INVALID","codes":"400","description":"You cannot create this theme, the mime-type is invalid"},{"name":"TMP_PASSWORD_DISABLED","codes":"400","description":"The temporary password is disabled"},{"name":"TMP_PASSWORD_INVALID","codes":"400","description":"Password auth needs to be regenerated"},{"name":"TOKEN_INVALID","codes":"400","description":"The provided token is invalid"},{"name":"TTL_DAYS_INVALID","codes":"400","description":"The provided TTL is invalid"},{"name":"TTL_PERIOD_INVALID","codes":"400","description":"The provided TTL Period is invalid"},{"name":"TYPES_EMPTY","codes":"400","description":"The types field is empty"},{"name":"TYPE_CONSTRUCTOR_INVALID","codes":"400","description":"The type constructor is invalid"},{"name":"UNKNOWN_METHOD","codes":"500","description":"The method you tried to call cannot be called on non-CDN DCs"},{"name":"UNTIL_DATE_INVALID","codes":"400","description":"That date cannot be specified in this request (try using None)"},{"name":"URL_INVALID","codes":"400","description":"The URL used was invalid (e.g. when answering a callback with a URL that's not t.me/yourbot or your game's URL)"},{"name":"USER_VOLUME_INVALID","codes":"400","description":""},{"name":"USERNAME_INVALID","codes":"400","description":"Nobody is using this username, or the username is unacceptable. If the latter, it must match r\"[a-zA-Z][\\w\\d]{3,30}[a-zA-Z\\d]\""},{"name":"USERNAME_NOT_MODIFIED","codes":"400","description":"The username is not different from the current username"},{"name":"USERNAME_NOT_OCCUPIED","codes":"400","description":"The username is not in use by anyone else yet"},{"name":"USERNAME_OCCUPIED","codes":"400","description":"The username is already taken"},{"name":"USERS_TOO_FEW","codes":"400","description":"Not enough users (to create a chat, for example)"},{"name":"USERS_TOO_MUCH","codes":"400","description":"The maximum number of users has been exceeded (to create a chat, for example)"},{"name":"USER_ADMIN_INVALID","codes":"400","description":"Either you're not an admin or you tried to ban an admin that you didn't promote"},{"name":"USER_ALREADY_PARTICIPANT","codes":"400","description":"The authenticated user is already a participant of the chat"},{"name":"USER_BANNED_IN_CHANNEL","codes":"400","description":"You're banned from sending messages in supergroups/channels"},{"name":"USER_BLOCKED","codes":"400","description":"User blocked"},{"name":"USER_BOT","codes":"400","description":"Bots can only be admins in channels."},{"name":"USER_BOT_INVALID","codes":"400 403","description":"This method can only be called by a bot"},{"name":"USER_BOT_REQUIRED","codes":"400","description":"This method can only be called by a bot"},{"name":"USER_CHANNELS_TOO_MUCH","codes":"403","description":"One of the users you tried to add is already in too many channels/supergroups"},{"name":"USER_CREATOR","codes":"400","description":"You can't leave this channel, because you're its creator"},{"name":"USER_DEACTIVATED","codes":"401","description":"The user has been deleted/deactivated"},{"name":"USER_DEACTIVATED_BAN","codes":"401","description":"The user has been deleted/deactivated"},{"name":"USER_ID_INVALID","codes":"400","description":"Invalid object ID for a user. Make sure to pass the right types, for instance making sure that the request is designed for users or otherwise look for a different one more suited"},{"name":"USER_INVALID","codes":"400","description":"The given user was invalid"},{"name":"USER_IS_BLOCKED","codes":"400 403","description":"User is blocked"},{"name":"USER_IS_BOT","codes":"400","description":"Bots can't send messages to other bots"},{"name":"USER_KICKED","codes":"400","description":"This user was kicked from this supergroup/channel"},{"name":"USER_MIGRATE_X","codes":"303","description":"The user whose identity is being used to execute queries is associated with DC {new_dc}"},{"name":"USER_NOT_MUTUAL_CONTACT","codes":"400 403","description":"The provided user is not a mutual contact"},{"name":"USER_NOT_PARTICIPANT","codes":"400","description":"The target user is not a member of the specified megagroup or channel"},{"name":"USER_PRIVACY_RESTRICTED","codes":"403","description":"The user's privacy settings do not allow you to do this"},{"name":"USER_RESTRICTED","codes":"403","description":"You're spamreported, you can't create channels or chats."},{"name":"USERPIC_UPLOAD_REQUIRED","codes":"400","description":"You must have a profile picture before using this method"},{"name":"VIDEO_CONTENT_TYPE_INVALID","codes":"400","description":"The video content type is not supported with the given parameters (i.e. supports_streaming)"},{"name":"VIDEO_FILE_INVALID","codes":"400","description":"The given video cannot be used"},{"name":"VIDEO_TITLE_EMPTY","codes":"400","description":""},{"name":"WALLPAPER_FILE_INVALID","codes":"400","description":"The given file cannot be used as a wallpaper"},{"name":"WALLPAPER_INVALID","codes":"400","description":"The input wallpaper was not valid"},{"name":"WALLPAPER_MIME_INVALID","codes":"400","description":""},{"name":"WC_CONVERT_URL_INVALID","codes":"400","description":"WC convert URL invalid"},{"name":"WEBDOCUMENT_MIME_INVALID","codes":"400","description":""},{"name":"WEBDOCUMENT_URL_INVALID","codes":"400","description":"The given URL cannot be used"},{"name":"WEBPAGE_CURL_FAILED","codes":"400","description":"Failure while fetching the webpage with cURL"},{"name":"WEBPAGE_MEDIA_EMPTY","codes":"400","description":"Webpage media empty"},{"name":"WORKER_BUSY_TOO_LONG_RETRY","codes":"500","description":"Telegram workers are too busy to respond immediately"},{"name":"YOU_BLOCKED_USER","codes":"400","description":"You blocked this user"},{"virtual":true,"name":"RPC_TIMEOUT","codes":"408","description":"Timeout of {ms} ms exceeded"}] \ No newline at end of file +[{"codes":"400","name":"BAD_REQUEST","description":"The query contains errors. In the event that a request was created using a form and contains user generated data, the user should be notified that the data must be corrected before the query is repeated","base":true},{"codes":"401","name":"UNAUTHORIZED","description":"There was an unauthorized attempt to use functionality available only to authorized users.","base":true},{"codes":"403","name":"FORBIDDEN","description":"Privacy violation. For example, an attempt to write a message to someone who has blacklisted the current user.","base":true},{"codes":"404","name":"NOT_FOUND","description":"An attempt to invoke a non-existent object, such as a method.","base":true},{"codes":"420","name":"FLOOD","description":"The maximum allowed number of attempts to invoke the given methodwith the given input parameters has been exceeded. For example, in anattempt to request a large number of text messages (SMS) for the samephone number.","base":true},{"codes":"303","name":"SEE_OTHER","description":"The request must be repeated, but directed to a different data center","base":true},{"codes":"406","name":"NOT_ACCEPTABLE","description":"Similar to 400 BAD_REQUEST, but the app should not display any error messages to user in UI as a result of this response. The error message will be delivered via updateServiceNotification instead.","base":true},{"codes":"500","name":"INTERNAL","description":"An internal server error occurred while a request was being processed; for example, there was a disruption while accessing a database or file storage.","base":true},{"name":"2FA_CONFIRM_WAIT_X","codes":"420","description":"The account is 2FA protected so it will be deleted in a week. Otherwise it can be reset in {seconds}"},{"name":"ABOUT_TOO_LONG","codes":"400","description":"The provided bio is too long"},{"name":"ACCESS_TOKEN_EXPIRED","codes":"400","description":"Bot token expired"},{"name":"ACCESS_TOKEN_INVALID","codes":"400","description":"The provided token is not valid"},{"name":"ACTIVE_USER_REQUIRED","codes":"401","description":"The method is only available to already activated users"},{"name":"ADMINS_TOO_MUCH","codes":"400","description":"Too many admins"},{"name":"ADMIN_RANK_EMOJI_NOT_ALLOWED","codes":"400","description":"Emoji are not allowed in admin titles or ranks"},{"name":"ADMIN_RANK_INVALID","codes":"400","description":"The given admin title or rank was invalid (possibly larger than 16 characters)"},{"name":"ALBUM_PHOTOS_TOO_MANY","codes":"400","description":"Too many photos were included in the album"},{"name":"API_ID_INVALID","codes":"400","description":"The api_id/api_hash combination is invalid"},{"name":"API_ID_PUBLISHED_FLOOD","codes":"400","description":"This API id was published somewhere, you can't use it now"},{"name":"ARTICLE_TITLE_EMPTY","codes":"400","description":"The title of the article is empty"},{"name":"AUDIO_TITLE_EMPTY","codes":"400","description":"The title attribute of the audio must be non-empty"},{"name":"AUDIO_CONTENT_URL_EMPTY","codes":"400","description":""},{"name":"AUTH_BYTES_INVALID","codes":"400","description":"The provided authorization is invalid"},{"name":"AUTH_KEY_DUPLICATED","codes":"406","description":"The authorization key (session file) was used under two different IP addresses simultaneously, and can no longer be used. Use the same session exclusively, or use different sessions"},{"name":"AUTH_KEY_INVALID","codes":"401","description":"The key is invalid"},{"name":"AUTH_KEY_PERM_EMPTY","codes":"401","description":"The method is unavailable for temporary authorization key, not bound to permanent"},{"name":"AUTH_KEY_UNREGISTERED","codes":"401","description":"The key is not registered in the system"},{"name":"AUTH_RESTART","codes":"500","description":"Restart the authorization process"},{"name":"AUTH_TOKEN_ALREADY_ACCEPTED","codes":"400","description":"The authorization token was already used"},{"name":"AUTH_TOKEN_EXPIRED","codes":"400","description":"The provided authorization token has expired and the updated QR-code must be re-scanned"},{"name":"AUTH_TOKEN_INVALID","codes":"400","description":"An invalid authorization token was provided"},{"name":"AUTOARCHIVE_NOT_AVAILABLE","codes":"400","description":"You cannot use this feature yet"},{"name":"BANK_CARD_NUMBER_INVALID","codes":"400","description":"Incorrect credit card number"},{"name":"BASE_PORT_LOC_INVALID","codes":"400","description":"Base port location invalid"},{"name":"BANNED_RIGHTS_INVALID","codes":"400","description":"You cannot use that set of permissions in this request, i.e. restricting view_messages as a default"},{"name":"BOTS_TOO_MUCH","codes":"400","description":"There are too many bots in this chat/channel"},{"name":"BOT_CHANNELS_NA","codes":"400","description":"Bots can't edit admin privileges"},{"name":"BOT_COMMAND_DESCRIPTION_INVALID","codes":"400","description":"The command description was empty, too long or had invalid characters used"},{"name":"BOT_COMMAND_INVALID","codes":"400","description":""},{"name":"BOT_DOMAIN_INVALID","codes":"400","description":"The domain used for the auth button does not match the one configured in @BotFather"},{"name":"BOT_GAMES_DISABLED","codes":"400","description":"Bot games cannot be used in this type of chat"},{"name":"BOT_GROUPS_BLOCKED","codes":"400","description":"This bot can't be added to groups"},{"name":"BOT_INLINE_DISABLED","codes":"400","description":"This bot can't be used in inline mode"},{"name":"BOT_INVALID","codes":"400","description":"This is not a valid bot"},{"name":"BOT_METHOD_INVALID","codes":"400","description":"The API access for bot users is restricted. The method you tried to invoke cannot be executed as a bot"},{"name":"BOT_MISSING","codes":"400","description":"This method can only be run by a bot"},{"name":"BOT_PAYMENTS_DISABLED","codes":"400","description":"This method can only be run by a bot"},{"name":"BOT_POLLS_DISABLED","codes":"400","description":"You cannot create polls under a bot account"},{"name":"BOT_RESPONSE_TIMEOUT","codes":"400","description":"The bot did not answer to the callback query in time"},{"name":"BROADCAST_CALLS_DISABLED","codes":"400","description":""},{"name":"BROADCAST_FORBIDDEN","codes":"403","description":"The request cannot be used in broadcast channels"},{"name":"BROADCAST_ID_INVALID","codes":"400","description":"The channel is invalid"},{"name":"BROADCAST_PUBLIC_VOTERS_FORBIDDEN","codes":"400","description":"You cannot broadcast polls where the voters are public"},{"name":"BROADCAST_REQUIRED","codes":"400","description":"The request can only be used with a broadcast channel"},{"name":"BUTTON_DATA_INVALID","codes":"400","description":"The provided button data is invalid"},{"name":"BUTTON_TYPE_INVALID","codes":"400","description":"The type of one of the buttons you provided is invalid"},{"name":"BUTTON_URL_INVALID","codes":"400","description":"Button URL invalid"},{"name":"CALL_ALREADY_ACCEPTED","codes":"400","description":"The call was already accepted"},{"name":"CALL_ALREADY_DECLINED","codes":"400","description":"The call was already declined"},{"name":"CALL_OCCUPY_FAILED","codes":"500","description":"The call failed because the user is already making another call"},{"name":"CALL_PEER_INVALID","codes":"400","description":"The provided call peer object is invalid"},{"name":"CALL_PROTOCOL_FLAGS_INVALID","codes":"400","description":"Call protocol flags invalid"},{"name":"CDN_METHOD_INVALID","codes":"400","description":"This method cannot be invoked on a CDN server. Refer to https://core.telegram.org/cdn#schema for available methods"},{"name":"CHANNELS_ADMIN_PUBLIC_TOO_MUCH","codes":"400","description":"You're admin of too many public channels, make some channels private to change the username of this channel"},{"name":"CHANNELS_TOO_MUCH","codes":"400","description":"You have joined too many channels/supergroups"},{"name":"CHANNEL_BANNED","codes":"400","description":"The channel is banned"},{"name":"CHANNEL_INVALID","codes":"400","description":"Invalid channel object. Make sure to pass the right types, for instance making sure that the request is designed for channels or otherwise look for a different one more suited"},{"name":"CHANNEL_PRIVATE","codes":"400","description":"The channel specified is private and you lack permission to access it. Another reason may be that you were banned from it"},{"name":"CHANNEL_PUBLIC_GROUP_NA","codes":"403","description":"channel/supergroup not available"},{"name":"CHAT_ABOUT_NOT_MODIFIED","codes":"400","description":"About text has not changed"},{"name":"CHAT_ABOUT_TOO_LONG","codes":"400","description":"Chat about too long"},{"name":"CHAT_ADMIN_INVITE_REQUIRED","codes":"403","description":"You do not have the rights to do this"},{"name":"CHAT_ADMIN_REQUIRED","codes":"400","description":"Chat admin privileges are required to do that in the specified chat (for example, to send a message in a channel which is not yours), or invalid permissions used for the channel or group"},{"name":"CHAT_FORBIDDEN","codes":"403","description":"You cannot write in this chat"},{"name":"CHAT_ID_EMPTY","codes":"400","description":"The provided chat ID is empty"},{"name":"CHAT_ID_INVALID","codes":"400","description":"Invalid object ID for a chat. Make sure to pass the right types, for instance making sure that the request is designed for chats (not channels/megagroups) or otherwise look for a different one more suited\\nAn example working with a megagroup and AddChatUserRequest, it will fail because megagroups are channels. Use InviteToChannelRequest instead"},{"name":"CHAT_INVALID","codes":"400","description":"The chat is invalid for this request"},{"name":"CHAT_LINK_EXISTS","codes":"400","description":"The chat is linked to a channel and cannot be used in that request"},{"name":"CHAT_NOT_MODIFIED","codes":"400","description":"The chat or channel wasn't modified (title, invites, username, admins, etc. are the same)"},{"name":"CHAT_RESTRICTED","codes":"400","description":"The chat is restricted and cannot be used in that request"},{"name":"CHAT_SEND_GIFS_FORBIDDEN","codes":"403","description":"You can't send gifs in this chat"},{"name":"CHAT_SEND_INLINE_FORBIDDEN","codes":"400","description":"You cannot send inline results in this chat"},{"name":"CHAT_SEND_MEDIA_FORBIDDEN","codes":"403","description":"You can't send media in this chat"},{"name":"CHAT_SEND_STICKERS_FORBIDDEN","codes":"403","description":"You can't send stickers in this chat"},{"name":"CHAT_TITLE_EMPTY","codes":"400","description":"No chat title provided"},{"name":"CHAT_WRITE_FORBIDDEN","codes":"403","description":"You can't write in this chat"},{"name":"CHP_CALL_FAIL","codes":"500","description":"The statistics cannot be retrieved at this time"},{"name":"CODE_EMPTY","codes":"400","description":"The provided code is empty"},{"name":"CODE_HASH_INVALID","codes":"400","description":"Code hash invalid"},{"name":"CODE_INVALID","codes":"400","description":"Code invalid (i.e. from email)"},{"name":"CONNECTION_API_ID_INVALID","codes":"400","description":"The provided API id is invalid"},{"name":"CONNECTION_DEVICE_MODEL_EMPTY","codes":"400","description":"Device model empty"},{"name":"CONNECTION_LANG_PACK_INVALID","codes":"400","description":"The specified language pack is not valid. This is meant to be used by official applications only so far, leave it empty"},{"name":"CONNECTION_LAYER_INVALID","codes":"400","description":"The very first request must always be InvokeWithLayerRequest"},{"name":"CONNECTION_NOT_INITED","codes":"400","description":"Connection not initialized"},{"name":"CONNECTION_SYSTEM_EMPTY","codes":"400","description":"Connection system empty"},{"name":"CONNECTION_SYSTEM_LANG_CODE_EMPTY","codes":"400","description":"The system language string was empty during connection"},{"name":"CONTACT_ID_INVALID","codes":"400","description":"The provided contact ID is invalid"},{"name":"CONTACT_NAME_EMPTY","codes":"400","description":"The provided contact name cannot be empty"},{"name":"DATA_INVALID","codes":"400","description":"Encrypted data invalid"},{"name":"DATA_JSON_INVALID","codes":"400","description":"The provided JSON data is invalid"},{"name":"DATE_EMPTY","codes":"400","description":"Date empty"},{"name":"DC_ID_INVALID","codes":"400","description":"This occurs when an authorization is tried to be exported for the same data center one is currently connected to"},{"name":"DH_G_A_INVALID","codes":"400","description":"g_a invalid"},{"name":"DOCUMENT_INVALID","codes":"400","description":"The document file was invalid and can't be used in inline mode"},{"name":"EMAIL_HASH_EXPIRED","codes":"400","description":"The email hash expired and cannot be used to verify it"},{"name":"EMAIL_INVALID","codes":"400","description":"The given email is invalid"},{"name":"EMAIL_UNCONFIRMED_X","codes":"400","description":"Email unconfirmed, the length of the code must be {code_length}"},{"name":"EMOTICON_EMPTY","codes":"400","description":"The emoticon field cannot be empty"},{"name":"EMOTICON_INVALID","codes":"400","description":"The specified emoticon cannot be used or was not a emoticon"},{"name":"EMOTICON_STICKERPACK_MISSING","codes":"400","description":"The emoticon sticker pack you are trying to get is missing"},{"name":"ENCRYPTED_MESSAGE_INVALID","codes":"400","description":"Encrypted message invalid"},{"name":"ENCRYPTION_ALREADY_ACCEPTED","codes":"400","description":"Secret chat already accepted"},{"name":"ENCRYPTION_ALREADY_DECLINED","codes":"400","description":"The secret chat was already declined"},{"name":"ENCRYPTION_DECLINED","codes":"400","description":"The secret chat was declined"},{"name":"ENCRYPTION_ID_INVALID","codes":"400","description":"The provided secret chat ID is invalid"},{"name":"ENCRYPTION_OCCUPY_FAILED","codes":"500","description":"TDLib developer claimed it is not an error while accepting secret chats and 500 is used instead of 420"},{"name":"ENTITIES_TOO_LONG","codes":"400","description":"It is no longer possible to send such long data inside entity tags (for example inline text URLs)"},{"name":"ENTITY_MENTION_USER_INVALID","codes":"400","description":"You can't use this entity"},{"name":"ERROR_TEXT_EMPTY","codes":"400","description":"The provided error message is empty"},{"name":"EXPIRE_FORBIDDEN","codes":"400","description":""},{"name":"EXPORT_CARD_INVALID","codes":"400","description":"Provided card is invalid"},{"name":"EXTERNAL_URL_INVALID","codes":"400","description":"External URL invalid"},{"name":"FIELD_NAME_EMPTY","codes":"400","description":"The field with the name FIELD_NAME is missing"},{"name":"FIELD_NAME_INVALID","codes":"400","description":"The field with the name FIELD_NAME is invalid"},{"name":"FILEREF_UPGRADE_NEEDED","codes":"406","description":"The file reference needs to be refreshed before being used again"},{"name":"FILE_ID_INVALID","codes":"400","description":"The provided file id is invalid. Make sure all parameters are present, have the correct type and are not empty (ID, access hash, file reference, thumb size ...)"},{"name":"FILE_MIGRATE_X","codes":"303","description":"The file to be accessed is currently stored in DC {new_dc}"},{"name":"FILE_PARTS_INVALID","codes":"400","description":"The number of file parts is invalid"},{"name":"FILE_PART_0_MISSING","codes":"400","description":"File part 0 missing"},{"name":"FILE_PART_EMPTY","codes":"400","description":"The provided file part is empty"},{"name":"FILE_PART_INVALID","codes":"400","description":"The file part number is invalid"},{"name":"FILE_PART_LENGTH_INVALID","codes":"400","description":"The length of a file part is invalid"},{"name":"FILE_PART_SIZE_CHANGED","codes":"400","description":"The file part size (chunk size) cannot change during upload"},{"name":"FILE_PART_SIZE_INVALID","codes":"400","description":"The provided file part size is invalid"},{"name":"FILE_PART_X_MISSING","codes":"400","description":"Part {which} of the file is missing from storage"},{"name":"FILE_REFERENCE_EMPTY","codes":"400","description":"The file reference must exist to access the media and it cannot be empty"},{"name":"FILE_REFERENCE_EXPIRED","codes":"400","description":"The file reference has expired and is no longer valid or it belongs to self-destructing media and cannot be resent"},{"name":"FILE_REFERENCE_INVALID","codes":"400","description":"The file reference is invalid or you can't do that operation on such message"},{"name":"FIRSTNAME_INVALID","codes":"400","description":"The first name is invalid"},{"name":"FLOOD_TEST_PHONE_WAIT_X","codes":"420","description":"A wait of {seconds} seconds is required in the test servers"},{"name":"FLOOD_WAIT_X","codes":"420","description":"A wait of {seconds} seconds is required"},{"name":"FOLDER_ID_EMPTY","codes":"400","description":"The folder you tried to delete was already empty"},{"name":"FOLDER_ID_INVALID","codes":"400","description":"The folder you tried to use was not valid"},{"name":"FRESH_CHANGE_ADMINS_FORBIDDEN","codes":"400","description":"Recently logged-in users cannot add or change admins"},{"name":"FRESH_CHANGE_PHONE_FORBIDDEN","codes":"406","description":"Recently logged-in users cannot use this request"},{"name":"FRESH_RESET_AUTHORISATION_FORBIDDEN","codes":"406","description":"The current session is too new and cannot be used to reset other authorisations yet"},{"name":"FROM_PEER_INVALID","codes":"400","description":"The given from_user peer cannot be used for the parameter"},{"name":"GAME_BOT_INVALID","codes":"400","description":"You cannot send that game with the current bot"},{"name":"GIF_CONTENT_TYPE_INVALID","codes":"400","description":""},{"name":"GIF_ID_INVALID","codes":"400","description":"The provided GIF ID is invalid"},{"name":"GRAPH_INVALID_RELOAD","codes":"400","description":""},{"name":"GRAPH_OUTDATED_RELOAD","codes":"400","description":"Data can't be used for the channel statistics, graphs outdated"},{"name":"GROUPCALL_FORBIDDEN","codes":"403","description":""},{"name":"GROUPCALL_JOIN_MISSING","codes":"400","description":""},{"name":"GROUPCALL_SSRC_DUPLICATE_MUCH","codes":"400","description":""},{"name":"GROUPCALL_NOT_MODIFIED","codes":"400","description":""},{"name":"GROUPED_MEDIA_INVALID","codes":"400","description":"Invalid grouped media"},{"name":"GROUP_CALL_INVALID","codes":"400","description":"Group call invalid"},{"name":"HASH_INVALID","codes":"400","description":"The provided hash is invalid"},{"name":"HISTORY_GET_FAILED","codes":"500","description":"Fetching of history failed"},{"name":"IMAGE_PROCESS_FAILED","codes":"400","description":"Failure while processing image"},{"name":"IMPORT_FILE_INVALID","codes":"400","description":"The file is too large to be imported"},{"name":"IMPORT_FORMAT_UNRECOGNIZED","codes":"400","description":"Unknown import format"},{"name":"IMPORT_ID_INVALID","codes":"400","description":""},{"name":"INLINE_BOT_REQUIRED","codes":"403","description":"The action must be performed through an inline bot callback"},{"name":"INLINE_RESULT_EXPIRED","codes":"400","description":"The inline query expired"},{"name":"INPUT_CONSTRUCTOR_INVALID","codes":"400","description":"The provided constructor is invalid"},{"name":"INPUT_FETCH_ERROR","codes":"400","description":"An error occurred while deserializing TL parameters"},{"name":"INPUT_FETCH_FAIL","codes":"400","description":"Failed deserializing TL payload"},{"name":"INPUT_FILTER_INVALID","codes":"400","description":"The search query filter is invalid"},{"name":"INPUT_LAYER_INVALID","codes":"400","description":"The provided layer is invalid"},{"name":"INPUT_METHOD_INVALID","codes":"400","description":"The invoked method does not exist anymore or has never existed"},{"name":"INPUT_REQUEST_TOO_LONG","codes":"400","description":"The input request was too long. This may be a bug in the library as it can occur when serializing more bytes than it should (like appending the vector constructor code at the end of a message)"},{"name":"INPUT_USER_DEACTIVATED","codes":"400","description":"The specified user was deleted"},{"name":"INTERDC_X_CALL_ERROR","codes":"500","description":"An error occurred while communicating with DC {dc}"},{"name":"INTERDC_X_CALL_RICH_ERROR","codes":"500","description":"A rich error occurred while communicating with DC {dc}"},{"name":"INVITE_HASH_EMPTY","codes":"400","description":"The invite hash is empty"},{"name":"INVITE_HASH_EXPIRED","codes":"400","description":"The chat the user tried to join has expired and is not valid anymore"},{"name":"INVITE_HASH_INVALID","codes":"400","description":"The invite hash is invalid"},{"name":"LANG_PACK_INVALID","codes":"400","description":"The provided language pack is invalid"},{"name":"LASTNAME_INVALID","codes":"400","description":"The last name is invalid"},{"name":"LIMIT_INVALID","codes":"400","description":"An invalid limit was provided. See https://core.telegram.org/api/files#downloading-files"},{"name":"LINK_NOT_MODIFIED","codes":"400","description":"The channel is already linked to this group"},{"name":"LOCATION_INVALID","codes":"400","description":"The location given for a file was invalid. See https://core.telegram.org/api/files#downloading-files"},{"name":"MAX_ID_INVALID","codes":"400","description":"The provided max ID is invalid"},{"name":"MAX_QTS_INVALID","codes":"400","description":"The provided QTS were invalid"},{"name":"MD5_CHECKSUM_INVALID","codes":"400","description":"The MD5 check-sums do not match"},{"name":"MEDIA_CAPTION_TOO_LONG","codes":"400","description":"The caption is too long"},{"name":"MEDIA_EMPTY","codes":"400","description":"The provided media object is invalid or the current account may not be able to send it (such as games as users)"},{"name":"MEDIA_GROUPED_INVALID","codes":"400","description":""},{"name":"MEDIA_INVALID","codes":"400","description":"Media invalid"},{"name":"MEDIA_NEW_INVALID","codes":"400","description":"The new media to edit the message with is invalid (such as stickers or voice notes)"},{"name":"MEDIA_PREV_INVALID","codes":"400","description":"The old media cannot be edited with anything else (such as stickers or voice notes)"},{"name":"MEDIA_TTL_INVALID","codes":"400","description":""},{"name":"MEGAGROUP_ID_INVALID","codes":"400","description":"The group is invalid"},{"name":"MEGAGROUP_PREHISTORY_HIDDEN","codes":"400","description":"You can't set this discussion group because it's history is hidden"},{"name":"MEGAGROUP_REQUIRED","codes":"400","description":"The request can only be used with a megagroup channel"},{"name":"MEMBER_NO_LOCATION","codes":"500","description":"An internal failure occurred while fetching user info (couldn't find location)"},{"name":"MEMBER_OCCUPY_PRIMARY_LOC_FAILED","codes":"500","description":"Occupation of primary member location failed"},{"name":"MESSAGE_AUTHOR_REQUIRED","codes":"403","description":"Message author required"},{"name":"MESSAGE_DELETE_FORBIDDEN","codes":"403","description":"You can't delete one of the messages you tried to delete, most likely because it is a service message."},{"name":"MESSAGE_EDIT_TIME_EXPIRED","codes":"400","description":"You can't edit this message anymore, too much time has passed since its creation."},{"name":"MESSAGE_EMPTY","codes":"400","description":"Empty or invalid UTF-8 message was sent"},{"name":"MESSAGE_IDS_EMPTY","codes":"400","description":"No message ids were provided"},{"name":"MESSAGE_ID_INVALID","codes":"400","description":"The specified message ID is invalid or you can't do that operation on such message"},{"name":"MESSAGE_NOT_MODIFIED","codes":"400","description":"Content of the message was not modified"},{"name":"MESSAGE_POLL_CLOSED","codes":"400","description":"The poll was closed and can no longer be voted on"},{"name":"MESSAGE_TOO_LONG","codes":"400","description":"Message was too long. Current maximum length is 4096 UTF-8 characters"},{"name":"METHOD_INVALID","codes":"400","description":"The API method is invalid and cannot be used"},{"name":"MSGID_DECREASE_RETRY","codes":"500","description":"The request should be retried with a lower message ID"},{"name":"MSG_ID_INVALID","codes":"400","description":"The message ID used in the peer was invalid"},{"name":"MSG_WAIT_FAILED","codes":"400","description":"A waiting call returned an error"},{"name":"MT_SEND_QUEUE_TOO_LONG","codes":"500","description":""},{"name":"MULTI_MEDIA_TOO_LONG","codes":"400","description":"Too many media files were included in the same album"},{"name":"NEED_CHAT_INVALID","codes":"500","description":"The provided chat is invalid"},{"name":"NEED_MEMBER_INVALID","codes":"500","description":"The provided member is invalid or does not exist (for example a thumb size)"},{"name":"NETWORK_MIGRATE_X","codes":"303","description":"The source IP address is associated with DC {new_dc}"},{"name":"NEW_SALT_INVALID","codes":"400","description":"The new salt is invalid"},{"name":"NEW_SETTINGS_INVALID","codes":"400","description":"The new settings are invalid"},{"name":"NEXT_OFFSET_INVALID","codes":"400","description":"The value for next_offset is invalid. Check that it has normal characters and is not too long"},{"name":"OFFSET_INVALID","codes":"400","description":"The given offset was invalid, it must be divisible by 1KB. See https://core.telegram.org/api/files#downloading-files"},{"name":"OFFSET_PEER_ID_INVALID","codes":"400","description":"The provided offset peer is invalid"},{"name":"OPTIONS_TOO_MUCH","codes":"400","description":"You defined too many options for the poll"},{"name":"OPTION_INVALID","codes":"400","description":"The option specified is invalid and does not exist in the target poll"},{"name":"PACK_SHORT_NAME_INVALID","codes":"400","description":"Invalid sticker pack name. It must begin with a letter, can't contain consecutive underscores and must end in \"_by_\"."},{"name":"PACK_SHORT_NAME_OCCUPIED","codes":"400","description":"A stickerpack with this name already exists"},{"name":"PARTICIPANTS_TOO_FEW","codes":"400","description":"Not enough participants"},{"name":"PARTICIPANT_CALL_FAILED","codes":"500","description":"Failure while making call"},{"name":"PARTICIPANT_JOIN_MISSING","codes":"403","description":""},{"name":"PARTICIPANT_VERSION_OUTDATED","codes":"400","description":"The other participant does not use an up to date telegram client with support for calls"},{"name":"PASSWORD_EMPTY","codes":"400","description":"The provided password is empty"},{"name":"PASSWORD_HASH_INVALID","codes":"400","description":"The password (and thus its hash value) you entered is invalid"},{"name":"PASSWORD_MISSING","codes":"400","description":"The account must have 2-factor authentication enabled (a password) before this method can be used"},{"name":"PASSWORD_REQUIRED","codes":"400","description":"The account must have 2-factor authentication enabled (a password) before this method can be used"},{"name":"PASSWORD_TOO_FRESH_X","codes":"400","description":"The password was added too recently and {seconds} seconds must pass before using the method"},{"name":"PAYMENT_PROVIDER_INVALID","codes":"400","description":"The payment provider was not recognised or its token was invalid"},{"name":"PEER_FLOOD","codes":"400","description":"Too many requests"},{"name":"PEER_ID_INVALID","codes":"400","description":"An invalid Peer was used. Make sure to pass the right peer type and that the value is valid (for instance, bots cannot start conversations)"},{"name":"PEER_ID_NOT_SUPPORTED","codes":"400","description":"The provided peer ID is not supported"},{"name":"PERSISTENT_TIMESTAMP_EMPTY","codes":"400","description":"Persistent timestamp empty"},{"name":"PERSISTENT_TIMESTAMP_INVALID","codes":"400","description":"Persistent timestamp invalid"},{"name":"PERSISTENT_TIMESTAMP_OUTDATED","codes":"500","description":"Persistent timestamp outdated"},{"name":"PHONE_CODE_EMPTY","codes":"400","description":"The phone code is missing"},{"name":"PHONE_CODE_EXPIRED","codes":"400","description":"The confirmation code has expired"},{"name":"PHONE_CODE_HASH_EMPTY","codes":"400","description":"The phone code hash is missing"},{"name":"PHONE_CODE_INVALID","codes":"400","description":"The phone code entered was invalid"},{"name":"PHONE_MIGRATE_X","codes":"303","description":"The phone number a user is trying to use for authorization is associated with DC {new_dc}"},{"name":"PHONE_NUMBER_APP_SIGNUP_FORBIDDEN","codes":"400","description":"You can't sign up using this app"},{"name":"PHONE_NUMBER_BANNED","codes":"400","description":"The used phone number has been banned from Telegram and cannot be used anymore. Maybe check https://www.telegram.org/faq_spam"},{"name":"PHONE_NUMBER_FLOOD","codes":"400","description":"You asked for the code too many times."},{"name":"PHONE_NUMBER_INVALID","codes":"400 406","description":"The phone number is invalid"},{"name":"PHONE_NUMBER_OCCUPIED","codes":"400","description":"The phone number is already in use"},{"name":"PHONE_NUMBER_UNOCCUPIED","codes":"400","description":"The phone number is not yet being used"},{"name":"PHONE_PASSWORD_FLOOD","codes":"406","description":"You have tried logging in too many times"},{"name":"PHONE_PASSWORD_PROTECTED","codes":"400","description":"This phone is password protected"},{"name":"PHOTO_CONTENT_TYPE_INVALID","codes":"400","description":""},{"name":"PHOTO_CONTENT_URL_EMPTY","codes":"400","description":"The content from the URL used as a photo appears to be empty or has caused another HTTP error"},{"name":"PHOTO_CROP_SIZE_SMALL","codes":"400","description":"Photo is too small"},{"name":"PHOTO_EXT_INVALID","codes":"400","description":"The extension of the photo is invalid"},{"name":"PHOTO_ID_INVALID","codes":"400","description":"Photo id is invalid"},{"name":"PHOTO_INVALID","codes":"400","description":"Photo invalid"},{"name":"PHOTO_INVALID_DIMENSIONS","codes":"400","description":"The photo dimensions are invalid (hint: `pip install pillow` for `send_file` to resize images)"},{"name":"PHOTO_SAVE_FILE_INVALID","codes":"400","description":"The photo you tried to send cannot be saved by Telegram. A reason may be that it exceeds 10MB. Try resizing it locally"},{"name":"PHOTO_THUMB_URL_EMPTY","codes":"400","description":"The URL used as a thumbnail appears to be empty or has caused another HTTP error"},{"name":"PIN_RESTRICTED","codes":"400","description":"You can't pin messages in private chats with other people"},{"name":"POLL_ANSWERS_INVALID","codes":"400","description":"The poll did not have enough answers or had too many"},{"name":"POLL_OPTION_DUPLICATE","codes":"400","description":"A duplicate option was sent in the same poll"},{"name":"POLL_OPTION_INVALID","codes":"400","description":"A poll option used invalid data (the data may be too long)"},{"name":"POLL_QUESTION_INVALID","codes":"400","description":"The poll question was either empty or too long"},{"name":"POLL_UNSUPPORTED","codes":"400","description":"This layer does not support polls in the issued method"},{"name":"PREVIOUS_CHAT_IMPORT_ACTIVE_WAIT_XMIN","codes":"406","description":"Similar to a flood wait, must wait {minutes} minutes"},{"name":"PRIVACY_KEY_INVALID","codes":"400","description":"The privacy key is invalid"},{"name":"PRIVACY_TOO_LONG","codes":"400","description":"Cannot add that many entities in a single request"},{"name":"PRIVACY_VALUE_INVALID","codes":"400","description":"The privacy value is invalid"},{"name":"PTS_CHANGE_EMPTY","codes":"500","description":"No PTS change"},{"name":"QUERY_ID_EMPTY","codes":"400","description":"The query ID is empty"},{"name":"QUERY_ID_INVALID","codes":"400","description":"The query ID is invalid"},{"name":"QUERY_TOO_SHORT","codes":"400","description":"The query string is too short"},{"name":"QUIZ_CORRECT_ANSWERS_EMPTY","codes":"400","description":"A quiz must specify one correct answer"},{"name":"QUIZ_CORRECT_ANSWERS_TOO_MUCH","codes":"400","description":"There can only be one correct answer"},{"name":"QUIZ_CORRECT_ANSWER_INVALID","codes":"400","description":"The correct answer is not an existing answer"},{"name":"QUIZ_MULTIPLE_INVALID","codes":"400","description":"A poll cannot be both multiple choice and quiz"},{"name":"RANDOM_ID_DUPLICATE","codes":"500","description":"You provided a random ID that was already used"},{"name":"RANDOM_ID_INVALID","codes":"400","description":"A provided random ID is invalid"},{"name":"RANDOM_LENGTH_INVALID","codes":"400","description":"Random length invalid"},{"name":"RANGES_INVALID","codes":"400","description":"Invalid range provided"},{"name":"REACTION_EMPTY","codes":"400","description":"No reaction provided"},{"name":"REACTION_INVALID","codes":"400","description":"Invalid reaction provided (only emoji are allowed)"},{"name":"REFLECTOR_NOT_AVAILABLE","codes":"400","description":"Invalid call reflector server"},{"name":"REG_ID_GENERATE_FAILED","codes":"500","description":"Failure while generating registration ID"},{"name":"REPLY_MARKUP_GAME_EMPTY","codes":"400","description":"The provided reply markup for the game is empty"},{"name":"REPLY_MARKUP_INVALID","codes":"400","description":"The provided reply markup is invalid"},{"name":"REPLY_MARKUP_TOO_LONG","codes":"400","description":"The data embedded in the reply markup buttons was too much"},{"name":"RESULTS_TOO_MUCH","codes":"400","description":"You sent too many results, see https://core.telegram.org/bots/api#answerinlinequery for the current limit"},{"name":"RESULT_ID_DUPLICATE","codes":"400","description":"Duplicated IDs on the sent results. Make sure to use unique IDs"},{"name":"RESULT_ID_INVALID","codes":"400","description":"The given result cannot be used to send the selection to the bot"},{"name":"RESULT_TYPE_INVALID","codes":"400","description":"Result type invalid"},{"name":"RIGHT_FORBIDDEN","codes":"403","description":"Either your admin rights do not allow you to do this or you passed the wrong rights combination (some rights only apply to channels and vice versa)"},{"name":"RPC_CALL_FAIL","codes":"500","description":"Telegram is having internal issues, please try again later."},{"name":"RPC_MCGET_FAIL","codes":"500","description":"Telegram is having internal issues, please try again later."},{"name":"RSA_DECRYPT_FAILED","codes":"400","description":"Internal RSA decryption failed"},{"name":"SCHEDULE_BOT_NOT_ALLOWED","codes":"400","description":"Bots are not allowed to schedule messages"},{"name":"SCHEDULE_DATE_INVALID","codes":"400","description":""},{"name":"SCHEDULE_DATE_TOO_LATE","codes":"400","description":"The date you tried to schedule is too far in the future (last known limit of 1 year and a few hours)"},{"name":"SCHEDULE_STATUS_PRIVATE","codes":"400","description":"You cannot schedule a message until the person comes online if their privacy does not show this information"},{"name":"SCHEDULE_TOO_MUCH","codes":"400","description":"You cannot schedule more messages in this chat (last known limit of 100 per chat)"},{"name":"SEARCH_QUERY_EMPTY","codes":"400","description":"The search query is empty"},{"name":"SECONDS_INVALID","codes":"400","description":"Slow mode only supports certain values (e.g. 0, 10s, 30s, 1m, 5m, 15m and 1h)"},{"name":"SEND_MESSAGE_MEDIA_INVALID","codes":"400","description":"The message media was invalid or not specified"},{"name":"SEND_MESSAGE_TYPE_INVALID","codes":"400","description":"The message type is invalid"},{"name":"SENSITIVE_CHANGE_FORBIDDEN","codes":"403","description":"Your sensitive content settings cannot be changed at this time"},{"name":"SESSION_EXPIRED","codes":"401","description":"The authorization has expired"},{"name":"SESSION_PASSWORD_NEEDED","codes":"401","description":"Two-steps verification is enabled and a password is required"},{"name":"SESSION_REVOKED","codes":"401","description":"The authorization has been invalidated, because of the user terminating all sessions"},{"name":"SESSION_TOO_FRESH_X","codes":"400","description":"The session logged in too recently and {seconds} seconds must pass before calling the method"},{"name":"SHA256_HASH_INVALID","codes":"400","description":"The provided SHA256 hash is invalid"},{"name":"SHORTNAME_OCCUPY_FAILED","codes":"400","description":"An error occurred when trying to register the short-name used for the sticker pack. Try a different name"},{"name":"SLOWMODE_WAIT_X","codes":"420","description":"A wait of {seconds} seconds is required before sending another message in this chat"},{"name":"SRP_ID_INVALID","codes":"400","description":""},{"name":"START_PARAM_EMPTY","codes":"400","description":"The start parameter is empty"},{"name":"START_PARAM_INVALID","codes":"400","description":"Start parameter invalid"},{"name":"STATS_MIGRATE_X","codes":"303","description":"The channel statistics must be fetched from DC {dc}"},{"name":"STICKERSET_INVALID","codes":"400","description":"The provided sticker set is invalid"},{"name":"STICKERSET_OWNER_ANONYMOUS","codes":"406","description":"This sticker set can't be used as the group's official stickers because it was created by one of its anonymous admins"},{"name":"STICKERS_EMPTY","codes":"400","description":"No sticker provided"},{"name":"STICKER_DOCUMENT_INVALID","codes":"400","description":"The sticker file was invalid (this file has failed Telegram internal checks, make sure to use the correct format and comply with https://core.telegram.org/animated_stickers)"},{"name":"STICKER_EMOJI_INVALID","codes":"400","description":"Sticker emoji invalid"},{"name":"STICKER_FILE_INVALID","codes":"400","description":"Sticker file invalid"},{"name":"STICKER_ID_INVALID","codes":"400","description":"The provided sticker ID is invalid"},{"name":"STICKER_INVALID","codes":"400","description":"The provided sticker is invalid"},{"name":"STICKER_PNG_DIMENSIONS","codes":"400","description":"Sticker png dimensions invalid"},{"name":"STICKER_PNG_NOPNG","codes":"400","description":"Stickers must be a png file but the used image was not a png"},{"name":"STICKER_TGS_NODOC","codes":"400","description":""},{"name":"STICKER_TGS_NOTGS","codes":"400","description":"Stickers must be a tgs file but the used file was not a tgs"},{"name":"STICKER_THUMB_PNG_NOPNG","codes":"400","description":"Stickerset thumb must be a png file but the used file was not png"},{"name":"STICKER_THUMB_TGS_NOTGS","codes":"400","description":"Stickerset thumb must be a tgs file but the used file was not tgs"},{"name":"STORAGE_CHECK_FAILED","codes":"500","description":"Server storage check failed"},{"name":"STORE_INVALID_SCALAR_TYPE","codes":"500","description":""},{"name":"TAKEOUT_INIT_DELAY_X","codes":"420","description":"A wait of {seconds} seconds is required before being able to initiate the takeout"},{"name":"TAKEOUT_INVALID","codes":"400","description":"The takeout session has been invalidated by another data export session"},{"name":"TAKEOUT_REQUIRED","codes":"400","description":"You must initialize a takeout request first"},{"name":"TEMP_AUTH_KEY_EMPTY","codes":"400","description":"No temporary auth key provided"},{"name":"TIMEOUT","codes":"500","description":"A timeout occurred while fetching data from the worker"},{"name":"THEME_INVALID","codes":"400","description":"Theme invalid"},{"name":"THEME_MIME_INVALID","codes":"400","description":"You cannot create this theme, the mime-type is invalid"},{"name":"TMP_PASSWORD_DISABLED","codes":"400","description":"The temporary password is disabled"},{"name":"TMP_PASSWORD_INVALID","codes":"400","description":"Password auth needs to be regenerated"},{"name":"TOKEN_INVALID","codes":"400","description":"The provided token is invalid"},{"name":"TTL_DAYS_INVALID","codes":"400","description":"The provided TTL is invalid"},{"name":"TTL_PERIOD_INVALID","codes":"400","description":"The provided TTL Period is invalid"},{"name":"TYPES_EMPTY","codes":"400","description":"The types field is empty"},{"name":"TYPE_CONSTRUCTOR_INVALID","codes":"400","description":"The type constructor is invalid"},{"name":"UNKNOWN_METHOD","codes":"500","description":"The method you tried to call cannot be called on non-CDN DCs"},{"name":"UNTIL_DATE_INVALID","codes":"400","description":"That date cannot be specified in this request (try using None)"},{"name":"URL_INVALID","codes":"400","description":"The URL used was invalid (e.g. when answering a callback with a URL that's not t.me/yourbot or your game's URL)"},{"name":"USER_VOLUME_INVALID","codes":"400","description":""},{"name":"USERNAME_INVALID","codes":"400","description":"Nobody is using this username, or the username is unacceptable. If the latter, it must match r\"[a-zA-Z][\\w\\d]{3,30}[a-zA-Z\\d]\""},{"name":"USERNAME_NOT_MODIFIED","codes":"400","description":"The username is not different from the current username"},{"name":"USERNAME_NOT_OCCUPIED","codes":"400","description":"The username is not in use by anyone else yet"},{"name":"USERNAME_OCCUPIED","codes":"400","description":"The username is already taken"},{"name":"USERS_TOO_FEW","codes":"400","description":"Not enough users (to create a chat, for example)"},{"name":"USERS_TOO_MUCH","codes":"400","description":"The maximum number of users has been exceeded (to create a chat, for example)"},{"name":"USER_ADMIN_INVALID","codes":"400","description":"Either you're not an admin or you tried to ban an admin that you didn't promote"},{"name":"USER_ALREADY_PARTICIPANT","codes":"400","description":"The authenticated user is already a participant of the chat"},{"name":"USER_BANNED_IN_CHANNEL","codes":"400","description":"You're banned from sending messages in supergroups/channels"},{"name":"USER_BLOCKED","codes":"400","description":"User blocked"},{"name":"USER_BOT","codes":"400","description":"Bots can only be admins in channels."},{"name":"USER_BOT_INVALID","codes":"400 403","description":"This method can only be called by a bot"},{"name":"USER_BOT_REQUIRED","codes":"400","description":"This method can only be called by a bot"},{"name":"USER_CHANNELS_TOO_MUCH","codes":"403","description":"One of the users you tried to add is already in too many channels/supergroups"},{"name":"USER_CREATOR","codes":"400","description":"You can't leave this channel, because you're its creator"},{"name":"USER_DEACTIVATED","codes":"401","description":"The user has been deleted/deactivated"},{"name":"USER_DEACTIVATED_BAN","codes":"401","description":"The user has been deleted/deactivated"},{"name":"USER_ID_INVALID","codes":"400","description":"Invalid object ID for a user. Make sure to pass the right types, for instance making sure that the request is designed for users or otherwise look for a different one more suited"},{"name":"USER_INVALID","codes":"400","description":"The given user was invalid"},{"name":"USER_IS_BLOCKED","codes":"400 403","description":"User is blocked"},{"name":"USER_IS_BOT","codes":"400","description":"Bots can't send messages to other bots"},{"name":"USER_KICKED","codes":"400","description":"This user was kicked from this supergroup/channel"},{"name":"USER_MIGRATE_X","codes":"303","description":"The user whose identity is being used to execute queries is associated with DC {new_dc}"},{"name":"USER_NOT_MUTUAL_CONTACT","codes":"400 403","description":"The provided user is not a mutual contact"},{"name":"USER_NOT_PARTICIPANT","codes":"400","description":"The target user is not a member of the specified megagroup or channel"},{"name":"USER_PRIVACY_RESTRICTED","codes":"403","description":"The user's privacy settings do not allow you to do this"},{"name":"USER_RESTRICTED","codes":"403","description":"You're spamreported, you can't create channels or chats."},{"name":"USERPIC_UPLOAD_REQUIRED","codes":"400","description":"You must have a profile picture before using this method"},{"name":"VIDEO_CONTENT_TYPE_INVALID","codes":"400","description":"The video content type is not supported with the given parameters (i.e. supports_streaming)"},{"name":"VIDEO_FILE_INVALID","codes":"400","description":"The given video cannot be used"},{"name":"VIDEO_TITLE_EMPTY","codes":"400","description":""},{"name":"WALLPAPER_FILE_INVALID","codes":"400","description":"The given file cannot be used as a wallpaper"},{"name":"WALLPAPER_INVALID","codes":"400","description":"The input wallpaper was not valid"},{"name":"WALLPAPER_MIME_INVALID","codes":"400","description":""},{"name":"WC_CONVERT_URL_INVALID","codes":"400","description":"WC convert URL invalid"},{"name":"WEBDOCUMENT_MIME_INVALID","codes":"400","description":""},{"name":"WEBDOCUMENT_URL_INVALID","codes":"400","description":"The given URL cannot be used"},{"name":"WEBPAGE_CURL_FAILED","codes":"400","description":"Failure while fetching the webpage with cURL"},{"name":"WEBPAGE_MEDIA_EMPTY","codes":"400","description":"Webpage media empty"},{"name":"WORKER_BUSY_TOO_LONG_RETRY","codes":"500","description":"Telegram workers are too busy to respond immediately"},{"name":"YOU_BLOCKED_USER","codes":"400","description":"You blocked this user"},{"virtual":true,"name":"RPC_TIMEOUT","codes":"408","description":"Timeout of {ms} ms exceeded"},{"virtual":true,"name":"MESSAGE_NOT_FOUND","codes":"404","description":"Message was not found"}] \ No newline at end of file diff --git a/packages/tl/scripts/generate-errors.js b/packages/tl/scripts/generate-errors.js index a6f1e0ed..cf660cec 100644 --- a/packages/tl/scripts/generate-errors.js +++ b/packages/tl/scripts/generate-errors.js @@ -84,6 +84,12 @@ const customErrors = [ name: 'RPC_TIMEOUT', codes: '408', description: 'Timeout of {ms} ms exceeded', + }, + { + virtual: true, + name: 'MESSAGE_NOT_FOUND', + codes: '404', + description: 'Message was not found' } ]