• Middleware that will call handler whenever method RPC method is called.

    This helper exists due to TypeScript limitations not allowing us to properly type the return type without explicit type annotations, for a bit more type-safe and clean code:

    // before
    async (ctx, next) => {
    if (rpc.request._ === 'help.getNearestDc') {
    return {
    _: 'nearestDc',
    country: 'RU',
    thisDc: 2,
    nearestDc: 2,
    } satisfies tl.RpcCallReturn['help.getNearestDc']
    }

    return next(ctx)
    }

    // after
    onMethod('help.getNearestDc', async () => ({
    _: 'nearestDc' as const, // (otherwise ts will infer this as `string` and will complain)
    country: 'RU',
    thisDc: 2,
    nearestDc: 2,
    })

    Type Parameters

    • T extends
          | "test.useConfigSimple"
          | "test.parseInputAppEvent"
          | "invokeWithBusinessConnectionPrefix"
          | "invokeWithGooglePlayIntegrityPrefix"
          | "invokeWithApnsSecretPrefix"
          | "invokeAfterMsg"
          | "invokeAfterMsgs"
          | "initConnection"
          | "invokeWithLayer"
          | "invokeWithoutUpdates"
          | "invokeWithMessagesRange"
          | "invokeWithTakeout"
          | "invokeWithBusinessConnection"
          | "invokeWithGooglePlayIntegrity"
          | "invokeWithApnsSecret"
          | "auth.sendCode"
          | "auth.signUp"
          | "auth.signIn"
          | "auth.logOut"
          | "auth.resetAuthorizations"
          | "auth.exportAuthorization"
          | "auth.importAuthorization"
          | "auth.bindTempAuthKey"
          | "auth.importBotAuthorization"
          | "auth.checkPassword"
          | "auth.requestPasswordRecovery"
          | "auth.recoverPassword"
          | "auth.resendCode"
          | "auth.cancelCode"
          | "auth.dropTempAuthKeys"
          | "auth.exportLoginToken"
          | "auth.importLoginToken"
          | "auth.acceptLoginToken"
          | "auth.checkRecoveryPassword"
          | "auth.importWebTokenAuthorization"
          | "auth.requestFirebaseSms"
          | "auth.resetLoginEmail"
          | "auth.reportMissingCode"
          | "account.registerDevice"
          | "account.unregisterDevice"
          | "account.updateNotifySettings"
          | "account.getNotifySettings"
          | "account.resetNotifySettings"
          | "account.updateProfile"
          | "account.updateStatus"
          | "account.getWallPapers"
          | "account.reportPeer"
          | "account.checkUsername"
          | "account.updateUsername"
          | "account.getPrivacy"
          | "account.setPrivacy"
          | "account.deleteAccount"
          | "account.getAccountTTL"
          | "account.setAccountTTL"
          | "account.sendChangePhoneCode"
          | "account.changePhone"
          | "account.updateDeviceLocked"
          | "account.getAuthorizations"
          | "account.resetAuthorization"
          | "account.getPassword"
          | "account.getPasswordSettings"
          | "account.updatePasswordSettings"
          | "account.sendConfirmPhoneCode"
          | "account.confirmPhone"
          | "account.getTmpPassword"
          | "account.getWebAuthorizations"
          | "account.resetWebAuthorization"
          | "account.resetWebAuthorizations"
          | "account.getAllSecureValues"
          | "account.getSecureValue"
          | "account.saveSecureValue"
          | "account.deleteSecureValue"
          | "account.getAuthorizationForm"
          | "account.acceptAuthorization"
          | "account.sendVerifyPhoneCode"
          | "account.verifyPhone"
          | "account.sendVerifyEmailCode"
          | "account.verifyEmail"
          | "account.initTakeoutSession"
          | "account.finishTakeoutSession"
          | "account.confirmPasswordEmail"
          | "account.resendPasswordEmail"
          | "account.cancelPasswordEmail"
          | "account.getContactSignUpNotification"
          | "account.setContactSignUpNotification"
          | "account.getNotifyExceptions"
          | "account.getWallPaper"
          | "account.uploadWallPaper"
          | "account.saveWallPaper"
          | "account.installWallPaper"
          | "account.resetWallPapers"
          | "account.getAutoDownloadSettings"
          | "account.saveAutoDownloadSettings"
          | "account.uploadTheme"
          | "account.createTheme"
          | "account.updateTheme"
          | "account.saveTheme"
          | "account.installTheme"
          | "account.getTheme"
          | "account.getThemes"
          | "account.setContentSettings"
          | "account.getContentSettings"
          | "account.getMultiWallPapers"
          | "account.getGlobalPrivacySettings"
          | "account.setGlobalPrivacySettings"
          | "account.reportProfilePhoto"
          | "account.resetPassword"
          | "account.declinePasswordReset"
          | "account.getChatThemes"
          | "account.setAuthorizationTTL"
          | "account.changeAuthorizationSettings"
          | "account.getSavedRingtones"
          | "account.saveRingtone"
          | "account.uploadRingtone"
          | "account.updateEmojiStatus"
          | "account.getDefaultEmojiStatuses"
          | "account.getRecentEmojiStatuses"
          | "account.clearRecentEmojiStatuses"
          | "account.reorderUsernames"
          | "account.toggleUsername"
          | "account.getDefaultProfilePhotoEmojis"
          | "account.getDefaultGroupPhotoEmojis"
          | "account.getAutoSaveSettings"
          | "account.saveAutoSaveSettings"
          | "account.deleteAutoSaveExceptions"
          | "account.invalidateSignInCodes"
          | "account.updateColor"
          | "account.getDefaultBackgroundEmojis"
          | "account.getChannelDefaultEmojiStatuses"
          | "account.getChannelRestrictedStatusEmojis"
          | "account.updateBusinessWorkHours"
          | "account.updateBusinessLocation"
          | "account.updateBusinessGreetingMessage"
          | "account.updateBusinessAwayMessage"
          | "account.updateConnectedBot"
          | "account.getConnectedBots"
          | "account.getBotBusinessConnection"
          | "account.updateBusinessIntro"
          | "account.toggleConnectedBotPaused"
          | "account.disablePeerConnectedBot"
          | "account.updateBirthday"
          | "account.createBusinessChatLink"
          | "account.editBusinessChatLink"
          | "account.deleteBusinessChatLink"
          | "account.getBusinessChatLinks"
          | "account.resolveBusinessChatLink"
          | "account.updatePersonalChannel"
          | "account.toggleSponsoredMessages"
          | "account.getReactionsNotifySettings"
          | "account.setReactionsNotifySettings"
          | "users.getUsers"
          | "users.getFullUser"
          | "users.setSecureValueErrors"
          | "users.getIsPremiumRequiredToContact"
          | "contacts.getContactIDs"
          | "contacts.getStatuses"
          | "contacts.getContacts"
          | "contacts.importContacts"
          | "contacts.deleteContacts"
          | "contacts.deleteByPhones"
          | "contacts.block"
          | "contacts.unblock"
          | "contacts.getBlocked"
          | "contacts.search"
          | "contacts.resolveUsername"
          | "contacts.getTopPeers"
          | "contacts.resetTopPeerRating"
          | "contacts.resetSaved"
          | "contacts.getSaved"
          | "contacts.toggleTopPeers"
          | "contacts.addContact"
          | "contacts.acceptContact"
          | "contacts.getLocated"
          | "contacts.blockFromReplies"
          | "contacts.resolvePhone"
          | "contacts.exportContactToken"
          | "contacts.importContactToken"
          | "contacts.editCloseFriends"
          | "contacts.setBlocked"
          | "contacts.getBirthdays"
          | "messages.getMessages"
          | "messages.getDialogs"
          | "messages.getHistory"
          | "messages.search"
          | "messages.readHistory"
          | "messages.deleteHistory"
          | "messages.deleteMessages"
          | "messages.receivedMessages"
          | "messages.setTyping"
          | "messages.sendMessage"
          | "messages.sendMedia"
          | "messages.forwardMessages"
          | "messages.reportSpam"
          | "messages.getPeerSettings"
          | "messages.report"
          | "messages.getChats"
          | "messages.getFullChat"
          | "messages.editChatTitle"
          | "messages.editChatPhoto"
          | "messages.addChatUser"
          | "messages.deleteChatUser"
          | "messages.createChat"
          | "messages.getDhConfig"
          | "messages.requestEncryption"
          | "messages.acceptEncryption"
          | "messages.discardEncryption"
          | "messages.setEncryptedTyping"
          | "messages.readEncryptedHistory"
          | "messages.sendEncrypted"
          | "messages.sendEncryptedFile"
          | "messages.sendEncryptedService"
          | "messages.receivedQueue"
          | "messages.reportEncryptedSpam"
          | "messages.readMessageContents"
          | "messages.getStickers"
          | "messages.getAllStickers"
          | "messages.getWebPagePreview"
          | "messages.exportChatInvite"
          | "messages.checkChatInvite"
          | "messages.importChatInvite"
          | "messages.getStickerSet"
          | "messages.installStickerSet"
          | "messages.uninstallStickerSet"
          | "messages.startBot"
          | "messages.getMessagesViews"
          | "messages.editChatAdmin"
          | "messages.migrateChat"
          | "messages.searchGlobal"
          | "messages.reorderStickerSets"
          | "messages.getDocumentByHash"
          | "messages.getSavedGifs"
          | "messages.saveGif"
          | "messages.getInlineBotResults"
          | "messages.setInlineBotResults"
          | "messages.sendInlineBotResult"
          | "messages.getMessageEditData"
          | "messages.editMessage"
          | "messages.editInlineBotMessage"
          | "messages.getBotCallbackAnswer"
          | "messages.setBotCallbackAnswer"
          | "messages.getPeerDialogs"
          | "messages.saveDraft"
          | "messages.getAllDrafts"
          | "messages.getFeaturedStickers"
          | "messages.readFeaturedStickers"
          | "messages.getRecentStickers"
          | "messages.saveRecentSticker"
          | "messages.clearRecentStickers"
          | "messages.getArchivedStickers"
          | "messages.getMaskStickers"
          | "messages.getAttachedStickers"
          | "messages.setGameScore"
          | "messages.setInlineGameScore"
          | "messages.getGameHighScores"
          | "messages.getInlineGameHighScores"
          | "messages.getCommonChats"
          | "messages.getWebPage"
          | "messages.toggleDialogPin"
          | "messages.reorderPinnedDialogs"
          | "messages.getPinnedDialogs"
          | "messages.setBotShippingResults"
          | "messages.setBotPrecheckoutResults"
          | "messages.uploadMedia"
          | "messages.sendScreenshotNotification"
          | "messages.getFavedStickers"
          | "messages.faveSticker"
          | "messages.getUnreadMentions"
          | "messages.readMentions"
          | "messages.getRecentLocations"
          | "messages.sendMultiMedia"
          | "messages.uploadEncryptedFile"
          | "messages.searchStickerSets"
          | "messages.getSplitRanges"
          | "messages.markDialogUnread"
          | "messages.getDialogUnreadMarks"
          | "messages.clearAllDrafts"
          | "messages.updatePinnedMessage"
          | "messages.sendVote"
          | "messages.getPollResults"
          | "messages.getOnlines"
          | "messages.editChatAbout"
          | "messages.editChatDefaultBannedRights"
          | "messages.getEmojiKeywords"
          | "messages.getEmojiKeywordsDifference"
          | "messages.getEmojiKeywordsLanguages"
          | "messages.getEmojiURL"
          | "messages.getSearchCounters"
          | "messages.requestUrlAuth"
          | "messages.acceptUrlAuth"
          | "messages.hidePeerSettingsBar"
          | "messages.getScheduledHistory"
          | "messages.getScheduledMessages"
          | "messages.sendScheduledMessages"
          | "messages.deleteScheduledMessages"
          | "messages.getPollVotes"
          | "messages.toggleStickerSets"
          | "messages.getDialogFilters"
          | "messages.getSuggestedDialogFilters"
          | "messages.updateDialogFilter"
          | "messages.updateDialogFiltersOrder"
          | "messages.getOldFeaturedStickers"
          | "messages.getReplies"
          | "messages.getDiscussionMessage"
          | "messages.readDiscussion"
          | "messages.unpinAllMessages"
          | "messages.deleteChat"
          | "messages.deletePhoneCallHistory"
          | "messages.checkHistoryImport"
          | "messages.initHistoryImport"
          | "messages.uploadImportedMedia"
          | "messages.startHistoryImport"
          | "messages.getExportedChatInvites"
          | "messages.getExportedChatInvite"
          | "messages.editExportedChatInvite"
          | "messages.deleteRevokedExportedChatInvites"
          | "messages.deleteExportedChatInvite"
          | "messages.getAdminsWithInvites"
          | "messages.getChatInviteImporters"
          | "messages.setHistoryTTL"
          | "messages.checkHistoryImportPeer"
          | "messages.setChatTheme"
          | "messages.getMessageReadParticipants"
          | "messages.getSearchResultsCalendar"
          | "messages.getSearchResultsPositions"
          | "messages.hideChatJoinRequest"
          | "messages.hideAllChatJoinRequests"
          | "messages.toggleNoForwards"
          | "messages.saveDefaultSendAs"
          | "messages.sendReaction"
          | "messages.getMessagesReactions"
          | "messages.getMessageReactionsList"
          | "messages.setChatAvailableReactions"
          | "messages.getAvailableReactions"
          | "messages.setDefaultReaction"
          | "messages.translateText"
          | "messages.getUnreadReactions"
          | "messages.readReactions"
          | "messages.searchSentMedia"
          | "messages.getAttachMenuBots"
          | "messages.getAttachMenuBot"
          | "messages.toggleBotInAttachMenu"
          | "messages.requestWebView"
          | "messages.prolongWebView"
          | "messages.requestSimpleWebView"
          | "messages.sendWebViewResultMessage"
          | "messages.sendWebViewData"
          | "messages.transcribeAudio"
          | "messages.rateTranscribedAudio"
          | "messages.getCustomEmojiDocuments"
          | "messages.getEmojiStickers"
          | "messages.getFeaturedEmojiStickers"
          | "messages.reportReaction"
          | "messages.getTopReactions"
          | "messages.getRecentReactions"
          | "messages.clearRecentReactions"
          | "messages.getExtendedMedia"
          | "messages.setDefaultHistoryTTL"
          | "messages.getDefaultHistoryTTL"
          | "messages.sendBotRequestedPeer"
          | "messages.getEmojiGroups"
          | "messages.getEmojiStatusGroups"
          | "messages.getEmojiProfilePhotoGroups"
          | "messages.searchCustomEmoji"
          | "messages.togglePeerTranslations"
          | "messages.getBotApp"
          | "messages.requestAppWebView"
          | "messages.setChatWallPaper"
          | "messages.searchEmojiStickerSets"
          | "messages.getSavedDialogs"
          | "messages.getSavedHistory"
          | "messages.deleteSavedHistory"
          | "messages.getPinnedSavedDialogs"
          | "messages.toggleSavedDialogPin"
          | "messages.reorderPinnedSavedDialogs"
          | "messages.getSavedReactionTags"
          | "messages.updateSavedReactionTag"
          | "messages.getDefaultTagReactions"
          | "messages.getOutboxReadDate"
          | "messages.getQuickReplies"
          | "messages.reorderQuickReplies"
          | "messages.checkQuickReplyShortcut"
          | "messages.editQuickReplyShortcut"
          | "messages.deleteQuickReplyShortcut"
          | "messages.getQuickReplyMessages"
          | "messages.sendQuickReplyMessages"
          | "messages.deleteQuickReplyMessages"
          | "messages.toggleDialogFilterTags"
          | "messages.getMyStickers"
          | "messages.getEmojiStickerGroups"
          | "messages.getAvailableEffects"
          | "messages.editFactCheck"
          | "messages.deleteFactCheck"
          | "messages.getFactCheck"
          | "messages.requestMainWebView"
          | "messages.sendPaidReaction"
          | "messages.togglePaidReactionPrivacy"
          | "messages.getPaidReactionPrivacy"
          | "updates.getState"
          | "updates.getDifference"
          | "updates.getChannelDifference"
          | "photos.updateProfilePhoto"
          | "photos.uploadProfilePhoto"
          | "photos.deletePhotos"
          | "photos.getUserPhotos"
          | "photos.uploadContactProfilePhoto"
          | "upload.saveFilePart"
          | "upload.getFile"
          | "upload.saveBigFilePart"
          | "upload.getWebFile"
          | "upload.getCdnFile"
          | "upload.reuploadCdnFile"
          | "upload.getCdnFileHashes"
          | "upload.getFileHashes"
          | "help.getConfig"
          | "help.getNearestDc"
          | "help.getAppUpdate"
          | "help.getInviteText"
          | "help.getSupport"
          | "help.setBotUpdatesStatus"
          | "help.getCdnConfig"
          | "help.getRecentMeUrls"
          | "help.getTermsOfServiceUpdate"
          | "help.acceptTermsOfService"
          | "help.getDeepLinkInfo"
          | "help.getAppConfig"
          | "help.saveAppLog"
          | "help.getPassportConfig"
          | "help.getSupportName"
          | "help.getUserInfo"
          | "help.editUserInfo"
          | "help.getPromoData"
          | "help.hidePromoData"
          | "help.dismissSuggestion"
          | "help.getCountriesList"
          | "help.getPremiumPromo"
          | "help.getPeerColors"
          | "help.getPeerProfileColors"
          | "help.getTimezonesList"
          | "channels.readHistory"
          | "channels.deleteMessages"
          | "channels.reportSpam"
          | "channels.getMessages"
          | "channels.getParticipants"
          | "channels.getParticipant"
          | "channels.getChannels"
          | "channels.getFullChannel"
          | "channels.createChannel"
          | "channels.editAdmin"
          | "channels.editTitle"
          | "channels.editPhoto"
          | "channels.checkUsername"
          | "channels.updateUsername"
          | "channels.joinChannel"
          | "channels.leaveChannel"
          | "channels.inviteToChannel"
          | "channels.deleteChannel"
          | "channels.exportMessageLink"
          | "channels.toggleSignatures"
          | "channels.getAdminedPublicChannels"
          | "channels.editBanned"
          | "channels.getAdminLog"
          | "channels.setStickers"
          | "channels.readMessageContents"
          | "channels.deleteHistory"
          | "channels.togglePreHistoryHidden"
          | "channels.getLeftChannels"
          | "channels.getGroupsForDiscussion"
          | "channels.setDiscussionGroup"
          | "channels.editCreator"
          | "channels.editLocation"
          | "channels.toggleSlowMode"
          | "channels.getInactiveChannels"
          | "channels.convertToGigagroup"
          | "channels.viewSponsoredMessage"
          | "channels.getSponsoredMessages"
          | "channels.getSendAs"
          | "channels.deleteParticipantHistory"
          | "channels.toggleJoinToSend"
          | "channels.toggleJoinRequest"
          | "channels.reorderUsernames"
          | "channels.toggleUsername"
          | "channels.deactivateAllUsernames"
          | "channels.toggleForum"
          | "channels.createForumTopic"
          | "channels.getForumTopics"
          | "channels.getForumTopicsByID"
          | "channels.editForumTopic"
          | "channels.updatePinnedForumTopic"
          | "channels.deleteTopicHistory"
          | "channels.reorderPinnedForumTopics"
          | "channels.toggleAntiSpam"
          | "channels.reportAntiSpamFalsePositive"
          | "channels.toggleParticipantsHidden"
          | "channels.clickSponsoredMessage"
          | "channels.updateColor"
          | "channels.toggleViewForumAsMessages"
          | "channels.getChannelRecommendations"
          | "channels.updateEmojiStatus"
          | "channels.setBoostsToUnblockRestrictions"
          | "channels.setEmojiStickers"
          | "channels.reportSponsoredMessage"
          | "channels.restrictSponsoredMessages"
          | "channels.searchPosts"
          | "bots.sendCustomRequest"
          | "bots.answerWebhookJSONQuery"
          | "bots.setBotCommands"
          | "bots.resetBotCommands"
          | "bots.getBotCommands"
          | "bots.setBotMenuButton"
          | "bots.getBotMenuButton"
          | "bots.setBotBroadcastDefaultAdminRights"
          | "bots.setBotGroupDefaultAdminRights"
          | "bots.setBotInfo"
          | "bots.getBotInfo"
          | "bots.reorderUsernames"
          | "bots.toggleUsername"
          | "bots.canSendMessage"
          | "bots.allowSendMessage"
          | "bots.invokeWebViewCustomMethod"
          | "bots.getPopularAppBots"
          | "bots.addPreviewMedia"
          | "bots.editPreviewMedia"
          | "bots.deletePreviewMedia"
          | "bots.reorderPreviewMedias"
          | "bots.getPreviewInfo"
          | "bots.getPreviewMedias"
          | "payments.getPaymentForm"
          | "payments.getPaymentReceipt"
          | "payments.validateRequestedInfo"
          | "payments.sendPaymentForm"
          | "payments.getSavedInfo"
          | "payments.clearSavedInfo"
          | "payments.getBankCardData"
          | "payments.exportInvoice"
          | "payments.assignAppStoreTransaction"
          | "payments.assignPlayMarketTransaction"
          | "payments.canPurchasePremium"
          | "payments.getPremiumGiftCodeOptions"
          | "payments.checkGiftCode"
          | "payments.applyGiftCode"
          | "payments.getGiveawayInfo"
          | "payments.launchPrepaidGiveaway"
          | "payments.getStarsTopupOptions"
          | "payments.getStarsStatus"
          | "payments.getStarsTransactions"
          | "payments.sendStarsForm"
          | "payments.refundStarsCharge"
          | "payments.getStarsRevenueStats"
          | "payments.getStarsRevenueWithdrawalUrl"
          | "payments.getStarsRevenueAdsAccountUrl"
          | "payments.getStarsTransactionsByID"
          | "payments.getStarsGiftOptions"
          | "payments.getStarsSubscriptions"
          | "payments.changeStarsSubscription"
          | "payments.fulfillStarsSubscription"
          | "payments.getStarsGiveawayOptions"
          | "payments.getStarGifts"
          | "payments.getUserStarGifts"
          | "payments.saveStarGift"
          | "payments.convertStarGift"
          | "stickers.createStickerSet"
          | "stickers.removeStickerFromSet"
          | "stickers.changeStickerPosition"
          | "stickers.addStickerToSet"
          | "stickers.setStickerSetThumb"
          | "stickers.checkShortName"
          | "stickers.suggestShortName"
          | "stickers.changeSticker"
          | "stickers.renameStickerSet"
          | "stickers.deleteStickerSet"
          | "stickers.replaceSticker"
          | "phone.getCallConfig"
          | "phone.requestCall"
          | "phone.acceptCall"
          | "phone.confirmCall"
          | "phone.receivedCall"
          | "phone.discardCall"
          | "phone.setCallRating"
          | "phone.saveCallDebug"
          | "phone.sendSignalingData"
          | "phone.createGroupCall"
          | "phone.joinGroupCall"
          | "phone.leaveGroupCall"
          | "phone.inviteToGroupCall"
          | "phone.discardGroupCall"
          | "phone.toggleGroupCallSettings"
          | "phone.getGroupCall"
          | "phone.getGroupParticipants"
          | "phone.checkGroupCall"
          | "phone.toggleGroupCallRecord"
          | "phone.editGroupCallParticipant"
          | "phone.editGroupCallTitle"
          | "phone.getGroupCallJoinAs"
          | "phone.exportGroupCallInvite"
          | "phone.toggleGroupCallStartSubscription"
          | "phone.startScheduledGroupCall"
          | "phone.saveDefaultGroupCallJoinAs"
          | "phone.joinGroupCallPresentation"
          | "phone.leaveGroupCallPresentation"
          | "phone.getGroupCallStreamChannels"
          | "phone.getGroupCallStreamRtmpUrl"
          | "phone.saveCallLog"
          | "langpack.getLangPack"
          | "langpack.getStrings"
          | "langpack.getDifference"
          | "langpack.getLanguages"
          | "langpack.getLanguage"
          | "folders.editPeerFolders"
          | "stats.getBroadcastStats"
          | "stats.loadAsyncGraph"
          | "stats.getMegagroupStats"
          | "stats.getMessagePublicForwards"
          | "stats.getMessageStats"
          | "stats.getStoryStats"
          | "stats.getStoryPublicForwards"
          | "stats.getBroadcastRevenueStats"
          | "stats.getBroadcastRevenueWithdrawalUrl"
          | "stats.getBroadcastRevenueTransactions"
          | "chatlists.exportChatlistInvite"
          | "chatlists.deleteExportedInvite"
          | "chatlists.editExportedInvite"
          | "chatlists.getExportedInvites"
          | "chatlists.checkChatlistInvite"
          | "chatlists.joinChatlistInvite"
          | "chatlists.getChatlistUpdates"
          | "chatlists.joinChatlistUpdates"
          | "chatlists.hideChatlistUpdates"
          | "chatlists.getLeaveChatlistSuggestions"
          | "chatlists.leaveChatlist"
          | "stories.canSendStory"
          | "stories.sendStory"
          | "stories.editStory"
          | "stories.deleteStories"
          | "stories.togglePinned"
          | "stories.getAllStories"
          | "stories.getPinnedStories"
          | "stories.getStoriesArchive"
          | "stories.getStoriesByID"
          | "stories.toggleAllStoriesHidden"
          | "stories.readStories"
          | "stories.incrementStoryViews"
          | "stories.getStoryViewsList"
          | "stories.getStoriesViews"
          | "stories.exportStoryLink"
          | "stories.report"
          | "stories.activateStealthMode"
          | "stories.sendReaction"
          | "stories.getPeerStories"
          | "stories.getAllReadPeerStories"
          | "stories.getPeerMaxIDs"
          | "stories.getChatsToSend"
          | "stories.togglePeerStoriesHidden"
          | "stories.getStoryReactionsList"
          | "stories.togglePinnedToTop"
          | "stories.searchPosts"
          | "premium.getBoostsList"
          | "premium.getMyBoosts"
          | "premium.applyBoost"
          | "premium.getBoostsStatus"
          | "premium.getUserBoosts"
          | "smsjobs.isEligibleToJoin"
          | "smsjobs.join"
          | "smsjobs.leave"
          | "smsjobs.updateSettings"
          | "smsjobs.getStatus"
          | "smsjobs.getSmsJob"
          | "smsjobs.finishJob"
          | "fragment.getCollectibleInfo"
          | "mtcute.customMethod"

    Parameters

    Returns RpcCallMiddleware