diff --git a/.github/PULL_REQUEST_TEMPLATE.md b/.github/PULL_REQUEST_TEMPLATE.md index 3ea58f7..067cd0a 100644 --- a/.github/PULL_REQUEST_TEMPLATE.md +++ b/.github/PULL_REQUEST_TEMPLATE.md @@ -6,5 +6,5 @@ Explain the modifications and motivation. - [ ] Tested locally with `npm run build` and verified output. - [ ] Responsive design verified on mobile (390px) and desktop (1440px). -- [ ] No comments added in source files. +- [ ] Documentation and code style verified. - [ ] Accessibility and contrast verified. diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index f615a61..2a76d2b 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -29,4 +29,4 @@ We welcome contributions to the official Hotaru web portal and documentation man - Maintain the dark monochrome aesthetic. - Preserve responsive layout across mobile and desktop breakpoints. -- Hotaru enforces a strict policy of zero comments in code. +- Ensure all technical documentation accurately reflects the Hotaru codebase. diff --git a/LICENSE b/LICENSE index 9bdd9a2..0ad25db 100644 --- a/LICENSE +++ b/LICENSE @@ -1,21 +1,661 @@ -MIT License - -Copyright (c) 2026 Hotaru Project - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. diff --git a/README.md b/README.md index 4da3cdf..52c4c97 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,5 @@
- Hotaru banner + Hotaru banner

[![React][react-badge]][react-url] @@ -8,41 +8,85 @@
[![GitHub Pages][pages-badge]][pages-url] [![License][license-badge]][license-url] -[![Hotaru][hotaru-badge]][hotaru-url] +[![Hotaru Userbot][hotaru-badge]][hotaru-url] +[![Telegram][telegram-badge]][telegram-url] -

Official web portal, interactive 3D quasar visualizer, and Hotaru developer manual for the Hotaru Telegram userbot.

+

Official web portal, interactive 3D quasar visualization, and documentation for Hotaru.

+> [!TIP] +> Visit the live portal and interactive documentation at **[hotaruproject.github.io](https://hotaruproject.github.io/)**. + > [!NOTE] -> HotaruWeb serves as the interactive landing page and documentation hub for Hotaru, featuring a relativistic WebGL quasar raytracer, bilingual engineering manual, and downloadable agent skill. +> HotaruWeb serves as the public landing page and documentation manual for the [Hotaru](https://github.com/HotaruProject/Hotaru) Telegram userbot. It features a real-time WebGL raymarched black hole, a dedicated Fumadocs documentation view with all 292 extended MTProto methods, and downloadable AI coding agent instructions. -## Live site +## Live Deployment -The web portal is deployed to GitHub Pages: +- **Web Portal**: [https://hotaruproject.github.io/](https://hotaruproject.github.io/) +- **Documentation Engine**: [https://hotaruproject.github.io/#docs](https://hotaruproject.github.io/#docs) +- **AI Agent Skill**: [https://hotaruproject.github.io/skill/SKILL.md](https://hotaruproject.github.io/skill/SKILL.md) -**[https://hotaruproject.github.io/HotaruWeb/](https://hotaruproject.github.io/HotaruWeb/)** +## Key Features -## Features +- **Relativistic 3D Quasar**: WebGL raymarched black hole with photon sphere, accretion disk turbulence, gravitational lensing, and interactive orbital camera controls. +- **Dedicated Documentation Engine**: Fumadocs-style full-page interface featuring 10 deep developer chapters and live search across all 292 extended MTProto methods. +- **Interactive MTProto Methods Explorer**: Namespace filters (`messages`, `channels`, `account`, `stories`, `contacts`, `stickers`, `stats`), parameter specification tables, and one-click code snippet copying. +- **Liquid Glass Interface**: Apple-style optical glassmorphism with dynamic rim highlights, specular top sheen, and tactile copy buttons with emerald feedback. +- **Vector & Limen Aesthetics**: Minimalist floating glass pill navigation, deep obsidian cards (`#08090f`), and fluid typography. +- **Bilingual Support**: Instant runtime switching between English (`en`) and Russian (`ru`). +- **Mobile Containment**: Strict viewport bounds prevention (`overflow-x-hidden`, responsive flex-wrap, isolated horizontal code blocks). -- **Relativistic 3D quasar**: Real-time WebGL raymarched black hole with interactive camera controls (drag to orbit, wheel to zoom), gravitational bending, photon ring, and relativistic Doppler beaming. -- **Hotaru developer manual**: Comprehensive documentation covering Linux namespace sandboxing, the `.hmod` manifest schema, and complete `ctx` API method specifications. -- **Bilingual interface**: Instant runtime language switching between English and Russian across all guides and specifications. -- **Agent skill download**: Integrated `SKILL.md` distribution ready for use with AI coding assistants (Antigravity, Cursor, Claude Code, ChatGPT). -- **Responsive design**: Layout calibrated for mobile screens (390px), tablets, and ultra-wide displays. +## Project Structure -## Local development +``` +HotaruWeb/ +├── .github/ +│ ├── workflows/ +│ │ ├── deploy.yml # GitHub Pages deployment pipeline +│ │ └── codeql.yml # CodeQL security scanning +│ ├── ISSUE_TEMPLATE/ +│ └── PULL_REQUEST_TEMPLATE.md +├── public/ +│ └── skill/ +│ └── SKILL.md # Downloadable master AI agent skill +├── src/ +│ ├── components/ +│ │ ├── AgentSkillSection.jsx +│ │ ├── Architecture.jsx +│ │ ├── Documentation.jsx +│ │ ├── Footer.jsx +│ │ ├── FumadocsView.jsx # Dedicated documentation engine +│ │ ├── GithubIcon.jsx +│ │ ├── Hero.jsx # Hero with Liquid Glass install card +│ │ ├── ModulePlayground.jsx +│ │ ├── Navbar.jsx # Floating glass pill navigation +│ │ └── QuasarScene.jsx # WebGL raymarched quasar shader +│ ├── data/ +│ │ ├── catalog.js # 292 extended MTProto methods +│ │ ├── content.js # Localized interface strings +│ │ └── docs.js # In-depth developer chapters +│ ├── App.jsx +│ ├── index.css # Base styles & Liquid Glass utilities +│ └── main.jsx +├── index.html +├── package.json +├── tailwind.config.js +└── vite.config.js +``` + +## Local Development ### Prerequisites - Node.js 20 or newer - npm 10 or newer -### Getting started +### Setup & Running 1. Clone the repository: ```bash - git clone https://github.com/HotaruProject/HotaruWeb.git - cd HotaruWeb + git clone https://github.com/HotaruProject/hotaruproject.github.io.git + cd hotaruproject.github.io ``` 2. Install dependencies: @@ -50,7 +94,7 @@ The web portal is deployed to GitHub Pages: npm install ``` -3. Start local development server: +3. Start development server: ```bash npm run dev ``` @@ -60,55 +104,36 @@ The web portal is deployed to GitHub Pages: npm run build ``` +5. Preview production build locally: + ```bash + npm run preview + ``` + The compiled assets are generated in `dist/`. -## Project structure +## Available Scripts -``` -HotaruWeb/ -├── .github/ -│ ├── ISSUE_TEMPLATE/ -│ ├── PULL_REQUEST_TEMPLATE.md -│ └── workflows/ -│ └── deploy.yml -├── public/ -│ └── skill/ -│ └── SKILL.md -├── src/ -│ ├── components/ -│ │ ├── AgentSkillSection.jsx -│ │ ├── Architecture.jsx -│ │ ├── Documentation.jsx -│ │ ├── Footer.jsx -│ │ ├── GithubIcon.jsx -│ │ ├── Hero.jsx -│ │ ├── ModulePlayground.jsx -│ │ ├── Navbar.jsx -│ │ └── QuasarScene.jsx -│ ├── data/ -│ │ └── content.js -│ ├── App.jsx -│ ├── index.css -│ └── main.jsx -├── index.html -├── package.json -├── tailwind.config.js -└── vite.config.js -``` +| Script | Command | Description | +| --- | --- | --- | +| `dev` | `vite` | Starts local Vite dev server with hot module replacement | +| `build` | `vite build` | Compiles optimized production bundle into `dist/` | +| `preview` | `vite preview` | Serves production build locally for verification | ## License -This project is open-source software licensed under the MIT License. +This project is open-source software licensed under the GNU Affero General Public License v3.0 (AGPL-3.0). See [LICENSE](LICENSE) for details. -[react-badge]: https://img.shields.io/badge/React-19.0-black?style=for-the-badge&logo=react +[react-badge]: https://img.shields.io/badge/React-19.0-333333.svg?style=for-the-badge&logo=react&logoColor=61DAFB [react-url]: https://react.dev/ -[vite-badge]: https://img.shields.io/badge/Vite-6.0-black?style=for-the-badge&logo=vite +[vite-badge]: https://img.shields.io/badge/Vite-6.0-646CFF.svg?style=for-the-badge&logo=vite&logoColor=white [vite-url]: https://vite.dev/ -[tailwind-badge]: https://img.shields.io/badge/Tailwind_CSS-3.4-black?style=for-the-badge&logo=tailwindcss +[tailwind-badge]: https://img.shields.io/badge/Tailwind_CSS-3.4-38B2AC.svg?style=for-the-badge&logo=tailwindcss&logoColor=white [tailwind-url]: https://tailwindcss.com/ -[pages-badge]: https://img.shields.io/badge/GitHub_Pages-Active-emerald?style=for-the-badge&logo=githubpages -[pages-url]: https://hotaruproject.github.io/HotaruWeb/ -[license-badge]: https://img.shields.io/badge/License-MIT-white?style=for-the-badge -[license-url]: https://github.com/HotaruProject/HotaruWeb/blob/main/LICENSE -[hotaru-badge]: https://img.shields.io/badge/Hotaru_Core-Repository-black?style=for-the-badge&logo=telegram +[pages-badge]: https://img.shields.io/badge/GitHub_Pages-Active-emerald.svg?style=for-the-badge&logo=githubpages&logoColor=white +[pages-url]: https://hotaruproject.github.io/ +[license-badge]: https://img.shields.io/badge/License-AGPL_3.0-blue.svg?style=for-the-badge +[license-url]: LICENSE +[hotaru-badge]: https://img.shields.io/badge/Hotaru_Userbot-Repository-000000.svg?style=for-the-badge&logo=telegram&logoColor=white [hotaru-url]: https://github.com/HotaruProject/Hotaru +[telegram-badge]: https://img.shields.io/badge/Telegram-Community-2CA5E0.svg?style=for-the-badge&logo=telegram&logoColor=white +[telegram-url]: https://t.me/hotaru_ub diff --git a/SKILL.md b/SKILL.md index cc3a5a7..5e4de57 100644 --- a/SKILL.md +++ b/SKILL.md @@ -1,1055 +1,8472 @@ ---- -name: hotaru-module-developer -description: Exhaustive engineering specification and agent reference for authoring secure .hmod modules for the Hotaru Telegram userbot with Linux namespace sandboxing, capability enforcement, and complete ModuleContext API reference. ---- - -# Hotaru Module Developer Reference & Agent Skill - -Hotaru is a security-first Telegram userbot operating from a primary user account. Unlike legacy userbot platforms that load third-party scripts directly into the interpreter alongside Telegram authentication sessions, Hotaru enforces process isolation and hardware-assisted capability sandboxing. - -Modules (.hmod files) execute under strict Linux namespace boundaries: -- CLONE_NEWNS (Mount Namespace): Private filesystem table. /root, /home, /etc, sanctuary/ are concealed or read-only. Temporary files reside in ephemeral tmpfs. -- CLONE_NEWIPC (IPC Namespace): Isolated message queues and shared memory. -- CLONE_NEWUTS (Hostname Namespace): Isolated hostname identifiers. -- CLONE_NEWNET (Network Namespace): Network stack isolation. Modules without the 'net' capability have only a down loopback device. -- Privilege Dropping: Effective UID/GID set to nobody/nogroup (65534). prctl(PR_SET_NO_NEW_PRIVS, 1) enforced. -- Zero Comments Rule: Hotaru production code and .hmod modules must contain zero comments. - -## 1. Core Architecture & Linux Namespace Isolation - -Hotaru is a security-first Telegram userbot operating from a primary user account. Unlike legacy userbot platforms that load third-party scripts directly into the interpreter alongside Telegram authentication sessions, Hotaru enforces process isolation and hardware-assisted capability sandboxing. - -### Subsystem Topology - -The Hotaru repository is divided into four distinct security tiers: - -1. hotaru/ (Kernel Core): -The privileged supervisor managing account sessions, the encrypted master vault (AES-GCM), event dispatching, command registries, and interactive screen rendering. It never executes unverified third-party code in its process space. - -2. relay/ (Capability Firewall): -The security boundary mediating all communication between external modules and the Telegram MTProto transport. The relay contains capability definitions (relay/caps.py), network egress proxies (relay/proxies.py), filesystem isolation gates (relay/files.py), and the RPC denylist (relay/denylist.py). - -3. constellations/ (Built-in Modules): -System extensions implemented in the .hmod format (accounts, acl, backups, catalyst, executor, genesis, help, info, logger, power, settings, shield, singularity, translations, updater). Built-in modules are core components and their triggers are reserved. - -4. sanctuary/ (Private Runtime State): -Encrypted user data directory containing session credentials (sanctuary/hotaru.vault), SQLite state databases, and audit logs. This directory is strictly inaccessible to third-party modules. - -### Linux Namespace Isolation Model - -When Hotaru loads a third-party .hmod module, it launches an isolated worker process configured with four Linux kernel namespaces: - -• CLONE_NEWNS (Mount Namespace): -The worker process receives a private mount table. Critical directories (/root, /home, /etc, /proc/keys, and sanctuary/) are either concealed or mounted read-only. Temporary files reside in an ephemeral tmpfs mount discarded on process exit. - -• CLONE_NEWIPC (IPC Namespace): -Isolates System V IPC and POSIX message queues, preventing shared-memory snooping or signal hijacking between modules. - -• CLONE_NEWUTS (Hostname Namespace): -Isolates UTS system identifiers and hostname information. - -• CLONE_NEWNET (Network Namespace): -Isolates the network stack. Unless a module explicitly declares the 'net' capability in its manifest, its network namespace contains only a down loopback device. Raw socket calls, DNS queries, and HTTP requests fail at the OS syscall boundary with ENETUNREACH or EPERM. - -### Privilege Dropping & Syscall Control - -Before executing module code, the worker drops root privileges: -• Switches effective UID to nobody (65534) and GID to nogroup (65534). -• Enforces prctl(PR_SET_NO_NEW_PRIVS, 1) to prevent privilege escalation via setuid binaries. -• Channels all I/O through unidirectional UNIX pipes and typed JSON/TLV RPC serialization. - -## 2. The .hmod Module Specification & Lifecycle - -A Hotaru module is a self-contained Python source file ending with the .hmod extension. The runtime loads modules dynamically through the sandboxed runner. - -### Manifest Schema: HOTARU Dictionary - -Every .hmod module must expose a top-level module dictionary named HOTARU: - -```python -from __future__ import annotations -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from hotaru.response import ModuleContext - -async def qr_command(ctx: ModuleContext) -> None: - text = ctx.raw_args.strip() - if not text: - await ctx.respond(ctx.t("missing_text")) - return - url = f"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data={text}" - response = await ctx.net(url) - await ctx.reply_photo(response.content, caption=ctx.t("generated")) - -HOTARU = { - "id": "qr_tool", - "name": "QR Generator", - "version": "1.0.0", - "author": "Security Engineering", - "description": "Renders high resolution QR codes directly in chat.", - "capabilities": ["mt", "net"], - "commands": { - "qr": qr_command, - }, - "lexicon": { - "en": { - "missing_text": "Please provide text or a URL after .qr", - "generated": "Here is your generated QR code.", - }, - "ru": { - "missing_text": "Укажите текст или ссылку после .qr", - "generated": "Ваш QR-код успешно сгенерирован.", - }, - }, -} -``` - -### Manifest Fields Reference - -• id (str, required): Unique lowercase identifier containing alphanumeric characters and underscores (e.g. 'qr_tool', 'notes_mgr', 'crypto_ticker'). -• name (str, required): Human-readable display name. -• version (str, required): Semantic version string (MAJOR.MINOR.PATCH). -• author (str, optional): Author handle or organization. -• description (str, optional): Functional summary of the module. -• capabilities (list[str], required): Set of hardware and network capabilities requested by the module. -• commands (dict[str, Callable], required): Mapping of command triggers to asynchronous handler coroutines. Every handler receives ctx: ModuleContext as its single argument. -• tasks (dict[str, Callable], optional): Long-running background coroutines supervised by the core engine. -• lexicon (dict[str, dict[str, str]], optional): Localization dictionary supporting 'en', 'ru', 'uk', 'ja', 'kz', and 'zh'. - -### Reserved Kernel Triggers - -Hotaru reserves all command triggers utilized by built-in constellation modules. A third-party module attempting to bind any of the following triggers will fail validation at load time: -accounts, acl, backups, catalyst, executor, genesis, help, info, logger, power, settings, shield, singularity, translations, updater, ping, dash, restart, config, backup. - -## 3. Capability System & RPC Firewall - -Hotaru adheres to the principle of least privilege. By default, an isolated module has zero permissions: no network egress, no filesystem read or write outside its tmpfs mount, and no direct MTProto invocation. - -### Available Capabilities - -1. mt: -Grants mediated access to Telegram MTProto RPC calls via ctx.mt(method, **kwargs) and high-level messaging helpers. All RPC calls are intercepted by relay/firewall.py and verified against relay/denylist.py. - -2. net: -Enables the network namespace egress interface. Allows outgoing HTTP, HTTPS, and TCP socket requests through ctx.net(url) and ctx.stream(host, port). Modules lacking this capability cannot communicate over the Internet. - -3. state: -Provides persistent key-value storage scoped strictly to the module id. Backed by SQLite in a secured namespace. Modules cannot inspect or modify state entries belonging to other modules. - -4. files: -Grants read and write access inside the module's ephemeral tmpfs scratch directory. Path traversal attempts (such as ../../sanctuary) are trapped and terminated with a security exception. - -5. accounts: -Allows read-only introspection of configured userbot accounts via ctx.accounts. - -6. screens: -Enables the interactive UI screen rendering engine (ctx.screens) for terminal and message-based navigation. - -### The RPC Denylist - -When a module with the 'mt' capability issues raw RPC calls, relay/denylist.py evaluates the method name against destructive Telegram operations. The following methods are strictly forbidden: - -• Authentication and session revocation: -auth.logOut, auth.resetAuthorizations, auth.dropTempAuthKeys - -• Account destruction: -account.deleteAccount - -• Two-factor password modification: -account.updatePasswordSettings - -If a module attempts to invoke a denylisted method, the relay immediately intercepts the packet, drops the worker process, logs the violation, and revokes all module capabilities. - -## 4. ModuleContext: Complete Properties Catalog - -The ModuleContext instance passed to command handlers and background tasks provides real-time event metadata and execution state. - -### Properties Reference Table - -• ctx.module_id -> str -Returns the unique identifier of the executing module. -Example: -assert ctx.module_id == "qr_tool" - -• ctx.chat_id -> int -Telegram ID of the dialog, group, or channel where the command was triggered. -Example: -chat = ctx.chat_id - -• ctx.sender_id / ctx.user_id -> int | None -Telegram user ID of the individual who sent the triggering message. Returns None if the message originated from an anonymous channel. -Example: -sender = ctx.sender_id or 0 - -• ctx.topic_id -> int | None -Thread ID when the message is posted inside a forum supergroup topic. Returns None in regular chats. -Example: -if ctx.topic_id is not None: - await ctx.respond(f"Executed in topic {ctx.topic_id}") - -• ctx.is_me / ctx.out -> bool -Boolean indicating whether the triggering message was sent by the userbot account itself. -Example: -if not ctx.is_me: - return - -• ctx.message -> ModuleMessage -The underlying message object containing text, entities, reply references, and raw flags. -Example: -raw_id = ctx.message.id - -• ctx.has_media -> bool -Evaluates to True if the triggering message contains an attached photo, video, document, audio, sticker, voice note, or animation. -Example: -if not ctx.has_media: - await ctx.respond("Please attach a file.") - return - -• ctx.media / ctx.attachment -> Attachment | None -Represents the media payload attached to the current message. Exposes .file_id, .size, .mime_type, and .filename. -Example: -if ctx.attachment: - size_mb = ctx.attachment.size / (1024 * 1024) - -• ctx.reply_message -> ModuleMessage | None -If the command was executed in reply to another message, returns that referenced message. Otherwise returns None. -Example: -if ctx.reply_message: - target_author = ctx.reply_message.sender_id - -• ctx.reply_attachment -> Attachment | None -The media attachment present on the replied-to message. -Example: -if ctx.reply_attachment: - data = await ctx.download(ctx.reply_attachment) - -• ctx.args -> list[str] -List of command arguments split by whitespace, excluding the prefix and command trigger. -Example: -if len(ctx.args) < 2: - await ctx.respond("Usage: .calc ") - -• ctx.raw_args -> str -The complete, unparsed string following the command trigger. Preserves leading and trailing whitespace. -Example: -query = ctx.raw_args.strip() - -• ctx.prefix -> str -The specific prefix character used to trigger the command (e.g. '.' or '!'). -Example: -pfx = ctx.prefix - -• ctx.uptime -> float -The uptime of the Hotaru supervisor process in seconds. -Example: -up_hours = ctx.uptime / 3600.0 - -• ctx.memory / ctx.ram -> int -The resident set size (RSS) memory consumption of the worker process in bytes. -Example: -mb_used = ctx.memory / (1024 * 1024) - -• ctx.version -> str -The Hotaru core version string. -Example: -current_ver = ctx.version - -• ctx.is_stopping -> bool -Flag indicating whether the userbot has initiated shutdown. Checked by background tasks to perform graceful cleanup. -Example: -while not ctx.is_stopping: - await asyncio.sleep(1) - -## 5. ModuleContext: Messaging & Editing Methods - -ModuleContext provides methods to create, edit, forward, react to, and delete messages. - -### ctx.reply -Signature: -`await ctx.reply(text: str, *, parse_mode: str = "html", link_preview: bool = False, silent: bool = False, schedule_date: int | None = None) -> ModuleMessage` -Description: -Sends a message into the current chat in explicit reply to the triggering message. -Parameters: -• text (str): The body text to transmit. -• parse_mode (str): Entity parser ('html', 'md', or None). Defaults to 'html'. -• link_preview (bool): Enables or disables rich URL preview cards. -• silent (bool): Delivers the notification without sound. -• schedule_date (int | None): Unix timestamp for scheduled delivery. -Returns: -ModuleMessage instance of the sent message. -Exceptions: -Raises TelegramError on flood wait or chat restrictions. -Example: -```python -await ctx.reply("Calculation result: 42", parse_mode="html") -``` - -### ctx.respond -Signature: -`await ctx.respond(text: str, *, parse_mode: str = "html", link_preview: bool = False) -> ModuleMessage` -Description: -If the triggering message was sent by the userbot account (ctx.is_me is True), edits that message in place. If the message was sent by another user, sends a fresh reply. -Returns: -ModuleMessage instance. -Example: -```python -msg = await ctx.respond("Processing dataset...") -await msg.edit("Processing complete.") -``` - -### ctx.edit -Signature: -`await ctx.edit(text: str, *, parse_mode: str = "html", link_preview: bool = False) -> ModuleMessage` -Description: -Edits the content of the triggering message. Fails if the message was not authored by the userbot. -Exceptions: -Raises PermissionError if ctx.is_me is False. -Example: -```python -await ctx.edit("Status: Updated") -``` - -### ctx.delete -Signature: -`await ctx.delete(*, revoke: bool = True) -> bool` -Description: -Deletes the triggering message. -Parameters: -• revoke (bool): When True, deletes the message for all chat participants. -Returns: -bool indicating success. -Example: -```python -await ctx.delete(revoke=True) -``` - -### ctx.pin -Signature: -`await ctx.pin(*, silent: bool = False, unpin_both: bool = False) -> bool` -Description: -Pins the triggering message in the current chat. -Example: -```python -await ctx.pin(silent=True) -``` - -### ctx.unpin -Signature: -`await ctx.unpin() -> bool` -Description: -Unpins the triggering message. -Example: -```python -await ctx.unpin() -``` - -### ctx.react -Signature: -`await ctx.react(emoji: str, *, big: bool = False) -> bool` -Description: -Applies an emoji reaction to the triggering message. -Parameters: -• emoji (str): Unicode emoji character (e.g. '🔥', '👍', '❤️'). -• big (bool): Displays full-screen reaction animation. -Example: -```python -await ctx.react("🔥", big=True) -``` - -### ctx.unreact -Signature: -`await ctx.unreact() -> bool` -Description: -Removes any previously set reaction by the userbot on the current message. -Example: -```python -await ctx.unreact() -``` - -### ctx.forward_to -Signature: -`await ctx.forward_to(target_chat_id: int, *, silent: bool = False) -> ModuleMessage` -Description: -Forwards the triggering message to the specified target chat or user. -Example: -```python -await ctx.forward_to(123456789, silent=True) -``` - -### ctx.copy_to -Signature: -`await ctx.copy_to(target_chat_id: int, *, caption: str | None = None) -> ModuleMessage` -Description: -Sends a duplicate copy of the triggering message without the forwarded header. -Example: -```python -await ctx.copy_to(123456789, caption="Copied snippet") -``` - -### ctx.save -Signature: -`await ctx.save() -> ModuleMessage` -Description: -Forwards the message directly to Saved Messages ('me'). -Example: -```python -await ctx.save() -``` - -### ctx.typing -Signature: -`await ctx.typing(action: str = "typing") -> None` -Description: -Sends a chat action notification to indicate activity. -Supported actions: 'typing', 'upload_photo', 'record_video', 'upload_video', 'record_audio', 'upload_audio', 'upload_document', 'choose_sticker'. -Example: -```python -await ctx.typing("upload_document") -``` - -### ctx.read & ctx.mark_read -Signature: -`await ctx.read() -> bool` -Description: -Marks all incoming messages in the current dialog up to the current message as read. -Example: -```python -await ctx.read() -``` - -## 6. ModuleContext: Media & File Operations - -Hotaru handles media upload, transmission, and download through high-level streaming helpers that bypass disk storage when operating with memory buffers. - -### ctx.send_file & ctx.reply_file -Signature: -`await ctx.reply_file(file: bytes | str | BinaryIO, *, caption: str | None = None, force_document: bool = False, filename: str | None = None) -> ModuleMessage` -Description: -Transmits an arbitrary binary payload, local file, or memory stream as a file attachment. -Parameters: -• file: Raw bytes, string path, or file-like object. -• caption: Optional descriptive text. -• force_document: Forces document delivery even for photos or audio. -• filename: Explicit filename when transmitting raw bytes. -Example: -```python -data = b"ID,Name\n1,Alpha\n2,Beta" -await ctx.reply_file(data, filename="report.csv", caption="Weekly Export") -``` - -### ctx.send_photo & ctx.reply_photo -Signature: -`await ctx.reply_photo(photo: bytes | str | BinaryIO, *, caption: str | None = None, parse_mode: str = "html") -> ModuleMessage` -Description: -Sends a JPEG, PNG, or WEBP image formatted as a compressed Telegram photo. -Example: -```python -with open("chart.png", "rb") as f: - await ctx.reply_photo(f.read(), caption="System Metrics") -``` - -### ctx.send_video & ctx.reply_video -Signature: -`await ctx.reply_video(video: bytes | str | BinaryIO, *, caption: str | None = None, duration: int | None = None, width: int | None = None, height: int | None = None) -> ModuleMessage` -Description: -Transmits an MP4 or MOV video container with dimensions and playback duration metadata. -Example: -```python -await ctx.reply_video("capture.mp4", duration=14, caption="Recorded stream") -``` - -### ctx.send_audio & ctx.reply_audio -Signature: -`await ctx.reply_audio(audio: bytes | str | BinaryIO, *, caption: str | None = None, duration: int | None = None, performer: str | None = None, title: str | None = None) -> ModuleMessage` -Description: -Transmits an MP3, FLAC, or OGG music track with track title and performer tags. -Example: -```python -await ctx.reply_audio(audio_data, title="Synthesized Wave", performer="Hotaru") -``` - -### ctx.send_voice & ctx.reply_voice -Signature: -`await ctx.reply_voice(voice: bytes | str | BinaryIO, *, caption: str | None = None, duration: int | None = None) -> ModuleMessage` -Description: -Transmits an Opus-encoded audio stream as a voice waveform note. -Example: -```python -await ctx.reply_voice(opus_bytes, duration=5) -``` - -### ctx.send_animation & ctx.reply_animation -Signature: -`await ctx.reply_animation(animation: bytes | str | BinaryIO, *, caption: str | None = None) -> ModuleMessage` -Description: -Transmits a silent looping MP4 or GIF file as an in-chat animated sticker. -Example: -```python -await ctx.reply_animation("radar.mp4") -``` - -### ctx.send_dice & ctx.reply_dice -Signature: -`await ctx.reply_dice(emoji: str = "🎲") -> ModuleMessage` -Description: -Rolls an animated Telegram dice. Supported emojis: '🎲', '🎯', '🏀', '⚽', '🎳', '🎰'. -Example: -```python -await ctx.reply_dice("🎯") -``` - -### ctx.edit_media -Signature: -`await ctx.edit_media(media: bytes | str | BinaryIO, *, caption: str | None = None, parse_mode: str = "html") -> ModuleMessage` -Description: -Replaces the media attachment of an existing message without re-sending the message entity. -Example: -```python -await ctx.edit_media(updated_chart_bytes, caption="Updated at 12:00 UTC") -``` - -### ctx.edit_caption -Signature: -`await ctx.edit_caption(caption: str, *, parse_mode: str = "html") -> ModuleMessage` -Description: -Updates the text caption of an existing media message without re-uploading the underlying file. -Example: -```python -await ctx.edit_caption("Archived capture") -``` - -### ctx.download & ctx.download_media -Signature: -`await ctx.download(attachment: Attachment | None = None, destination: str | None = None) -> bytes | str` -Description: -Downloads the attachment associated with the triggering message or replied message. If destination is provided, streams the file to disk and returns the string path. If destination is None, buffers the complete file into memory and returns bytes. -Example: -```python -if ctx.reply_attachment: - file_bytes = await ctx.download(ctx.reply_attachment) - assert isinstance(file_bytes, bytes) -``` - -## 7. ModuleContext: Buttons, Polls & Checklists - -Hotaru enables deep interaction with inline buttons, Telegram polls, and native checklists. - -### Inline Button Operations - -• ctx.buttons -> list[list[MessageButton]] -Matrix of inline buttons present on the triggering message. Each button exposes .text, .data, and .url. - -• ctx.button_count -> int -Total count of inline buttons on the message. - -• await ctx.click(row: int, col: int) -> Any -Simulates tapping an inline button at the specified matrix coordinate. - -• await ctx.click_button(text: str | None = None, data: bytes | None = None) -> Any -Searches for an inline button matching the label or callback payload and triggers it. -Example: -```python -await ctx.click_button(text="Confirm") -``` - -• await ctx.edit_buttons(buttons: list[list[dict[str, str]]]) -> None -Updates or replaces the inline keyboard markup of the current message. -Example: -```python -markup = [ - [{"text": "Refresh", "data": "ref_1"}, {"text": "Dismiss", "data": "dis_1"}] -] -await ctx.edit_buttons(markup) -``` - -• await ctx.remove_buttons() -> None -Strips all inline keyboard buttons from the message while keeping its text intact. -Example: -```python -await ctx.remove_buttons() -``` - -### Native Poll Operations - -• await ctx.send_poll(question: str, answers: list[str], *, multiple_choice: bool = False, quiz: bool = False, correct_id: int | None = None) -> ModuleMessage -Sends an interactive poll into the chat. -Parameters: -• question: The inquiry heading (up to 255 characters). -• answers: List of 2 to 10 option strings. -• multiple_choice: Permits selecting multiple answers. -• quiz: Sets quiz mode requiring a single correct answer. -• correct_id: Zero-indexed position of the correct answer in quiz mode. -Example: -```python -await ctx.send_poll( - "Choose target deployment region:", - ["Frankfurt", "Tokyo", "Virginia"], - multiple_choice=False, -) -``` - -• await ctx.close_poll() -> Any -Closes voting on the poll contained in the current message. -Example: -```python -await ctx.close_poll() -``` - -• await ctx.vote(answers: list[int]) -> Any -Casts a vote on the poll for the specified answer indices. -Example: -```python -await ctx.vote([0]) -``` - -• await ctx.retract_vote() -> Any -Retracts the userbot's cast vote from the poll. -Example: -```python -await ctx.retract_vote() -``` - -• await ctx.get_poll_results() -> dict[str, Any] -Retrieves aggregated vote totals and percentages for the poll. - -### Native Telegram Checklists - -• await ctx.send_todo(title: str, items: list[str], *, others_can_append: bool = False, others_can_complete: bool = False) -> ModuleMessage -Transmits a native Telegram checklist with checkable boxes. -Example: -```python -await ctx.send_todo( - "Deployment Checklist", - ["Run migrations", "Flush cache", "Verify health check"], - others_can_complete=True, -) -``` - -• await ctx.append_todo(items: list[str]) -> Any -Appends additional task items to an existing checklist message. -Example: -```python -await ctx.append_todo(["Verify DNS propagation"]) -``` - -• await ctx.set_checklist_completed(completed: list[int], incompleted: list[int]) -> Any -Toggles the checked state of checklist items by index. - -## 8. Extended Telegram Subsystem Catalog - -The Hotaru relay provides direct access to over 290 granular Telegram methods through ctx. These methods are type-checked, sanitized, and bound to the current peer. - -### Forum Topics Management - -• await ctx.create_forum_topic(title: str, icon_color: int | None = None, icon_emoji_id: int | None = None) -> Any -Creates a discussion thread inside a forum supergroup. -Example: -```python -topic = await ctx.create_forum_topic("Incident #402", icon_color=0x6FB9F0) -``` - -• await ctx.edit_forum_topic(topic_id: int, title: str | None = None, closed: bool | None = None) -> Any -Modifies topic title or toggles closed status. - -• await ctx.set_forum_topic_pinned(topic_id: int, pinned: bool) -> Any -Pins or unpins a topic in the forum index. - -• await ctx.remove_forum_topic(topic_id: int) -> Any -Deletes a forum topic and its complete message history. - -• await ctx.forum_topics(offset_date: int = 0, limit: int = 50) -> Any -Lists forum topics in the current channel. - -### Channel Administration - -• await ctx.channel_details() -> Any -Fetches metadata, participant count, and description for the current channel. - -• await ctx.channel_members(limit: int = 50) -> Any -Retrieves participant records for the channel. - -• await ctx.set_channel_admin(user_id: int, is_admin: bool, rank: str = "") -> Any -Promotes or demotes an administrator with a custom badge title. - -• await ctx.restrict_channel_member(user_id: int, send_messages: bool = False) -> Any -Restricts specific permissions of a member. - -• await ctx.channel_admin_log(limit: int = 50) -> Any -Extracts audit log events including member bans, message deletions, and role changes. - -• await ctx.set_slow_mode(seconds: int) -> Any -Configures slow mode interval in seconds (0 to disable). - -• await ctx.set_antispam(enabled: bool) -> Any -Toggles Telegram native aggressive anti-spam protection. - -### Reactions & Scheduled History - -• await ctx.configure_chat_reactions(available_reactions: list[str]) -> Any -Restricts allowed reaction emojis in a group or channel. - -• await ctx.scheduled_messages() -> list[Any] -Retrieves pending scheduled messages in the current chat. - -• await ctx.cancel_scheduled(ids: list[int]) -> Any -Cancels and removes scheduled messages by their identifier. - -## 9. State Storage & Network Stream Engine - -Hotaru isolates persistence and network I/O behind dedicated capability proxies. - -### Persistent Key-Value State (ctx.state) - -Requires capability: 'state' -State is backed by an encrypted SQLite engine. Keys are scoped strictly to the calling module ID, guaranteeing isolation between modules. - -Methods: -• await ctx.state.get(key: str, default: Any = None) -> Any -Retrieves the value associated with key. If absent, returns default. - -• await ctx.state.set(key: str, value: Any) -> None -Persists a JSON-serializable value (dict, list, int, float, str, bool). - -• await ctx.state.delete(key: str) -> bool -Removes key from storage. Returns True if the key existed. - -• await ctx.state.clear() -> None -Purges all key-value entries belonging to this module. - -• await ctx.state.all() -> dict[str, Any] -Dumps the entire key-value space of the module. - -Usage Example: -```python -async def counter_command(ctx: ModuleContext) -> None: - current = await ctx.state.get("invocations", 0) - current += 1 - await ctx.state.set("invocations", current) - await ctx.respond(f"Command executed {current} times.") -``` - -### Network Client & TCP Streaming (ctx.net & ctx.stream) - -Requires capability: 'net' -All egress traffic passes through a proxy gateway enforcing TLS validation and connection rate limiting. - -1. HTTP Requests (ctx.net): -Signature: -`await ctx.net(url: str, *, method: str = "GET", headers: dict[str, str] | None = None, data: bytes | None = None, json: Any | None = None, timeout: float = 10.0) -> HttpResponse` -Properties on HttpResponse: -• .status_code (int): HTTP response status code (e.g. 200, 404). -• .text (str): Decoded unicode response body. -• .content (bytes): Raw binary response body. -• .headers (dict[str, str]): HTTP response headers. - -Usage Example: -```python -async def weather_command(ctx: ModuleContext) -> None: - city = ctx.raw_args.strip() or "London" - url = f"https://wttr.in/{city}?format=j1" - response = await ctx.net(url) - if response.status_code == 200: - data = json.loads(response.text) - temp = data["current_condition"][0]["temp_C"] - await ctx.respond(f"Temperature in {city}: {temp}°C") -``` - -2. Raw TCP Streaming (ctx.stream): -Signature: -`stream = await ctx.stream(host: str, port: int, *, ssl: bool = True) -> NetStream` -Methods on NetStream: -• await stream.send(data: bytes) -> None -• await stream.recv(size: int = 4096) -> bytes -• await stream.close() -> None - -## 10. Interactive Screens, Navigation & Form Engine - -The Hotaru Screens engine (ctx.screens) enables developers to create stateful interactive menus and terminal screens within Telegram messages. - -### Screen Components Reference - -• await ctx.screens.show(title: str, body: str, *, buttons: list[list[Any]] | None = None, pager: Any | None = None) -> FormHandle -Renders a structured message screen with header, content body, and inline keyboard controls. - -• ctx.screens.button(text: str, callback: Callable[[FormHandle], Awaitable[None]], style: str = "default") -Creates an interactive button bound to an asynchronous callback coroutine. - -• ctx.screens.primary(text: str, callback: Callable) -Creates a visually highlighted primary action button. - -• ctx.screens.danger(text: str, callback: Callable) -Creates a destructive warning button (red accent). - -• ctx.screens.success(text: str, callback: Callable) -Creates an affirmative action button (green accent). - -• ctx.screens.pager(current_page: int, total_pages: int, on_page_change: Callable[[int], Awaitable[None]]) -Constructs a pagination bar with previous, index, and next triggers. - -• ctx.screens.table(headers: list[str], rows: list[list[str]], page: int = 1, page_size: int = 5) -> str -Renders an aligned ASCII table formatted for mobile monospaced display. - -• ctx.screens.close() -Creates a dismissal button that cleanly tears down the interactive screen. - -### Stateful Navigation Example - -```python -async def notes_menu(ctx: ModuleContext) -> None: - notes = await ctx.state.get("notes_list", []) - - async def render_view(page: int = 0) -> None: - items_per_page = 3 - total = max(1, (len(notes) + items_per_page - 1) // items_per_page) - slice_items = notes[page * items_per_page:(page + 1) * items_per_page] - - body_lines = [f"{i+1}. {item}" for i, item in enumerate(slice_items)] - body = "\n".join(body_lines) or "No notes saved yet." - - rows = [] - if total > 1: - pager_row = [] - if page > 0: - pager_row.append(ctx.screens.button("Prev", lambda h: render_view(page - 1))) - pager_row.append(ctx.screens.button(f"{page + 1}/{total}", lambda h: None)) - if page < total - 1: - pager_row.append(ctx.screens.button("Next", lambda h: render_view(page + 1))) - rows.append(pager_row) - - rows.append([ - ctx.screens.success("Add Note", add_note_flow), - ctx.screens.danger("Clear All", clear_notes_flow), - ]) - - await ctx.screens.show("Notes Manager", body, buttons=rows) - - async def add_note_flow(handle: FormHandle) -> None: - notes.append(f"Note recorded at {int(ctx.uptime)}s") - await ctx.state.set("notes_list", notes) - await render_view(0) - - async def clear_notes_flow(handle: FormHandle) -> None: - notes.clear() - await ctx.state.set("notes_list", []) - await render_view(0) - - await render_view(0) -``` - -## 11. Background Supervisor Tasks & Lifecycle - -Modules can run background tasks that persist throughout the userbot runtime. Declare tasks in the tasks mapping of the HOTARU dictionary. - -### Background Task Lifecycle - -1. Registration: -During module startup, Hotaru registers every coroutine declared in HOTARU['tasks']. - -2. Supervisor Monitoring: -Tasks run inside the module's sandboxed worker process. If a task crashes due to an unhandled exception, the Hotaru supervisor restarts it with exponential backoff (up to 5 attempts). - -3. Graceful Termination: -During bot shutdown or module unloading, ctx.is_stopping is set to True. The task is given a 5-second grace period to flush buffers, close open files, and exit cleanly before SIGKILL. - -### Background Worker Pattern - -```python -import asyncio -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from hotaru.response import ModuleContext - -async def reminder_worker(ctx: ModuleContext) -> None: - while not ctx.is_stopping: - try: - reminders = await ctx.state.get("pending_reminders", []) - now = int(asyncio.get_event_loop().time()) - active = [] - for r in reminders: - if r["timestamp"] <= now: - await ctx.tg.send_message(r["chat_id"], f"Reminder: {r['text']}") - else: - active.append(r) - if len(active) != len(reminders): - await ctx.state.set("pending_reminders", active) - except Exception: - pass - - for _ in range(10): - if ctx.is_stopping: - break - await asyncio.sleep(1) - -HOTARU = { - "id": "reminders", - "name": "Background Reminder", - "version": "1.0.0", - "capabilities": ["mt", "state"], - "commands": {}, - "tasks": { - "checker": reminder_worker, - }, -} -``` - -## 12. Internationalization & Lexicons - -Hotaru user interfaces adapt dynamically to the user's configured language. Hardcoding user-facing strings in command handlers is strictly prohibited. - -### Lexicon Schema - -Declare a lexicon dictionary in the module manifest containing language sub-dictionaries: - -```python -"lexicon": { - "en": { - "welcome": "Welcome back, {user}!", - "error_empty": "Query cannot be empty.", - }, - "ru": { - "welcome": "С возвращением, {user}!", - "error_empty": "Запрос не может быть пустым.", - }, - "uk": { - "welcome": "З поверненням, {user}!", - "error_empty": "Запит не може бути порожнім.", - }, -} -``` - -### Retrieving Localized Strings: ctx.t - -Signature: -`ctx.t(key: str, **kwargs) -> str` - -Behavior: -1. Checks the user's active language setting. -2. If the key exists in that language, returns the translated string formatted with **kwargs. -3. If absent, falls back to the English ('en') translation. -4. If missing from English, returns the raw key literal as a safety measure. - -Usage Example: -```python -greeting = ctx.t("welcome", user="Alice") -await ctx.respond(greeting) -``` - -## 13. Security Audit Checklist & Semgrep Rules - -Before any module is distributed or loaded into Hotaru, it must satisfy strict static security requirements. - -### Semgrep Security Verification - -The repository enforces Semgrep rules located in .semgrep/hotaru-security.yml: - -1. No Credentials Leakage (hotaru-no-vault-leak): -Modules must never attempt to open, read, or transmit files located in sanctuary/, including hotaru.vault, runtime.db, or session files. - -2. No Private Namespace Access (hotaru-no-private-escape): -Modules must never inspect or modify private attributes of the core engine (__class__, __subclasses__, __globals__, or sys.modules). - -3. No Unsandboxed Network Sockets (hotaru-no-raw-socket): -Direct import of socket, urllib, or requests is blocked by the runtime. All network traffic must use ctx.net or ctx.stream with the 'net' capability declared. - -4. No System Shell Execution (hotaru-no-shell-exec): -Calls to os.system, subprocess.Popen, os.popen, or pty.spawn are trapped by seccomp filters and result in immediate worker SIGKILL. - -5. Zero Comments in Production Code: -In accordance with Hotaru code purity standards, production .hmod files contain zero comment lines. Code must be self-documenting through precise type annotations and explicit naming. - -## 14. Complete Production Module Blueprints - -The following production blueprints demonstrate real-world, secure module design. Notice that neither ping nor any kernel command is used. - -### Blueprint 1: Text Encryption Tool (.cipher) - -```python -from __future__ import annotations -import base64 -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from hotaru.response import ModuleContext - -async def cipher_command(ctx: ModuleContext) -> None: - text = ctx.raw_args.strip() - if not text: - await ctx.respond(ctx.t("missing_input")) - return - encoded = base64.b64encode(text.encode("utf-8")).decode("ascii") - await ctx.respond(f"{encoded}", parse_mode="html") - -HOTARU = { - "id": "b64_cipher", - "name": "Base64 Cipher", - "version": "1.0.0", - "capabilities": ["mt"], - "commands": { - "cipher": cipher_command, - }, - "lexicon": { - "en": { - "missing_input": "Usage: .cipher ", - }, - "ru": { - "missing_input": "Использование: .cipher <текст для кодирования>", - }, - }, -} -``` - -### Blueprint 2: Persistent Paste Bin (.paste) - -```python -from __future__ import annotations -import json -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from hotaru.response import ModuleContext - -async def paste_command(ctx: ModuleContext) -> None: - content = ctx.raw_args.strip() - if not content and ctx.reply_message: - content = ctx.reply_message.message.text - if not content: - await ctx.respond(ctx.t("empty_paste")) - return - await ctx.typing("upload_document") - payload = json.dumps({"content": content, "extension": "txt"}).encode("utf-8") - res = await ctx.net( - "https://paste.rs", - method="POST", - headers={"Content-Type": "text/plain"}, - data=content.encode("utf-8"), - ) - if res.status_code in (200, 201): - url = res.text.strip() - await ctx.respond(ctx.t("paste_success", url=url)) - else: - await ctx.respond(ctx.t("paste_error")) - -HOTARU = { - "id": "paste_bin", - "name": "Paste Bin Uploader", - "version": "1.0.0", - "capabilities": ["mt", "net"], - "commands": { - "paste": paste_command, - }, - "lexicon": { - "en": { - "empty_paste": "Provide text or reply to a message with .paste", - "paste_success": "Uploaded to pastebin: {url}", - "paste_error": "Failed to upload snippet.", - }, - "ru": { - "empty_paste": "Укажите текст или ответьте на сообщение через .paste", - "paste_success": "Сниппет опубликован: {url}", - "paste_error": "Ошибка при публикации сниппета.", - }, - }, -} -``` +--- +name: hotaru-modules +description: >- + Разработка, редактирование, исправление и ревью модулей Telegram-userbot Hotaru + (.hmod): манифест HOTARU, SandboxContext, команды и алиасы, MTProto/GoyGram, + сообщения и медиа, inline/rich UI, callbacks и ввод, конфиги, состояние и миграции, + watchers, lifecycle, фоновые задачи, capabilities, сеть, зависимости и тесты; + справочник контекстных методов без raw mt, ctx.tools, regdate и search. + Использовать при создании нового модуля Hotaru, добавлении функций, исправлении + ошибок и адаптации существующего .hmod. Проверять фактический API целевой версии, + сохранять поведение и пользовательские данные, не путать sandbox и ядро. +--- + +# Разработка и редактирование модулей Hotaru + +## 1. Назначение и контракт + +Ты разрабатываешь настоящий устанавливаемый модуль Hotaru, а не приблизительный +Python-пример. Выполняй пользовательскую задачу в её границах: создание, точечная +правка, расширение, диагностика или ревью. Не переписывай всё без необходимости. + +- По умолчанию результат — один самодостаточный `.hmod`. Helpers, + пользовательские строки и статические данные размещай внутри него. Не создавай + обязательные соседние `.py`, JSON, ресурсы, установщики и скрытые сервисы. +- Предпочитай стандартную библиотеку и штатные API Hotaru. Внешние зависимости + допустимы только при обоснованной необходимости и совместимости с установкой + пользователя; явно декларируй их и сообщай об этом. Не устанавливай их молча. +- Тесты можно создавать отдельно в тестовой или временной области; не превращай + их в обязательную часть устанавливаемого модуля. +- Не меняй ядро Hotaru, ACL, глобальные настройки и sandbox ради обхода ограничения + модуля. Если публичного контракта недостаточно, укажи конкретный blocker. +- При переносе из Ataraxia/Hikka дополнительно загрузи `ataraxia-to-hotaru`, если + он доступен. Его контракт однофайловости, зависимостей и соответствия 1:1 + соблюдай для такого переноса; этот скилл не отменяет его ограничений. +- Отвечай на языке пользователя. Код согласуй с проектом. Для `.hmod` соблюдай + политику Hotaru: не добавляй `#`-комментарии; выбирай ясные имена функций. + +## 2. Источник истины: версия и код + +Репозиторий: https://github.com/HotaruProject/Hotaru. + +База и справочники перепроверены 2026-11-09 на `main`/`develop` +`8cab560e2b9dbc009aab4670c8a78a9a790e2d1a`. Тогда ветки совпадали. Это +историческая отметка, не обещание актуальности API или веток. + +### Один файл и навигация + +**Этот SKILL.md самодостаточен:** инструкции, все справочники и проверочный код +включены ниже. Для установки достаточно только этого файла; соседние `.md`, `.py`, +дополнительные каталоги и ZIP не требуются. Дополнительный скилл переноса, если +он установлен, — необязательное дополнение, не зависимость этого документа. + +- [Приложение A — контекстный API и компактный каталог 292 операций](#context-contract). +- [Приложение B — все 76 tools, regdate, search и примеры](#tools-reference). +- [Приложение C — полные карточки всех 292 методов](#method-cards): RPC, + namespace, сигнатуры, описания RU/EN и таблицы параметров. +- [Приложение D — самостоятельный проверочный скрипт](#api-inspector): + AST-инвентаризация API и генерация карточек без импорта Hotaru. + +Сначала читай основные правила. В приложениях ищи конкретный `ctx.` или +`ctx.tools.` средствами поиска по этому файлу; не перечитывай весь каталог +для каждой небольшой правки. Указанные пути `hotaru/` и `relay/` относятся к +исходникам целевого Hotaru, не к обязательным файлам рядом со скиллом. + +Перед реализацией: + +1. Прочитай применимые `AGENTS.md`, исходный модуль и связанные файлы. Проверь + существующие изменения; не удаляй и не перезаписывай пользовательскую работу. +2. Определи целевые ветку/коммит Hotaru и среду исполнения. Если есть локальная + установка, приоритет у её исходников. Не меняй её ветку и не обновляй установку. +3. При отсутствии исходников возьми нужные файлы из указанного пользователем + коммита. Если версия не задана, используй текущую `main`, зафиксировав SHA. + Репозиторий можно читать в отдельной временной копии; не запускай install.sh. +4. Изучай реализации необходимых методов и оба конца IPC, а не только README, + названия методов, аннотации `ModuleContext` или встроенные примеры. +5. Если код недоступен, отдели подтверждённое от предположений. Не называй + непроверенную сигнатуру или поведение гарантированно совместимыми. + +### Карта исходников + +| Что нужно узнать | Где искать | +| --- | --- | +| Формат и проверка манифеста | `hotaru/modules.py`: `HmodLoader`, `ModuleManifest` | +| Регистрация, rise/fade, tasks | `hotaru/activation.py`, `hotaru/tasks.py` | +| Аргументы, aliases, dispatch | `hotaru/commands.py`, `hotaru/registry.py`, `hotaru/kernel.py` | +| Реальный внешний ctx, invocation, IPC | `relay/sandbox.py`: `WORKER_SOURCE`, `SandboxContext`, `_execute`, `_serve_*` | +| Высокоуровневые Telegram-операции | `relay/context.py`: `ContextOperations`, `MessageOperations`, `CTX_OPERATIONS`, `CTX_CATALOG` | +| Capabilities и ограничения | `relay/caps.py`: `CapabilityHost`, `PROVIDERS`, `KNOWN` | +| Host ctx и доставка ответа | `hotaru/response.py`, `hotaru/runtime.py` | +| UI, callbacks, input | `hotaru/screens.py`, `hotaru/callbacks.py`, `hotaru/runtime.py`, worker-прокси в `relay/sandbox.py` | +| Схема и хранение конфигов | `hotaru/config.py`, `hotaru/state.py` | +| Переводы и шаблоны | `hotaru/i18n.py`, `relay/toolkit.py`, `hotaru/activation.py` | +| Медиа и зависимости | `relay/files.py`, `relay/caps.py`, `hotaru/deps.py` | +| Права и восстановление | `hotaru/access.py`, `hotaru/security.py`, `hotaru/backup.py` | + +Не фиксируй в модуле путь к машине разработки, временной копии или исходникам. +Не подгружай исполняемый код из сети для «совместимости». + +## 3. Сначала опиши поведение + +Для нового модуля составь краткую спецификацию. Для правки сначала восстанови +существующий контракт и найди причину ошибки. Зафиксируй: + +- команды, алиасы, обычные/bot/inline-входы и разбор аргументов; +- поведение без аргументов, по reply, с вложением, подписью и неверным вводом; +- кто вызывает действие, от чьего имени и в какой чат/топик отправляется ответ; +- edit/reply/send, обычное/rich форматирование, кнопки, страницы и ввод; +- конфиги, state-ключи, версии схемы и совместимость со старыми данными; +- watchers, расписание, загрузку/выгрузку и обработку ошибок; +- требуемые capabilities, внешние сервисы и зависимости. + +При редактировании сохраняй ID модуля, команды, алиасы, имена конфигов и state-ключи, +если пользователь не запросил их изменение. Исправляй минимальный необходимый +участок. Для изменения схемы данных спроектируй идемпотентную миграцию с сохранением +старых значений; не сбрасывай базу и не используй `purge` как «исправление». + +## 4. Главная граница: внешний модуль ≠ встроенный + +Встроенные `constellations/*.hmod` исполняются в ядре. Сторонний модуль работает +в отдельном worker с `SandboxContext`. Сходные имена объектов не делают API равным. + +Для внешнего `.hmod`: + +- Не используй `ctx.runtime`, внутренний `app`, session, connection или database. +- Не импортируй `hotaru`, `relay`, `goygram` во время выполнения. Не используй + Telethon/Pyrogram-объекты и их Request-классы как будто Hotaru предоставляет их. +- `invocation` сокращён: проверяй наличие `name`, `args`, `raw_args`, `source`, + `chat_id`, `message_id`; не рассчитывай на `invocation.message`. +- `ctx.message` — ограниченный объект, а не полноценное сообщение GoyGram. + Поля текста, вложения, out/sender и reply проверяй по реальному payload dispatch. + Значение `False`/`None` в таком объекте не всегда доказывает отсутствие поля + в исходном Telegram-сообщении. При необходимости получи сообщение через API. +- `ctx.msg()`, `ctx.reply()` и `ctx.resolve()` могут возвращать TL-словари или + `None`, а не объекты с `.text`, `.download()`, `.edit()` и прочими методами. +- `ctx.config` в проверенном worker — снимок `dict`, не изменяемый `ModuleConfig`. + Правка `ctx.config["x"]` не сохраняет значение. Найди поддерживаемую операцию + записи; не обещай её по сходству с host API. +- Не сериализуй через IPC ctx, callback, coroutine, файловый объект, lock, Path + или экземпляр произвольного класса. Передавай примитивы, списки и словари. + Байты разрешены только там, где текущий IPC-кодек и конкретный метод их поддерживают. + +Каждый используемый API проверяй по цепочке: +**внешний proxy → IPC-запрос → host handler → фактическая операция**. +В частности, это обязательно для медиа, input, rich UI, config-записи и tasks. + +## 5. Манифест и точки входа + +Первое AST-выражение файла — литеральный `HOTARU = {...}`. Перед ним не должно быть +import, module docstring или `from __future__`. Обязательные поля: `id`, `version`, +`commands`, `capabilities`; списки задавай именно списками литеральных строк. + +Используй простой уникальный kebab-case ID и имена команд из ASCII letters/digits/ +underscore, совместимые с путями и dependency storage. Не занимай ID и команды ядра. + +Основные соглашения: + +```python +async def command_example(ctx, invocation): + ... + +async def watcher_example(ctx, event): + ... + +async def task_example(ctx): + ... +``` + +`...` здесь обозначает сигнатуры, не допустимую заглушку в готовом результате. +`watchers: ["example"]` связывается с `watcher_example`; task объявляется в +`tasks` с `interval` и `autostart`; имена rise/fade указываются в манифесте явно. +Inline handlers в проверенном worker вызываются как `inline_name(query, args)`, +не как обычная команда с ctx. Маршрут `bot_commands` отдельно проследи в dispatch: +название `bot_name` в host binder ещё не гарантирует такой target в worker. + +Загрузчик может допускать более широкие имена, fallback handlers и поля, чем +worker действительно обслуживает. Используй канонические `command_`; +не полагайся на host fallback, особенно для дефисов и специальных символов. + +Поля `after` и `requires` различны: первое относится к порядку модулей, +второе — к Python-зависимостям. Порядок загрузки не предоставляет прямой импорт +или общий Python-объект другого модуля. + +## 6. Команды и ответы + +- `invocation.args` — уже разделённые по whitespace аргументы; это не shell parser. + Для исходного текста используй `raw_args`. Если нужна обработка кавычек, + применяй явный parser к raw_args, не собирай исходник обратно через `join(args)`. +- Не зашивай `.` в сообщения usage; получай актуальный префикс через доступный ctx. +- В проверенном API `await ctx.reply()` получает reply-сообщение, а + `await ctx.reply_text()` его текст. Это не отправка ответа. +- Для ответа используй `await ctx.respond(text, ...)`; для режима указывай + поддерживаемый `output="auto"`, `"edit"` или `"reply"` осознанно. +- Последовательные status/result ответы проверяй на отсутствие дубликатов, + редактирование именно нужного сообщения и сохранение привязки к исходному чату. +- Не выбирай адресата по принципу «первый доступный ID». Различай actor, peer, + message_id, topic_id, account и inline_message_id. Не теряй topic при reply. +- Для raw MT используй проверенный `ctx.tg.call(method, kwargs)` с capability `mt`. + TL-конструкторы задаются словарями с ключом `_`. Проверяй форму результата; + не считай любой truthy dict подтверждением успешного действия. +- Высокоуровневые операции из `relay/context.py` могут не требовать raw `mt`; + не добавляй эту capability «на всякий случай». Доступность метода не отменяет + серверных прав Telegram, denylist и ограничений политики ядра. +- Сначала найди готовую операцию в [приложении A](#context-contract), а не заменяй её + raw RPC с лишней capability. «Без capabilities» относится к выбранному маршруту + вызова, не ко всему модулю: state, внешняя сеть и загрузка файла имеют свои права. +- Escape пользовательский текст до вставки в HTML. Не escape целую готовую + разметку и не выполняй двойное экранирование. Учитывай entities и UTF-16 offsets. +- Длинные ответы разбивай безопасно для HTML или отправляй файлом только через + реально поддерживаемый путь. Не обрезай молча существенные данные. + +## 7. Capabilities, данные и безопасность + +Запрашивай минимум прав для реальных функций. В проверенной версии известны +`mt`, `state`, `net`, `files`, `shell`, `inline`, `modules`, `assets`, `logs`, `fetch`; +`logs` и `fetch` имеют отдельный всегда доступный маршрут. Перепроверь это для цели. + +- `net`: сеть через `ctx.net()` / `ctx.stream()` и поддерживаемые cap-операции. + Не открывай прямые sockets и не обходи запреты внутренних/частных адресов. +- `files`: штатные операции workspace, не доступ к файловой системе хоста. +- `assets`: в проверенном worker upload/download медиа используют этот provider; + наличие `files` само по себе не гарантирует отправку локального файла. +- `shell`: только при реальной необходимости. Не заменяй обычную логику shell, + не интерполируй непроверенный ввод, не запускай установщики и привилегированные + команды. Учитывай отдельные synchronous/job пути и их разные ограничения. +- `modules`: только если назначение — управление модулями; не выдавай для удобства. +- Не обходи consent, ограничения аккаунта, защищённые peers, auth/payment policy, + seccomp и namespace-границы. Не предлагай portable как безопасный аналог strict. +- Не читай/не меняй vault, master keys, сессии, глобальные настройки или чужой state. + Никогда не помещай секреты в код, callback payload, логи и диагностические ответы. + +`ctx.state` использует namespace данного модуля. В проверенном worker его методы +`get/set/delete/keys` синхронные: не ставь `await` автоматически. `get()` способен +вернуть default при отказе в capability; это не доказательство доступного хранения. +Объявляй `state`, когда оно нужно; проверяй ошибки записи. + +Используй короткие ключи, совместимые с `StateNamespace._validate_key`, и JSON-данные. +Зарезервированные lifecycle-ключи не трогай. Изменение вложенного dict/list после +`get()` не сохраняется автоматически — вызови `set()`. Read-modify-write не атомарен: +предусмотри конкурентные команды, callbacks и повторные события. + +Не называй state и module config зашифрованными без проверки: в изученном коде +`runtime_settings` шифруется, а `module_state` хранит JSON. `secret` маскирует UI, +но сам по себе не обеспечивает шифрование поля. Не обещай защиту секретов на диске. + +## 8. Конфигурация и переводы + +- Объявляй `config_schema` литерально: тип, default, диапазон, длина, regex, + options, item-schema и secret — по актуальному `validator_from_spec`. +- Не выдумывай JSON-формат для каждого Python validator: наличие класса в ядре + не означает поддержку его имени в литеральной схеме. +- Валидируй границы, пустые строки, неверные типы, `None`, boolean вместо integer, + нечисловые/нефинитные значения там, где это применимо. +- Различай конфиг пользователя и служебное состояние. Изменение default не должно + незаметно уничтожать уже сохранённое значение. Миграции делай повторяемыми. +- Строки интерфейса централизуй; для однофайлового внешнего модуля допустим свой + словарь языков и явный helper с fallback. Не пиши в глобальный `lexicon/`. +- `HOTARU.lexicon` обслуживает метаданные/справку, но не гарантирует автоматическую + доступность каждой строки в worker `ctx.t()`. Проследи, какой translations payload + передаётся каждому типу вызова; не смешивай глобальные ключи и локальные строки. +- `template_fields` задавай явно; не используй eval/exec для шаблонов. Межмодульные + значения требуют штатного экспорта и `render_template_async`; сохраняй scopes. + +### Штатные tools вместо самодельных helpers + +Внешнему worker доступен `ctx.tools` из `TOOLKIT_FUNCS`; не импортируй +`relay.toolkit`. Ищи готовые `message_text`, `entities_to_html`, `duration`, +`file_size`, `search`, `regdate`, template/HTML и collection helpers в +[приложении B](#tools-reference). Не путай чистый helper с выполняющим Telegram-действие API. + +- `ctx.tools.regdate(user_id, registration_month=..., not_after=...)` синхронный, + локальный и без capabilities. Это **оценка** с `earliest/latest/error_days`, + `estimated=True` и `conflict`, не точная официальная дата Telegram. +- `await ctx.tools.search(values, query, ...)` асинхронный локальный fuzzy search, + а не поиск сообщений в Telegram. Он возвращает records с value/score/matched/layout. +- Не все функции экспортируемого namespace работоспособны в sandbox: например, + `prune_logs` импортирует ядро, а `check_restrictions` без host app не проверяет + реальное состояние аккаунта. Смотри ограничения в справочнике. + +## 9. UI, callbacks и input + +Сначала выбери один реально доступный путь: `ctx.respond(buttons=...)`, `ctx.ui`, +`ctx.screens` или inline-form. Не смешивай host `Kit/Nav/ScreenRef` и worker-прокси. + +- Проверь сигнатуру callback: в worker UI handler может получать `(callback)` + либо `(callback, payload)`, screen navigation — `(ctx, nav)` только по своему + поддерживаемому маршруту. Не выбирай сигнатуру по внешнему виду кнопки. +- Предпочитай именованные module-level handlers и сериализуемые payload ID. + Не захватывай ctx, исходное message, сеть или mutable данные в nested closures: + восстановление callback после рестарта/hibernation может потерять эти значения. +- Callback context не равен командному ctx. Проверь доступные методы, наличие + языка/конфига/state и источник данных повторно при нажатии. +- Используй штатные binding и проверку доступа. Не формируй собственный обход + подписанных callback_data; не доверяй actor, peer и ID из payload без проверки. +- Подтверждение нажатия, редактирование формы и удаление — разные операции. + В проверенном callback API подтверждение — `respond`, а не `answer`. +- Для input проверь весь маршрут: кнопка → запрос → ввод → авторизация → handler. + Наличие `input()` у host Kit или `SandboxNav.value` не гарантирует worker feature. +- Поддержи истёкшие формы, повторное нажатие, отмену, ошибку ввода, отозванные права, + выгрузку/рестарт и отсутствие inline-бота. Проверяй актуальность целевого объекта + непосредственно перед необратимым действием. +- Rich HTML и стили могут требовать Premium/другой транспорт. Предусмотри обычный + fallback без потери смысла; не выдавай сырой ``/`
` как готовый plain UI. +- Не обещай host banner/иконки/ScreenRef на стороне worker без реализации proxy. + +## 10. Медиа и внешняя сеть + +Для медиа различай metadata attachment, сырое Telegram media, uploaded InputFile, +байты, URL и путь. Это разные значения, не взаимозаменяемый `file`. + +- Проверь source/reply, вид вложения, caption, MIME, имя, размер и текстовую кодировку. +- Для текста вложения используй `read_attachment_text()` с явным лимитом, если + его хватает: это отдельный bound-message путь, не произвольное чтение файлов. +- Проследи upload/download и интерпретацию пути на host и worker. Общий абсолютный + путь или BytesIO нельзя считать работающими через IPC по умолчанию. +- Для временных файлов используй допустимый workspace, уникальные имена и `finally`. + Не удаляй пользовательский файл после отправки и не переходи по чужим symlink. +- Для HTTP проверяй status, content type, размер, `truncated` и тело ответа. + JSON разбирай отдельно; результат `ctx.net()` не является aiohttp/requests response. +- Binary response может быть base64 с явным encoding; не декодируй его как UTF-8. +- Задавай таймауты/лимиты, закрывай streams в `finally`. Retry ограничивай и + различай безопасное чтение и запись: повтор может дублировать действие. +- Тестируй отказ capability, недоступность сервиса, redirect, не-JSON, пустой ответ, + timeout, rate limit и FloodWait. Не отправляй приватный текст стороннему сервису + без явного назначения функции и понятного пользователю поведения. + +## 11. Lifecycle, watchers и конкурентность + +Worker в изученной версии обслуживает запросы через потоки и отдельные +`asyncio.run()`, не через единый вечный event loop модуля. + +- Не храни глобально loop-bound session, Future, asyncio.Lock или фоновые tasks, + рассчитывая использовать их из следующей команды или callback. +- Не превращай `asyncio.create_task()` в команде в постоянный сервис: цикл вызова + завершится. Для расписаний используй манифест `tasks` и `task_`. +- Учитывай параллельные вызовы и shared Python globals. Не держи threading lock + через await/IPC; используй короткие critical sections и продуманную модель данных. +- Worker может завершиться и пересоздаться при простое/сбое. Важные данные храни + через штатный state; не полагайся на глобальный cache как единственный источник. +- Rise делай идемпотентным и ограниченным по времени, без дублей уведомлений и + внешних действий. Fade — best-effort cleanup; он не гарантирован при аварии. +- Watcher не проходит тот же командный ACL-маршрут. Явно фильтруй chat, sender, + направление, тип события, собственные ответы и повторную обработку. Не вызывай + команду от чужого имени и не создавай reply-loop. +- Фильтруй watcher до сетевых операций. Используй deduplication и ограниченную + нагрузку, не создавай бесконечный поток задач на каждое сообщение. +- Уточни доступный payload watcher: text/sender/message могут не передаваться + целиком. При необходимости fetch; не подменяй отсутствие данных догадкой. + +## 12. Проверка: обязательные уровни + +### A. Статически, без выполнения модуля + +Не импортируй `.hmod` для проверки синтаксиса. Не делай обычный `import hotaru`: +инициализация пакета может переисполнить Python или подготовить окружение. + +Этот скрипт принимает путь единственного модуля; сохраняй его во временной области +или выполни через stdin средствами своей оболочки: + +```python +import ast +import io +import sys +import tokenize +from pathlib import Path + +path = Path(sys.argv[1]) +source = path.read_text(encoding="utf-8") +assert path.suffix == ".hmod", "Expected .hmod" +tree = ast.parse(source, filename=str(path)) +assert tree.body, "Empty module" +first = tree.body[0] +assert isinstance(first, ast.Assign), "First statement must assign HOTARU" +assert len(first.targets) == 1 +assert isinstance(first.targets[0], ast.Name) and first.targets[0].id == "HOTARU" +manifest = ast.literal_eval(first.value) +assert isinstance(manifest, dict) +assert all(key in manifest for key in ("id", "version", "commands", "capabilities")) +assert isinstance(manifest["id"], str) and manifest["id"] +assert isinstance(manifest["version"], str) and manifest["version"] +for key in ("commands", "capabilities"): + assert isinstance(manifest[key], list) + assert all(isinstance(value, str) and value for value in manifest[key]) +functions = {node.name for node in tree.body if isinstance(node, ast.AsyncFunctionDef)} +assert all("command_" + name in functions for name in manifest["commands"]) +assert not any(token.type == tokenize.COMMENT for token in tokenize.generate_tokens(io.StringIO(source).readline)) +compile(tree, str(path), "exec", dont_inherit=True) +print("Static checks passed; runtime compatibility not tested") +``` + +Это минимальный консервативный smoke-check канонического модуля, не замена +`HmodLoader` и не полный валидатор всех optional полей. Проверяй также манифест +штатным загрузчиком в подготовленной целевой Linux-среде без запуска Telegram, +когда такой безопасный harness уже доступен. Не запускай bootstrap ради проверки. + +### B. Unit и contract tests + +- Pure-функции: разбор аргументов, валидация, escape, форматирование и миграции. +- Mock ctx, максимально похожий на SandboxContext, а не на богатый host ctx. + Отсутствующие методы должны давать ошибку, а не универсальный MagicMock success. +- IPC/host-контракты проверяй отдельно; mock не доказывает наличие provider. +- Покрой happy path, пустые args/reply, неверный ввод, старые данные, отказ прав, + сетевые/Telegram ошибки и отсутствие целевого объекта. +- При правке воспроизведи исходный баг до изменения и проверь устранение после. + Если воспроизведение невозможно, прямо скажи это. При расширении добавь регрессии + для прежних команд, форматов ответа и state. + +### C. Реальная интеграция — только с разрешения пользователя + +Используй тестовую Linux-установку, штатную загрузку `.hmod`, фактический strict +sandbox и тестовый чат/аккаунт. Без явного разрешения не авторизуйся в Telegram, +не загружай модуль в рабочий userbot и не отправляй реальные сообщения. + +Проверь объявленные capabilities; отсутствие случайных пакетов и файлов рядом; +другой CWD; команды, aliases, edit/reply/topic; медиа; callbacks/input; рестарт; +unload/reload; восстановление state; совместимость со старыми данными. +Не проверяй обработку критических сессионных ошибок на рабочем аккаунте: в +некоторых версиях обработчик Hotaru удаляет каталог проблемного аккаунта. + +Не утверждай «работает в Hotaru», если выполнены только compile или mocks. +Чётко разделяй: статически проверено / mock tests / IPC contract / live integration. + +## 13. Минимальный шаблон внешнего модуля + +Этот пример использует только bound response и не требует capabilities. Он не +объявляет лишних API, не зависит от файлов рядом и не выполняет действия на import. + +```python +HOTARU = { + "id": "example", + "version": "1.0.0", + "commands": ["example"], + "capabilities": [], + "lexicon": { + "en": { + "description": "A minimal example", + "commands": {"example": {"description": "Show a greeting"}}, + }, + "ru": { + "description": "Минимальный пример", + "commands": {"example": {"description": "Показать приветствие"}}, + }, + }, +} + +import html + +STRINGS = { + "en": {"greeting": "Hello, {name}!", "default_name": "world"}, + "ru": {"greeting": "Привет, {name}!", "default_name": "мир"}, +} + + +def localized(ctx, key): + language = str(ctx.i18n.language).replace("_", "-").split("-", 1)[0].lower() + return STRINGS.get(language, STRINGS["en"]).get(key, STRINGS["en"][key]) + + +async def command_example(ctx, invocation): + name = invocation.raw_args.strip() or localized(ctx, "default_name") + text = localized(ctx, "greeting").format(name=html.escape(name, quote=False)) + await ctx.respond(text, parse_mode="HTML", rich=False) +``` + +Не сохраняй имя/команды шаблона в пользовательском модуле. Добавляй только функции, +нужные задаче, и повторно проверяй их по целевому коду. + +## 14. Финальная приёмка и ответ + +Перед завершением проверь: + +- Нет заглушек, fake-success, выдуманных API, лишних прав и зависимостей. +- Изменены только согласованные файлы и поведение; данные пользователя сохраняются. +- Новый манифест и handlers согласованы; imports и top-level код безопасны. +- User input экранирован, данные ограничены по размеру, адресаты и права проверены. +- Сеть и внешние действия имеют осмысленные ошибки и управляемый lifecycle. +- Нет секретов, абсолютных dev-путей, обязательных sidecar и изменений ядра. +- Проверки выполнены с указанной глубиной; ограничения не скрыты. + +В ответе укажи готовый путь к `.hmod`, кратко опиши изменения, требуемые capabilities +и зависимости, целевой коммит/версию, результаты проверок и что не запускалось. +Для исправления объясни причину ошибки. Не заявляй полноценную интеграционную +проверку без запуска в целевой среде и не проси рабочие ключи/сессию для тестов. + + +## Приложение A. Контекстный API и компактный каталог + +## Контекстные операции Hotaru без raw capability `mt` + +Источник: `relay/context.py`, `relay/sandbox.py`, `relay/caps.py` на коммите +`8cab560e2b9dbc009aab4670c8a78a9a790e2d1a`, проверено 2026-11-09. + +### 1. Что означает «без capabilities» + +В обсуждении упоминалось 229 методов; в проверенном исходнике **292 записи +`CTX_CATALOG`**, плюс отдельно определённые message helpers. Не урезай список +до произвольного числа и не утверждай, что все записи всегда исполнимы. + +Внешний `ctx.()` идёт через `_ctx_call` → `_op_call` → `_serve_op` → +`CapabilityHost._mt_call`. Этот маршрут не требует декларировать raw `mt`. +Напротив, `ctx.tg.call()`/`ctx.cap("mt", ...)` идут через проверку capability. +Не используй приватный `_ctx_call` напрямую как публичный raw RPC API. + +**Без raw `mt` не значит без ограничений:** + +- Telegram-права администратора, доступность RPC в слое, Premium, FloodWait, + denylist, read-only peers и запрет оплачиваемых операций продолжают действовать. +- `set_profile_username` → `account.updateUsername` и `search_all_messages` → + `messages.searchGlobal` присутствуют в каталоге, но запрещены `MT_BLOCKED`. + Добавление `mt` их не разблокирует. Это отмеченные исключения, не рабочие примеры. +- Загрузка медиа с локального диска в проверенном worker использует `assets`. + Наличие `send_photo` без raw `mt` не делает локальный upload permissionless. +- Внешний перевод требует `net`; персистентность — `state`; доступ к файлам и + inline gateway также проверяется отдельно. Выбирай capabilities по всей цепочке. + +### 2. Как читать каталог + +Ниже **контрактные обозначения**, не объявления Python-функций: + +- Все перечисленные операции вызываются как `await ctx.(...)`. +- `$peer` — текущий чат; `$message` — текущее сообщение только при совместимом + адресате; `$random` — генерируемый `random_id`. В task/source-less ctx их может + не быть: тогда передавай адресата и ID явно. +- `=?` — необязательное TL-поле; обычно лучше не передавать, чем передавать `None`. +- До `*` указан порядок positional аргументов из каталога. Defaults подставляются + отдельно, поэтому **используй keywords**, если пропускаешь peer/message/defaults. + Например `await ctx.chat_history(limit=10)`, не `ctx.chat_history(10)`. +- После `*` — дополнительные keyword-поля. Неизвестные, повторные аргументы и + запрещённые поля отвергаются до RPC. `timeout` не является общим keyword каталога. +- `chat_id` может быть alias для `peer`/`channel`, но если RPC имеет настоящий + `chat_id: long`, это raw ID basic group, не произвольный InputPeer. +- `message_id` заменяет `msg_id` либо скалярный `id: int`; `topic_id` заменяет + `top_msg_id` только у соответствующей операции. Это не универсальные kwargs. +- Типы InputPeer/InputUser/InputChannel преобразуются из подходящих entity/TL + значений, username или ID с разрешением через ctx. `Vector` требует список/ + tuple. Строка не заменяет вектор, а ID сообщения не равен ID пользователя. +- Для TL-типа, required/default/forbidden/RPC используй read-only скрипт + встроенный скрипт из [приложения D](#api-inspector) с `--section catalog` + либо сам `CTX_CATALOG`. + Нельзя выдумывать return type: host возвращает обработанное тело RPC, не всегда + dict и не полноценный объект сообщения. + +Общие guards отвергают paid/business fields, в частности ненулевые `allow_paid_stars`, +`allow_paid_floodskip`, `stars`, `subscription_pricing`, а также `reactionPaid`. +У `create_chat_invite` `subscription_pricing` явно запрещён и не указан ниже. + +### 3. Каталог: все 292 записи + +Развёрнутые карточки с RPC, TL-типами и таблицами параметров: +[приложение C](#method-cards). Здесь сохранён компактный индекс, +чтобы выбор метода не требовал загрузки большого справочника целиком. + +#### Checklist, polls, scheduled, reactions — 1–20 + +1. `set_checklist_completed(peer=$peer, msg_id=$message, completed, incompleted)` +2. `add_poll_answer(peer=$peer, msg_id=$message, answer)` +3. `remove_poll_answer(peer=$peer, msg_id=$message, option)` +4. `unread_poll_votes(peer=$peer, offset_id=0, add_offset=0, limit=50, max_id=0, min_id=0, *, top_msg_id=?)` +5. `mark_poll_votes_read(peer=$peer, *, top_msg_id=?)` +6. `poll_statistics(peer=$peer, msg_id=$message, *, dark=?)` +7. `scheduled_messages(peer=$peer, hash=0)` +8. `scheduled_by_ids(peer=$peer, id)` +9. `publish_scheduled(peer=$peer, id)` +10. `cancel_scheduled(peer=$peer, id)` +11. `configure_chat_reactions(peer=$peer, available_reactions, *, reactions_limit=?, paid_enabled=?)` +12. `available_reactions(hash=0)` +13. `set_default_reaction(reaction)` +14. `unread_reactions(peer=$peer, offset_id=0, add_offset=0, limit=50, max_id=0, min_id=0, *, top_msg_id=?, saved_peer_id=?)` +15. `mark_reactions_read(peer=$peer, *, top_msg_id=?, saved_peer_id=?)` +16. `popular_reactions(limit=50, hash=0)` +17. `recent_reactions(limit=50, hash=0)` +18. `clear_recent_reactions()` +19. `remove_member_reactions(peer=$peer, participant)` +20. `remove_member_message_reaction(peer=$peer, msg_id=$message, participant)` + +#### Saved Messages и forums — 21–40 + +21. `saved_dialogs(offset_date=0, offset_id=0, offset_peer={'_': 'inputPeerEmpty'}, limit=50, hash=0, *, exclude_pinned=?, parent_peer=?)` +22. `saved_history(peer, offset_id=0, offset_date=0, add_offset=0, limit=50, max_id=0, min_id=0, hash=0, *, parent_peer=?)` +23. `clear_saved_history(peer, max_id, *, parent_peer=?, min_date=?, max_date=?)` +24. `pinned_saved_dialogs()` +25. `set_saved_dialog_pinned(peer, *, pinned=?)` +26. `reorder_saved_pins(order, *, force=?)` +27. `saved_reaction_tags(hash=0, *, peer=?)` +28. `rename_saved_tag(reaction, *, title=?)` +29. `suggested_saved_tags(hash=0)` +30. `saved_dialogs_by_peers(ids, *, parent_peer=?)` +31. `mark_saved_history_read(parent_peer, peer, max_id)` +32. `forum_topics(peer=$peer, offset_date=0, offset_id=0, offset_topic=0, limit=50, *, q=?)` +33. `forum_topics_by_ids(peer=$peer, topics)` +34. `edit_forum_topic(peer=$peer, topic_id, *, title=?, icon_emoji_id=?, closed=?, hidden=?)` +35. `set_forum_topic_pinned(peer=$peer, topic_id, pinned)` +36. `reorder_forum_pins(peer=$peer, order, *, force=?)` +37. `create_forum_topic(peer=$peer, title, random_id=$random, *, title_missing=?, icon_color=?, icon_emoji_id=?, send_as=?)` +38. `remove_forum_topic(peer=$peer, top_msg_id)` +39. `set_forum_enabled(channel=$peer, enabled, tabs)` +40. `set_forum_message_view(channel=$peer, enabled)` + +#### Stories — 41–69 + +41. `story_posting_quota(peer)` +42. `post_story(peer, media, privacy_rules, random_id=$random, *, pinned=?, noforwards=?, fwd_modified=?, media_areas=?, caption=?, entities=?, period=?, fwd_from_id=?, fwd_from_story=?, albums=?, music=?)` +43. `edit_story(peer, id, *, media=?, media_areas=?, caption=?, entities=?, privacy_rules=?, music=?)` +44. `delete_stories(peer, id)` +45. `set_stories_on_profile(peer, id, pinned)` +46. `story_feed(*, next=?, hidden=?, state=?)` +47. `profile_stories(peer, offset_id=0, limit=50)` +48. `archived_stories(peer, offset_id=0, limit=50)` +49. `stories_by_ids(peer, id)` +50. `mark_stories_read(peer, max_id=0)` +51. `story_viewers(peer, id, offset='', limit=50, *, just_contacts=?, reactions_first=?, forwards_first=?, q=?)` +52. `story_view_counts(peer, id)` +53. `story_link(peer, id)` +54. `activate_story_stealth(*, past=?, future=?)` +55. `react_to_story(peer, story_id, reaction, *, add_to_recent=?)` +56. `peer_stories(peer)` +57. `story_read_markers()` +58. `peer_latest_story_ids(id)` +59. `story_posting_chats()` +60. `set_peer_stories_hidden(peer, hidden)` +61. `story_reaction_senders(peer, id, limit=50, *, forwards_first=?, reaction=?, offset=?)` +62. `reorder_profile_story_pins(peer, id)` +63. `search_stories(offset='', limit=50, *, hashtag=?, area=?, peer=?)` +64. `create_story_album(peer, title, stories)` +65. `edit_story_album(peer, album_id, *, title=?, delete_stories=?, add_stories=?, order=?)` +66. `reorder_story_albums(peer, order)` +67. `remove_story_album(peer, album_id)` +68. `story_albums(peer, hash=0)` +69. `story_album_items(peer, album_id, offset=0, limit=50)` + +#### Stickers, emoji, GIF — 70–108 + +70. `stickers_for_emoji(emoticon, hash=0)` +71. `installed_sticker_sets(hash=0)` +72. `sticker_set(stickerset, hash=0)` +73. `install_sticker_set(stickerset, archived=False)` +74. `uninstall_sticker_set(stickerset)` +75. `reorder_sticker_sets(order, *, masks=?, emojis=?)` +76. `saved_gifs(hash=0)` +77. `set_gif_saved(id, unsave)` +78. `featured_sticker_sets(hash=0)` +79. `mark_featured_stickers_seen(id)` +80. `recent_stickers(hash=0, *, attached=?)` +81. `set_sticker_recent(id, unsave, *, attached=?)` +82. `clear_recent_stickers(*, attached=?)` +83. `archived_sticker_sets(offset_id=0, limit=50, *, masks=?, emojis=?)` +84. `installed_masks(hash=0)` +85. `media_sticker_sets(media)` +86. `favorite_stickers(hash=0)` +87. `set_sticker_favorite(id, unfave)` +88. `search_sticker_sets(q, hash=0, *, exclude_featured=?)` +89. `bulk_sticker_set_action(stickersets, *, uninstall=?, archive=?, unarchive=?)` +90. `older_featured_sticker_sets(offset=0, limit=50, hash=0)` +91. `custom_emoji_documents(document_id)` +92. `installed_emoji_sets(hash=0)` +93. `featured_emoji_sets(hash=0)` +94. `search_custom_emoji(emoticon, hash=0)` +95. `search_emoji_sets(q, hash=0, *, exclude_featured=?)` +96. `owned_sticker_sets(offset_id=0, limit=50)` +97. `search_stickers(q, emoticon, lang_code, offset=0, limit=50, hash=0, *, emojis=?)` +98. `create_sticker_set(user_id, title, short_name, stickers, *, masks=?, emojis=?, text_color=?, thumb=?, software=?)` +99. `remove_sticker(sticker)` +100. `move_sticker(sticker, position)` +101. `add_sticker(stickerset, sticker)` +102. `set_sticker_set_thumbnail(stickerset, *, thumb=?, thumb_document_id=?)` +103. `check_sticker_set_name(short_name)` +104. `suggest_sticker_set_name(title)` +105. `edit_sticker_metadata(sticker, *, emoji=?, mask_coords=?, keywords=?)` +106. `rename_sticker_set(stickerset, title)` +107. `remove_sticker_set(stickerset)` +108. `replace_sticker(sticker, new_sticker)` + +#### Contacts — 109–129 + +109. `contact_ids(hash=0)` +110. `contact_statuses()` +111. `contacts_list(hash=0)` +112. `import_contacts(contacts)` +113. `remove_contacts(id)` +114. `remove_contacts_by_phone(phones)` +115. `block_peer(id, *, my_stories_from=?)` +116. `unblock_peer(id, *, my_stories_from=?)` +117. `blocked_peers(offset=0, limit=50, *, my_stories_from=?)` +118. `search_public_peers(q, limit=50, *, broadcasts=?, bots=?)` +119. `frequent_peers(offset=0, limit=50, hash=0, *, correspondents=?, bots_pm=?, bots_inline=?, phone_calls=?, forward_users=?, forward_chats=?, groups=?, channels=?, bots_app=?, bots_guestchat=?)` +120. `reset_peer_rating(category, peer)` +121. `clear_imported_contacts()` +122. `imported_contacts()` +123. `set_frequent_peers_enabled(enabled)` +124. `add_contact(id, first_name, last_name, phone, *, add_phone_privacy_exception=?, note=?)` +125. `accept_contact(id)` +126. `set_close_friends(id)` +127. `replace_blocklist(id, limit=50, *, my_stories_from=?)` +128. `contact_birthdays()` +129. `edit_contact_note(id, note)` + +#### Dialogs, messages, folders — 130–180 + +130. `dialogs(offset_date=0, offset_id=0, offset_peer={'_': 'inputPeerEmpty'}, limit=50, hash=0, *, exclude_pinned=?, folder_id=?)` +131. `chat_history(peer=$peer, offset_id=0, offset_date=0, add_offset=0, limit=50, max_id=0, min_id=0, hash=0)` +132. `search_chat_messages(peer=$peer, q, filter={'_': 'inputMessagesFilterEmpty'}, min_date=0, max_date=0, offset_id=0, add_offset=0, limit=50, max_id=0, min_id=0, hash=0, *, from_id=?, saved_peer_id=?, saved_reaction=?, top_msg_id=?)` +133. `mark_chat_read(peer=$peer, max_id)` +134. `clear_chat_history(peer=$peer, max_id, *, just_clear=?, revoke=?, min_date=?, max_date=?)` +135. `peer_settings(peer=$peer)` +136. `basic_groups(id)` +137. `basic_group_details(chat_id)` +138. `search_all_messages(q, filter={'_': 'inputMessagesFilterEmpty'}, min_date=0, max_date=0, offset_rate=0, offset_peer={'_': 'inputPeerEmpty'}, offset_id=0, limit=50, *, broadcasts_only=?, groups_only=?, users_only=?, folder_id=?, community=?)` **BLOCKED** +139. `message_editability(peer=$peer, id=$message)` +140. `peer_dialogs(peers)` +141. `all_drafts()` +142. `mutual_groups(user_id, max_id=0, limit=50)` +143. `set_dialog_pinned(peer, *, pinned=?)` +144. `reorder_dialog_pins(folder_id, order, *, force=?)` +145. `pinned_dialogs(folder_id)` +146. `unread_mentions(peer=$peer, offset_id=0, add_offset=0, limit=50, max_id=0, min_id=0, *, top_msg_id=?)` +147. `mark_mentions_read(peer=$peer, *, top_msg_id=?)` +148. `recent_live_locations(peer=$peer, limit=50, hash=0)` +149. `set_dialog_unread(peer, *, unread=?, parent_peer=?)` +150. `unread_dialog_marks(*, parent_peer=?)` +151. `clear_all_drafts()` +152. `chat_online_count(peer=$peer)` +153. `message_type_counts(peer=$peer, filters, *, saved_peer_id=?, top_msg_id=?)` +154. `dismiss_peer_settings_bar(peer=$peer)` +155. `mark_discussion_read(peer=$peer, msg_id=$message, read_max_id)` +156. `unpin_all_chat_messages(peer=$peer, *, top_msg_id=?, saved_peer_id=?)` +157. `message_readers(peer=$peer, msg_id=$message)` +158. `message_search_calendar(peer=$peer, filter={'_': 'inputMessagesFilterEmpty'}, offset_id=0, offset_date=0, *, saved_peer_id=?)` +159. `message_search_positions(peer=$peer, filter={'_': 'inputMessagesFilterEmpty'}, offset_id=0, limit=50, *, saved_peer_id=?)` +160. `set_default_send_as(peer=$peer, send_as)` +161. `sent_media_search(q, filter={'_': 'inputMessagesFilterEmpty'}, limit=50)` +162. `outgoing_read_date(peer=$peer, msg_id=$message)` +163. `channel_message_author(channel=$peer, id)` +164. `move_dialogs_to_archive(folder_peers)` +165. `chat_folders()` +166. `suggested_chat_folders()` +167. `save_chat_folder(id, *, filter=?)` +168. `reorder_chat_folders(order)` +169. `set_folder_tags_visible(enabled)` +170. `share_chat_folder(chatlist, title, peers)` +171. `remove_folder_invite(chatlist, slug)` +172. `edit_folder_invite(chatlist, slug, *, title=?, peers=?)` +173. `folder_invites(chatlist)` +174. `inspect_folder_invite(slug)` +175. `join_folder_invite(slug, peers)` +176. `folder_updates(chatlist)` +177. `accept_folder_updates(chatlist, peers)` +178. `dismiss_folder_updates(chatlist)` +179. `folder_leave_suggestions(chatlist)` +180. `leave_shared_folder(chatlist, peers)` + +#### Profile, users, photos, notifications — 181–220 + +181. `edit_profile(*, first_name=?, last_name=?, about=?)` +182. `set_online_status(offline)` +183. `check_profile_username(username)` +184. `set_profile_username(username)` **BLOCKED** +185. `privacy_rules(key)` +186. `account_inactivity_ttl()` +187. `set_emoji_status(emoji_status)` +188. `suggested_emoji_statuses(hash=0)` +189. `recent_emoji_statuses(hash=0)` +190. `clear_recent_emoji_statuses()` +191. `reorder_profile_usernames(order)` +192. `set_profile_username_active(username, active)` +193. `profile_photo_emojis(hash=0)` +194. `set_profile_color(*, for_profile=?, color=?)` +195. `set_birthday(*, birthday=?)` +196. `set_personal_channel(channel)` +197. `set_profile_tab(tab)` +198. `set_music_saved(id, *, unsave=?, after_id=?)` +199. `saved_music_ids(hash=0)` +200. `user_details(id)` +201. `contact_requirements(id)` +202. `user_music(id, offset=0, limit=50, hash=0)` +203. `user_music_by_documents(id, documents)` +204. `suggest_contact_birthday(id, birthday)` +205. `select_profile_photo(id, *, fallback=?, bot=?)` +206. `upload_profile_photo(*, fallback=?, bot=?, file=?, video=?, video_start_ts=?, video_emoji_markup=?)` +207. `remove_profile_photos(id)` +208. `profile_photos(user_id, offset=0, max_id=0, limit=50)` +209. `set_contact_photo(user_id, *, suggest=?, save=?, file=?, video=?, video_start_ts=?, video_emoji_markup=?)` +210. `notification_settings(peer)` +211. `set_notification_settings(peer, settings)` +212. `reset_notification_settings()` +213. `contact_signup_notifications()` +214. `set_contact_signup_notifications(silent)` +215. `notification_exceptions(*, compare_sound=?, compare_stories=?, peer=?)` +216. `reaction_notification_settings()` +217. `set_reaction_notification_settings(settings)` +218. `saved_notification_sounds(hash=0)` +219. `set_notification_sound_saved(id, unsave)` +220. `upload_notification_sound(file, file_name, mime_type)` + +#### Basic groups, channels, moderation — 221–276 + +221. `rename_basic_group(chat_id, title)` +222. `set_basic_group_photo(chat_id, photo)` +223. `add_basic_group_member(chat_id, user_id, fwd_limit=0)` +224. `remove_basic_group_member(chat_id, user_id, *, revoke_history=?)` +225. `create_basic_group(users, title, *, ttl_period=?)` +226. `set_basic_group_admin(chat_id, user_id, is_admin)` +227. `upgrade_basic_group(chat_id)` +228. `edit_chat_description(peer=$peer, about)` +229. `set_default_member_restrictions(peer=$peer, banned_rights)` +230. `remove_basic_group(chat_id)` +231. `set_chat_auto_delete(peer=$peer, period)` +232. `set_content_protection(peer=$peer, enabled, *, request_msg_id=?)` +233. `mark_channel_read(channel=$peer, max_id)` +234. `channel_members(channel=$peer, filter={'_': 'channelParticipantsRecent'}, offset=0, limit=50, hash)` +235. `channel_member(channel=$peer, participant)` +236. `channel_details(channel=$peer)` +237. `create_channel(title, about, *, broadcast=?, megagroup=?, for_import=?, forum=?, geo_point=?, address=?, ttl_period=?)` +238. `set_channel_admin(channel=$peer, user_id, admin_rights, *, rank=?)` +239. `rename_channel(channel=$peer, title)` +240. `set_channel_photo(channel=$peer, photo)` +241. `check_channel_username(channel=$peer, username)` +242. `set_channel_username(channel=$peer, username)` +243. `join_channel(channel=$peer)` +244. `leave_channel(channel=$peer)` +245. `invite_channel_members(channel=$peer, users)` +246. `remove_channel(channel=$peer)` +247. `set_channel_signatures(channel=$peer, *, signatures_enabled=?, profiles_enabled=?)` +248. `owned_public_channels(*, by_location=?, check_limit=?, for_personal=?, for_community_peer=?)` +249. `restrict_channel_member(channel=$peer, participant, banned_rights)` +250. `channel_admin_log(channel=$peer, q='', max_id, min_id, limit=50, *, events_filter=?, admins=?)` +251. `set_group_sticker_set(channel=$peer, stickerset)` +252. `mark_channel_media_read(channel=$peer, id)` +253. `clear_channel_history(channel=$peer, max_id, *, for_everyone=?)` +254. `set_prehistory_hidden(channel=$peer, enabled)` +255. `left_channels(offset=0)` +256. `eligible_discussion_groups()` +257. `set_discussion_group(broadcast, group)` +258. `set_group_location(channel=$peer, geo_point, address)` +259. `set_slow_mode(channel=$peer, seconds)` +260. `inactive_channels()` +261. `send_as_identities(peer=$peer, *, for_paid_reactions=?, for_live_stories=?)` +262. `remove_member_history(channel=$peer, participant)` +263. `set_join_to_send(channel=$peer, enabled)` +264. `set_join_requests(channel=$peer, enabled, *, apply_to_invites=?, guard_bot=?)` +265. `reorder_channel_usernames(channel=$peer, order)` +266. `set_channel_username_active(channel=$peer, username, active)` +267. `deactivate_channel_usernames(channel=$peer)` +268. `set_antispam(channel=$peer, enabled)` +269. `set_members_hidden(channel=$peer, enabled)` +270. `set_channel_color(channel=$peer, *, for_profile=?, color=?, background_emoji_id=?)` +271. `related_channels(*, channel=?)` +272. `set_channel_emoji_status(channel=$peer, emoji_status)` +273. `set_group_emoji_set(channel=$peer, stickerset)` +274. `set_channel_auto_translation(channel=$peer, enabled)` +275. `set_channel_profile_tab(channel=$peer, tab)` +276. `edit_member_rank(peer=$peer, participant, rank)` + +#### Invites, join requests, statistics — 277–292 + +277. `create_chat_invite(peer=$peer, *, legacy_revoke_permanent=?, request_needed=?, expire_date=?, usage_limit=?, title=?)` +278. `chat_invites(peer=$peer, admin_id, limit=50, *, revoked=?, offset_date=?, offset_link=?)` +279. `chat_invite_details(peer=$peer, link)` +280. `edit_chat_invite(peer=$peer, link, *, revoked=?, expire_date=?, usage_limit=?, request_needed=?, title=?)` +281. `purge_revoked_chat_invites(peer=$peer, admin_id)` +282. `remove_chat_invite(peer=$peer, link)` +283. `invite_admins(peer=$peer)` +284. `invite_joiners(peer=$peer, offset_date=0, offset_user={'_': 'inputUserEmpty'}, limit=50, *, requested=?, subscription_expired=?, link=?, q=?)` +285. `resolve_join_request(peer=$peer, user_id, *, approved=?)` +286. `resolve_all_join_requests(peer=$peer, *, approved=?, link=?)` +287. `channel_statistics(channel=$peer, *, dark=?)` +288. `supergroup_statistics(channel=$peer, *, dark=?)` +289. `message_statistics(channel=$peer, msg_id, *, dark=?)` +290. `message_public_forwards(channel=$peer, msg_id, offset='', limit=50)` +291. `story_statistics(peer=$peer, id=$message, *, dark=?)` +292. `story_public_forwards(peer=$peer, id=$message, offset='', limit=50)` + +### 4. Дополнительные message helpers и overrides + +Это отдельный API поверх каталога. Учитывай методы, переопределённые SandboxContext: + +| Внешний вызов | Контракт | +| --- | --- | +| `await ctx.respond(content=None, **kwargs)` | Bound answer; output auto/edit/reply; при явном target — message operation | +| `await ctx.send(text, **kwargs)` | В worker задаёт output=reply, не универсальный send-to-peer | +| `await ctx.edit(text, **kwargs)` | Bound output=edit либо явная операция edit | +| `await ctx.reply(message=None)` | Получить reply через fetch; **не отправить текст** | +| `await ctx.reply_text(message=None)` | Текст reply; может быть None | +| `await ctx.msg(chat_id, message_id)` | Fetch TL-словарь сообщения либо None | +| `await ctx.resolve(value)` | Entity lookup, не гарантия полного User | +| `await ctx.send_text(text, **kwargs)` | Обычная отправка через message operation | +| `await ctx.reply_html(text, **kwargs)` / `edit_html(...)` | Bound response с output=reply/edit | +| `await ctx.delete(revoke=True)` | Удалить конкретное сообщение; проверь target/peer | +| `await ctx.pin(both_sides=None, *, notify=False, pm_oneside=False)` / `unpin()` | Не `silent=` из других библиотек | +| `await ctx.react(emoji, **kwargs)` / `unreact()` | Строка, custom emoji ID или список реакций | +| `await ctx.forward(to_chat, **kwargs)` / `forward_to(...)` / `copy_to(...)` | Copy выставляет drop_author; не произвольный upload | +| `await ctx.get_sender()` / `get_chat()` / `get_input_chat()` / `get_input_sender()` / `get_input_channel()` | Resolve и TL peer conversion | +| `await ctx.read()` / `mark_read()` / `read_contents()` | С учётом channel/topic | +| `await ctx.get_reply_message()` / `refresh()` | Получение актуального сообщения | +| `await ctx.get_buttons()` / `click(i=None, j=None, *, text=None, filter=None, data=None, share_phone=None, share_geo=None, password=None, open_url=False)` | Кнопки/голосование; phone/geo sharing явно разрешить; пароль — SRP, не строка | +| `await ctx.vote(options)` / `retract_vote()` / `get_poll_results()` | Vote принимает options/индексы по контракту | +| `await ctx.get_poll_votes(*, option=None, offset=None, limit=100)` | Получение голосовавших | +| `await ctx.get_reactions()` / `get_reactors(*, reaction=None, offset=None, limit=100)` | Reactions list | +| `await ctx.get_views(increment=False)` / `get_replies(*, offset_id=0, limit=100, **kwargs)` / `get_discussion()` | Не смешивать views с изменением read state | +| `await ctx.get_link(*, grouped=False, thread=False)` | Telegram-ссылка конкретного сообщения | +| `await ctx.edit_buttons(buttons=None)` / `remove_buttons()` / `edit_caption(caption, **kwargs)` | Модификация сообщения | +| `await ctx.send_file(media, caption=None, **kwargs)` / `send_media(...)` / `respond_file(...)` / `respond_media(...)` | output/send semantics и assets для локальной загрузки | +| `await ctx.reply_file(file, caption=None, **kwargs)` / `reply_media(...)` | Reply к конкретному сообщению | +| `await ctx.send_photo(photo, caption=None, **kwargs)` / `reply_photo(...)` | По URL может идти external media; локальный upload через assets | +| `send_video/reply_video`, `send_audio/reply_audio`, `send_voice/reply_voice`, `send_animation/reply_animation` | Все async; media, caption=None, **kwargs | +| `await ctx.send_sticker(sticker, **kwargs)` / `reply_sticker(...)` | Caption отдельно не предусмотрен | +| `await ctx.send_contact(phone, first_name, *, last_name='', **kwargs)` / `reply_contact(...)` | Контактные данные только по назначению функции | +| `await ctx.send_location(latitude, longitude, **kwargs)` / `reply_location(...)` | Не путать порядок координат | +| `await ctx.send_dice(emoji='🎲', **kwargs)` / `reply_dice(...)` | Native dice | +| `await ctx.edit_media(media, *, caption=None, kind='document', **kwargs)` | Изменение медиа; проверить kind/upload | +| `await ctx.send_rich(html, **kwargs)` / `edit_rich(rich, **kwargs)` / `reply_rich(...)` | Rich transport и fallback отдельно | +| `await ctx.save(**kwargs)` | Переслать текущее сообщение в me, не произвольный notify API | +| `await ctx.typing(action='sendMessageTypingAction')` | TL action constructor, не sugar `'typing'` | +| `await ctx.schedule(text, when, **kwargs)` | Schedule date timestamp | +| `await ctx.send_todo(title, items, *, others_can_append=False, others_can_complete=False, **kwargs)` | items — непустой список, ID уникальные positive int | +| `await ctx.edit_todo(...)` / `append_todo(items)` | Проверяется реальное todo-сообщение | +| `await ctx.send_poll(question, answers, *, multiple_choice=False, public_voters=False, correct_answers=None, solution=None, poll_options=None, **kwargs)` | `answers`, **не `options`**; минимум 2; correct_answers — уникальные индексы | +| `await ctx.close_poll()` | Получить актуальный poll и выставить closed | +| `await ctx.translate(text, to_lang=None, *, source='auto', provider='auto', **kwargs)` | telegram/google/mymemory; внешние providers требуют net; input ≤4000 UTF-8 bytes | + +Шаблон вызова с корректными keywords: + +```python +async def command_example(ctx, invocation): + history = await ctx.chat_history(limit=10) + await ctx.respond(str(len(history.get("messages", []))), rich=False) +``` + +Пример предполагает `messages` dict-result для конкретного RPC; при других +операциях проверяй их реальную форму. Не выполняй destructive methods как smoke-test. + +### 5. Fetch, системные данные, файлы + +Без raw `mt`: bound responses, fetch (`reply/msg/resolve`), `ctx.html` formatting, +`ctx.tools` (с оговорками приложения B), `ctx.version`, `ctx.uptime`, `ctx.config` snapshot, +`ctx.i18n.language`, `ctx.t`, доступные `ctx.ui/screens`/forms. Не выдумывай прямые +`ctx.sender_id`, `ctx.out`, `ctx.raw_args`, `ctx.logs` по аналогии с другой платформой. + +`ctx.memory/ram/get_memory/get_ram` и `prefix/get_prefix` в worker имеют особенности: +после замены base class на shared ContextOperations некоторые fallback значения +могут оказаться 0/'.', а не переданный в payload runtime snapshot. Проверяй +исполнение, не делай метрики/адресацию зависимыми от предполагаемого значения. + +`ctx.mt` — метод, возвращающий callable MTContext, а не безусловно готовый callable +RPC-объект; для raw API предпочитай явно подтверждённый `ctx.tg.call` и `mt` capability. + +#### Assets (capability `assets`) + +В `8cab560` исправлен путь: host `assets` использует тот же `sandbox.workspace`, +что worker. В старых версиях это не гарантировалось. + +- `await ctx.upload_file(source, file_name=...)` или `ctx.assets.upload(file, filename=...)`: + source в проверенном provider — **путь к существующему файлу workspace**, не BytesIO + и не произвольные bytes; возвращается uploaded file record. +- `await ctx.download_file(source, destination=None)` / `ctx.assets.download(...)`: + source — message dict с `chat_id` и `id`/`message_id`. Результат — относительный + путь workspace. Не bytes. Не передавай один media dict без message identity. +- `ctx.file_media(up, *, mime='application/octet-stream', file_name=None, force_file=True)` + — синхронная сборка InputMediaUploadedDocument; это не отправка и не upload. +- `await ctx.read_attachment_text(*, reply=False, max_bytes=1048576)` использует + bound fetch; лимит допустим 1..4194304, декодирует UTF-8-sig, не требует assets. + +### 6. Что нельзя считать доказанным тестом + +Каталог проверен статически и contract-mocks; реальные Telegram RPC, namespace jail, +права аккаунта и все 292 операции не запускались. Добавление списка в скилл не +является обещанием, что каждый серверный метод доступен конкретной установке. + + +## Приложение B. Tools, regdate и search + +## Hotaru tools, regdate, search и formatting helpers + +Проверено 2026-11-09 по `relay/toolkit.py`, `relay/sandbox.py`, `relay/context.py` +на `8cab560e2b9dbc009aab4670c8a78a9a790e2d1a`. + +### 1. Доступ и границы + +В worker `_build_tools` исполняет штатный toolkit и передаёт **76 экспортов +`TOOLKIT_FUNCS`** в `ctx.tools`. Пользуйся `ctx.tools.`, без импорта +`relay.toolkit`. В host есть alias `ctx.toolkit`, но у проверенного SandboxContext +его нет: не добавляй его в готовый внешний модуль по аналогии. + +Все функции ниже **синхронные**, кроме `search` и `check_restrictions`. `regdate`, +formatting, парсеры и локальные преобразования не требуют capabilities и не +делают сетевых запросов. Но экспорт имени не гарантирует работоспособность +функции в sandbox: `prune_logs` и restriction-check имеют ограничения ниже. + +Типы в сигнатурах документируют код, а не runtime validation каждого аргумента. +Не передавай недоверенные данные без проверки. Примеры — фрагменты тела handler, +не самостоятельные `.hmod`: у готового файла сначала должен быть HOTARU. + +### 2. regdate — оценка регистрации Telegram + +```text +ctx.tools.regdate(user_id, *, registration_month=None, not_after=None) +``` + +**Sync, локально, без `mt/net/state`.** Алгоритм использует встроенные ID/date +anchors и интерполяцию, не Telegram RPC и не внешний API. + +Вход: + +- `user_id`: положительный integer `< 2**63` либо строка ASCII decimal digits; + bool, отрицательный marked chat ID, username и Telegram entity не подходят. +- `registration_month`: optional строка строго `MM.YYYY`, не раньше запуска + Telegram 2013-08-14 и не из будущего. Это **заданное вызывающим ограничение**, + не автоматически полученная официальная дата. Не заполняй его догадкой. +- `not_after`: optional строка строго `YYYY-MM-DD`, не из будущего: верхняя граница + по независимо известному событию/дате. Не интерпретируется как дата регистрации. +- ID вне `_REGDATE_POINTS` без registration_month даёт ValueError. Не экстраполируй + за калибровку незаметно и не подавляй ошибку фиктивной датой. + +Результат — dict: + +| Ключ | Значение | +| --- | --- | +| `date` | Центральная оценка, ISO `YYYY-MM-DD` | +| `earliest`, `latest` | Границы оценочного диапазона, ISO даты | +| `error_days` | Максимальное отклонение от оценки до границ, integer | +| `age_days` | Возраст относительно текущей даты UTC по центральной оценке | +| `estimated` | Всегда True, включая anchor | +| `source` | `anchor`, `model`, `registration_month`; может иметь `+upper_bound` или `conflict` | +| `conflict` | Несовместимость известных ограничений с оценкой/диапазоном | +| `registration_month`, `not_after` | Переданные ограничения либо пустые строки | + +Показывай пользователю «примерно», диапазон и при необходимости конфликт. +Даже при `source='anchor'` это не подтверждённая точная дата. Не используй её +как надёжный критерий блокировки/доверия. Если конфликт=True, не выдавай результат +как точное пересечение ограничений: функция сохраняет диагностический конфликт. + +Пример без лишних capabilities: + +```python +async def command_regdate(ctx, invocation): + try: + info = ctx.tools.regdate(invocation.raw_args.strip()) + except (TypeError, ValueError): + await ctx.respond("Нужен числовой ID в поддерживаемом диапазоне.", rich=False) + return + text = ( + f"Примерная регистрация: {info['date']}\n" + f"Диапазон: {info['earliest']} — {info['latest']}\n" + f"Погрешность: до {info['error_days']} дней" + ) + if info["conflict"]: + text += "\nОграничения противоречат оценке." + await ctx.respond(text, rich=False) +``` + +Локализуй строки в настоящем модуле. Для username отдельно resolve → положительный +user ID → regdate; не передавай `ctx.message.id` (это ID сообщения). + +### 3. Асинхронный локальный поиск search + +```text +await ctx.tools.search(values, query, *, key=None, limit=10, min_score=0.76, layout=True) +``` + +Без capabilities, не ищет в Telegram/интернете. Нормализует Unicode NFKC, +регистр, ё/е, слова; учитывает совпадения, префиксы и ограниченные опечатки. +При `layout=True` пробует RU/EN раскладку с небольшим штрафом к score. +Периодически делает `await asyncio.sleep(0)`, не создаёт внешние jobs. + +- `values`: коллекция значений, не строка/bytes. +- `query`: str; пустой нормализованный запрос возвращает []. +- `key=None`: каждый value должен быть строкой либо последовательностью строк. +- `key='name'`: извлекает `value['name']`, не object attribute. +- Callable key: локальная функция, возвращающая строку или list/tuple строк; + не coroutine. Неверные типы поисковых полей дают TypeError. +- `limit`: nonnegative int, bool недопустим; 0 возвращает []. +- `min_score`: от 0 до 1. +- Результат отсортирован по score; при равенстве сохраняется приоритет исходного + порядка. Запись: `{'value': original, 'score': float, 'matched': str, 'layout': bool}`. + Это не список исходных объектов: извлекай hit['value'] явно. + +```python +async def command_find(ctx, invocation): + items = [{"name": "Backup", "id": "backups"}, {"name": "Settings", "id": "settings"}] + hits = await ctx.tools.search(items, invocation.raw_args, key="name", limit=5) + text = "\n".join(ctx.tools.escape(hit["value"]["name"]) for hit in hits) + await ctx.respond(text or "Нет совпадений.", rich=False) +``` + +### 4. Полный каталог tools: 76 экспортов + +В следующих строках вызов без префикса означает `ctx.tools.(...)`. +Возвращаемые типы взяты из определения функции. `Any` не означает сериализацию +любого объекта через IPC: tools исполняются локально внутри worker. + +#### Аргументы — 6 + +| Сигнатура | Что делает / ограничения | +| --- | --- | +| `args_parse(text: str) -> list[str]` | **Полный текст команды**; отбрасывает первый токен, применяет shlex к остатку; при неверных кавычках возвращает остаток одним элементом | +| `args_raw(text: str) -> str` | Отбрасывает первый токен полного текста команды | +| `args_split(text: str, separator: str \| list[str]) -> list[str]` | Разбивает raw args, trim и удаление пустых частей | +| `args_int(text: str) -> list[int]` | Числа из args_parse; нечисловые токены пропускаются | +| `args_bool(text: str) -> list[bool]` | Известные yes/no/on/off/true/false/1/0/да/нет/вкл/выкл; остальные пропускаются | +| `args_float(text: str) -> list[float]` | Floats из args_parse; неверные токены пропускаются | + +**Ловушка:** `args_parse(invocation.raw_args)` потеряет первый аргумент. Для raw_args +используй `shlex.split(invocation.raw_args)` с явной обработкой ошибок либо передай +synthetic full command text, если именно toolkit parser нужен по контракту. + +#### HTML, entities и ссылки — 12 + +| Сигнатура | Семантика | +| --- | --- | +| `escape(value: Any) -> str` | HTML text escaping без quotes | +| `escape_attr(value: Any) -> str` | HTML attribute escaping с quotes | +| `escape_smart(text: str) -> str` | Сохраняет allowlisted tags, escape остальное; **не sanitizer атрибутов/URL** | +| `strip_tags(text: str, keep_tg: bool=True) -> str` | В текущей реализации итоговый regex удаляет все tags даже при keep_tg=True; не обещай сохранение Telegram tags | +| `strip_emoji(text: str) -> str` | Regex-удаление диапазонов emoji; не универсальный grapheme parser | +| `flag(code: str) -> str` | Две ASCII letters → regional indicator flag; иначе исходник | +| `entity_url(entity: object, openmessage: bool=False) -> str` | Локальная сборка tg:// для user/username; не делает resolve | +| `entity_link(entity: object, label: str \| None=None) -> str` | Escaped HTML link по entity_url; без URL возвращает escaped label | +| `valid_url(url: str) -> bool` | Только bool(urlparse(url).netloc); это **не** проверка безопасности/SSRF | +| `is_url(text: str) -> bool` | Ограниченный HTTP(S) regex, не полный стандарт URL | +| `urls_extract(text: str) -> list[str]` | Regex извлекает HTTP(S) ссылки | +| `html_fix(text: str) -> str` | Alias escape_smart; не структурный HTML validator | + +Ни valid_url, ни is_url, ни escape_smart не дают права обходить сетевую политику. +Для полностью недоверенного текста используй escape, а не escape_smart. + +#### Коллекции и служебные данные — 9 + +| Сигнатура | Семантика | +| --- | --- | +| `chunk(items: list[Any] \| tuple[Any, ...] \| str, size: int) -> list[Any]` | Slices размера size>0; не HTML-aware | +| `random_str(size: int, charset: str \| None=None) -> str` | random.choice; **не криптографический токен**; size<1 → '' | +| `merge_dicts(a: dict[str, Any], b: dict[str, Any], *, deep: bool=True) -> dict[str, Any]` | Мутирует **b**, приоритет у a; list merge убирает дубли через dict.fromkeys | +| `json_ok(value: Any) -> bool` | Проверяет json.dumps; не проверяет IPC limits или business schema | +| `flatten(nested: list[Any]) -> list[Any]` | Разворачивает только один уровень вложенных list, не рекурсивно | +| `censor(obj: Any, fields: list[str] \| None=None, replacement: str='***') -> Any` | Рекурсивно dict/list, маскирует строковые значения известных ключей; numeric и неизвестные секреты могут остаться | +| `attr(obj: Any, name: str, default: Any=None) -> Any` | getattr с подавлением Exception; **не dict.get** | +| `face() -> str` | Случайный escaped kaomoji | +| `hash_short(text: str, length: int=8) -> str` | Срез hex SHA-256; не парольный hash и не уникальный ID-гарант | + +#### Message/entity introspection — 7 + +| Сигнатура | Семантика | +| --- | --- | +| `chat_id(message: Any) -> int \| None` | Извлекает chat_id; для marked channel ID удаляет -100 prefix, то есть может вернуть **raw positive channel ID** | +| `entity_id(entity: Any) -> int \| None` | channel_id/chat_id/user_id/id для dict, иначе .id; не делает Telegram resolve | +| `topic_id(message: Any) -> int \| None` | topic_id/message_thread_id/top_msg_id; не разбирает все варианты reply header | +| `mime(message: Any) -> str` | Шаллоу media/document lookup; при иной структуре может вернуть '' | +| `msg_link(message: Any, chat: Any=None) -> str` | Локальная сборка ссылки; raw/marked ID и username могут потребовать дополнительной обработки | +| `has_media(message: Any) -> bool` | Проверяет доступные поля; не fetch скрытого/непереданного attachment | +| `target_id(message: Any, arg_index: int=0) -> int \| None` | Text mention/числовой аргумент; не полноценный username resolver | + +`tools.chat_id` нельзя бездумно передавать как адресата RPC: не путай raw channel +ID и marked chat ID. Для достоверной ссылки используй `await ctx.get_link()` на +полном конкретном сообщении, для пользователя — `ctx.resolve` и проверку типа entity. + +#### Время и числа — 12 + +| Сигнатура | Семантика | +| --- | --- | +| `file_size(size_bytes: int \| float) -> str` | Формат по 1024, B..PB | +| `iso_time() -> str` | Текущее datetime UTC isoformat | +| `uptime() -> int` | Секунды с импорта toolkit в данном процессе, **не обязательно runtime uptime** | +| `uptime_fmt(language: str='en') -> str` | duration(toolkit uptime, language) | +| `duration(seconds: int \| float, language: str='en') -> str` | Локализованная длительность; normalize locale; отрицательное → 0; не планировщик | +| `timestamp(value: int \| float, language: str='en') -> str` | Unix timestamp → локализованная дата/время **UTC** | +| `time_range(start: int \| float, end: int \| float \| None=None, language: str='en') -> str` | Форматированный UTC диапазон | +| `plural(count: int \| float, one: str, few: str='', many: str='') -> str` | Выбирает форму; возвращает форму, **не число + форму** | +| `percent(value: int \| float, total: int \| float, decimals: int=1) -> str` | Процент; total=0 → '0%'; не clamp до 100 | +| `clamp(value: int \| float, minimum: int \| float, maximum: int \| float) -> int \| float` | Ограничить диапазон | +| `mask(value: str, visible: int=4, char: str='•') -> str` | Маскирование строки; проверяй visible>0: крайние значения ведут себя по Python slices | +| `countdown(seconds: int \| float) -> str` | duration или 'now'; это отображение, **не timer/task** | + +Для uptime самого userbot предпочитай подтверждённый `ctx.uptime`, а не время +жизни worker/toolkit. Поддержка локалей formatter не равна наличию перевода ядра. + +#### Шаблоны и представление — 17 + +| Сигнатура | Семантика | +| --- | --- | +| `render(template: str, **data: Any) -> str` | Простой replace `{key}`; **нет escaping, type validation и scopes** | +| `template_fields(raw: object) -> dict[str, dict[str, Any]]` | Валидация 1..64 полей, type/example/description/format | +| `template_names(template: str, fields: dict[str, Any] \| None=None, *, legacy_braces: bool=False) -> list[str]` | Имена placeholders; с fields проверяет declared names | +| `template_render(template: object, fields: object, values: object=None, *, legacy_braces: bool=False) -> str` | Безопасный declared-template pipeline; values=None использует example values | +| `truncate(text: str, limit: int, suffix: str='…') -> str` | Текстовое обрезание с попыткой сохранить слово; не HTML-safe split | +| `table(rows: list[list[Any] \| tuple[Any, ...] \| dict[str, Any]], headers: list[str] \| None=None) -> str` | **Rich HTML `
`**, escaped cells; не ASCII table | +| `progress(current: int \| float, total: int \| float, width: int=10, filled: str='█', empty: str='░') -> str` | Текстовый progress bar с clamp ratio | +| `code_block(text: str, language: str='') -> str` | Escaped `
` |
+| `spoiler(text: str) -> str` | Оборачивает в tg-spoiler, **не escape содержимое** |
+| `blockquote(text: str, expandable: bool=False) -> str` | Оборачивает HTML; содержимое **не escape** |
+| `mention(user_id: int \| str, name: str \| None=None) -> str` | tg://user; label escape; user_id сначала validate |
+| `link(label: str, url: str) -> str` | Escaped HTML label/href; URL safety отдельно |
+| `list_items(items: list[str], ordered: bool=False) -> str` | Rich ul/ol; items **не escape** |
+| `kv(pairs: dict[str, Any] \| list[tuple[str, Any]], bold_keys: bool=True) -> str` | Escaped key/value, `
` separators | +| `tree(items: list[str], indent: str=' ') -> str` | Escaped плоское дерево в code; indent в текущем теле не используется | +| `badge(text: str, style: str='info') -> str` | Текстовый icon+escaped label, не Telegram button | +| `wordmark() -> str` | Статическая последовательность tg-emoji wordmark | + +`template_validate` существует внутри файла, но **не экспортирован** в +TOOLKIT_FUNCS: не вызывай `ctx.tools.template_validate`. Для межмодульных полей +нужен `ctx.render_template_async`, не локальная подстановка с обходом scopes. + +#### Rich/text/buttons — 7 + +| Сигнатура | Семантика | +| --- | --- | +| `rich_to_html(message: object) -> str` | TL rich_message blocks из dict → HTML; не произвольный HTML renderer | +| `message_text(message: object) -> str` | Plain текст из rich/message/raw_text/text/caption; str возвращается как есть; None/неполное сообщение → '' | +| `entities_to_html(text: str \| None, entities: list[object] \| tuple[object, ...] \| None=None) -> str` | Telegram UTF-16 entity offsets → HTML; не удаляй offsets до преобразования | +| `btn_html(button: dict[str, Any]) -> str` | Rich tg-button из url/copy_text/callback_data; **не регистрирует handler и не подписывает callback** | +| `buttons_html(buttons: list[Any], kind: str='page') -> str` | Row/group rich HTML, kind='text' → плоский список tags | +| `needs_form(buttons: object) -> bool` | Input detection по старому dict-полю input, не универсальная проверка всех UI routes | +| `needs_callback(buttons: object) -> bool` | Проверяет некоторые callback/input поля; **не учитывает все worker action_id/Screen kinds** | + +`message_text` работает только с переданными данными. Для неполного ctx.message +сначала fetch при необходимости. Он может вернуть plain текст с `<`/`&`, поэтому +escape перед повторной HTML-отправкой обязателен. + +#### Пагинация, диагностика, special tools — 6 + +| Сигнатура | Семантика | +| --- | --- | +| `paginate_chunks(text: str, limit: int=4000) -> list[str]` | Деление текста по строкам/символам; **не HTML-aware**; '' → ['']; limit должен быть положительным | +| `classify_error(exc: Any) -> dict[str, Any]` | Локальная эвристика по тексту/seconds, поля type/is_restriction/flood_wait/detail/recoverable | +| `await check_restrictions(ctx: Any) -> dict[str, Any]` | Проверяет users.getUsers только если ctx имеет настоящий app/runtime.app; в sandbox обычно его нет | +| `prune_logs(root: str \| Path='.', max_file_bytes: int=8*1024*1024, keep_tail_bytes: int=1*1024*1024) -> int` | Внутри импортирует hotaru.observatory; **не worker-safe**, не вызывай из внешнего модуля | +| `regdate(user_id: object, *, registration_month: object=None, not_after: object=None) -> dict[str, str \| int \| bool]` | Локальная оценка регистрации, см. раздел 2 | +| `await search(values: Any, query: object, *, key: Any=None, limit: object=10, min_score: float=0.76, layout: bool=True) -> list[dict[str, Any]]` | Локальный fuzzy search, см. раздел 3 | + +`check_restrictions` без host app вернёт default `can_send=True`, но это **не +проверка** состояния Telegram. `ctx.classify_error`/`ctx.check_restrictions` из +shared ContextOperations тоже могут импортировать relay.toolkit, что запрещено +worker audit hook. Для локальной классификации используй `ctx.tools.classify_error`. +Не обещай успешный account health check по default результату и не импортируй +ядро, чтобы обойти ограничение. + +### 5. Отдельный ctx.html (не tools) + +Проверенный `_HtmlHelper` worker предоставляет sync: + +- `ctx.html.escape(value)`; +- `bold(value)`, `italic(value)`, `code(value)`, `underline(value)`, `quote(value)`; +- `link(label, url)`; +- `pre(value, language=None)`. + +Они escape содержимое. Это отличается от `tools.blockquote/spoiler/list_items`, +которые принимают уже подготовленную разметку. Форматирование не отправляет +сообщение и не требует capabilities. + +### 6. Критерий достоверности + +Список экспортов и сигнатуры проверяются встроенным скриптом +из [приложения D](#api-inspector) с аргументами ` --section tools`. Источник `TOOLKIT_FUNCS` важнее случайных top-level def и +неполного автодополнения. Не устанавливай внешние библиотеки для уже имеющихся +tools. При обновлении исходника сравни состав, сигнатуры и поведение, а не только +число функций. Live Telegram и Linux sandbox не подтверждены одним AST-тестом. + + +## Приложение C. Полные карточки методов + +## Hotaru: полные карточки контекстных методов + +292 карточки, сформированные из AST исходников Hotaru; без импорта ядра и Telegram RPC. +Базовый снимок скилла: `8cab560e2b9dbc009aab4670c8a78a9a790e2d1a`, 2026-11-09. +При регенерации по другой версии актуальность определяют SHA-256 ниже, а не эта отметка. + +### Как читать карточки + +- Это справочные сигнатуры в стиле Python, не исполняемые вызовы: `*` означает + рекомендуемые keyword-аргументы; реальные positional slots указаны отдельно. +- Все операции асинхронные: в handler используй `await ctx.(...)`. +- `CURRENT_PEER`, `CURRENT_MESSAGE`, `RANDOM_ID` обозначают defaults ядра, + а не имена, которые нужно объявлять в модуле. Обычно соответствующий keyword пропускают. +- TL `flags.N?T` — optional поле; `Vector` — последовательность; типы сохраняют + запись исходной TL-схемы и не являются готовыми Python-аннотациями. +- «Обязательный» означает: вызывающий обязан передать значение, поскольку ядро + не подставляет default. Наличие обязательного TL-поля не исключает default ядра. +- Optional `None` в справочной сигнатуре означает пропуск поля, не обязательную + отправку None в Telegram. Keyword со статусом «запрещён» передавать нельзя. +- **Результат: `Any`, зависит от RPC.** CTX_CATALOG не хранит тип результата, + а host распаковывает/фильтрует response. Непроверенные returns сайта не копируются. + Для конкретного результата сверяй TL result schema используемого GoyGram и host adapter. +- «Без raw mt» не отменяет ACL Telegram, denylist, Premium, media/assets, net, + state и другие ограничения всей операции. Подробности: [приложение A](#context-contract). + +### Контроль источников + +| Файл | SHA-256 содержимого | +| --- | --- | +| `relay/context.py` | `af66ab88029113b354451c0748a5adb641f3dcfab0a7998d073368f4c5f79b74` | +| `relay/toolkit.py` | `6fbae44abad4595b3695fecead063fa66c50ea72b3784924e2c9e6e023d9f013` | +| `relay/sandbox.py` | `34c660ebc571fac589dc1406da093c7cedfe78654d4ae394c06a1af3cb904815` | +| `relay/caps.py` | `215248de25954b1023342b1ea4a328230b499dd68d411f04200dba7fe29ab9d7` | + +### Навигация по namespace + +- **messages (126):** [set_checklist_completed](#ctx-set_checklist_completed), [add_poll_answer](#ctx-add_poll_answer), [remove_poll_answer](#ctx-remove_poll_answer), [unread_poll_votes](#ctx-unread_poll_votes), [mark_poll_votes_read](#ctx-mark_poll_votes_read), [scheduled_messages](#ctx-scheduled_messages), [scheduled_by_ids](#ctx-scheduled_by_ids), [publish_scheduled](#ctx-publish_scheduled), [cancel_scheduled](#ctx-cancel_scheduled), [configure_chat_reactions](#ctx-configure_chat_reactions), [available_reactions](#ctx-available_reactions), [set_default_reaction](#ctx-set_default_reaction), [unread_reactions](#ctx-unread_reactions), [mark_reactions_read](#ctx-mark_reactions_read), [popular_reactions](#ctx-popular_reactions), [recent_reactions](#ctx-recent_reactions), [clear_recent_reactions](#ctx-clear_recent_reactions), [remove_member_reactions](#ctx-remove_member_reactions), [remove_member_message_reaction](#ctx-remove_member_message_reaction), [saved_dialogs](#ctx-saved_dialogs), [saved_history](#ctx-saved_history), [clear_saved_history](#ctx-clear_saved_history), [pinned_saved_dialogs](#ctx-pinned_saved_dialogs), [set_saved_dialog_pinned](#ctx-set_saved_dialog_pinned), [reorder_saved_pins](#ctx-reorder_saved_pins), [saved_reaction_tags](#ctx-saved_reaction_tags), [rename_saved_tag](#ctx-rename_saved_tag), [suggested_saved_tags](#ctx-suggested_saved_tags), [saved_dialogs_by_peers](#ctx-saved_dialogs_by_peers), [mark_saved_history_read](#ctx-mark_saved_history_read), [forum_topics](#ctx-forum_topics), [forum_topics_by_ids](#ctx-forum_topics_by_ids), [edit_forum_topic](#ctx-edit_forum_topic), [set_forum_topic_pinned](#ctx-set_forum_topic_pinned), [reorder_forum_pins](#ctx-reorder_forum_pins), [create_forum_topic](#ctx-create_forum_topic), [remove_forum_topic](#ctx-remove_forum_topic), [stickers_for_emoji](#ctx-stickers_for_emoji), [installed_sticker_sets](#ctx-installed_sticker_sets), [sticker_set](#ctx-sticker_set), [install_sticker_set](#ctx-install_sticker_set), [uninstall_sticker_set](#ctx-uninstall_sticker_set), [reorder_sticker_sets](#ctx-reorder_sticker_sets), [saved_gifs](#ctx-saved_gifs), [set_gif_saved](#ctx-set_gif_saved), [featured_sticker_sets](#ctx-featured_sticker_sets), [mark_featured_stickers_seen](#ctx-mark_featured_stickers_seen), [recent_stickers](#ctx-recent_stickers), [set_sticker_recent](#ctx-set_sticker_recent), [clear_recent_stickers](#ctx-clear_recent_stickers), [archived_sticker_sets](#ctx-archived_sticker_sets), [installed_masks](#ctx-installed_masks), [media_sticker_sets](#ctx-media_sticker_sets), [favorite_stickers](#ctx-favorite_stickers), [set_sticker_favorite](#ctx-set_sticker_favorite), [search_sticker_sets](#ctx-search_sticker_sets), [bulk_sticker_set_action](#ctx-bulk_sticker_set_action), [older_featured_sticker_sets](#ctx-older_featured_sticker_sets), [custom_emoji_documents](#ctx-custom_emoji_documents), [installed_emoji_sets](#ctx-installed_emoji_sets), [featured_emoji_sets](#ctx-featured_emoji_sets), [search_custom_emoji](#ctx-search_custom_emoji), [search_emoji_sets](#ctx-search_emoji_sets), [owned_sticker_sets](#ctx-owned_sticker_sets), [search_stickers](#ctx-search_stickers), [dialogs](#ctx-dialogs), [chat_history](#ctx-chat_history), [search_chat_messages](#ctx-search_chat_messages), [mark_chat_read](#ctx-mark_chat_read), [clear_chat_history](#ctx-clear_chat_history), [peer_settings](#ctx-peer_settings), [basic_groups](#ctx-basic_groups), [basic_group_details](#ctx-basic_group_details), [search_all_messages](#ctx-search_all_messages), [message_editability](#ctx-message_editability), [peer_dialogs](#ctx-peer_dialogs), [all_drafts](#ctx-all_drafts), [mutual_groups](#ctx-mutual_groups), [set_dialog_pinned](#ctx-set_dialog_pinned), [reorder_dialog_pins](#ctx-reorder_dialog_pins), [pinned_dialogs](#ctx-pinned_dialogs), [unread_mentions](#ctx-unread_mentions), [mark_mentions_read](#ctx-mark_mentions_read), [recent_live_locations](#ctx-recent_live_locations), [set_dialog_unread](#ctx-set_dialog_unread), [unread_dialog_marks](#ctx-unread_dialog_marks), [clear_all_drafts](#ctx-clear_all_drafts), [chat_online_count](#ctx-chat_online_count), [message_type_counts](#ctx-message_type_counts), [dismiss_peer_settings_bar](#ctx-dismiss_peer_settings_bar), [mark_discussion_read](#ctx-mark_discussion_read), [unpin_all_chat_messages](#ctx-unpin_all_chat_messages), [message_readers](#ctx-message_readers), [message_search_calendar](#ctx-message_search_calendar), [message_search_positions](#ctx-message_search_positions), [set_default_send_as](#ctx-set_default_send_as), [sent_media_search](#ctx-sent_media_search), [outgoing_read_date](#ctx-outgoing_read_date), [chat_folders](#ctx-chat_folders), [suggested_chat_folders](#ctx-suggested_chat_folders), [save_chat_folder](#ctx-save_chat_folder), [reorder_chat_folders](#ctx-reorder_chat_folders), [set_folder_tags_visible](#ctx-set_folder_tags_visible), [rename_basic_group](#ctx-rename_basic_group), [set_basic_group_photo](#ctx-set_basic_group_photo), [add_basic_group_member](#ctx-add_basic_group_member), [remove_basic_group_member](#ctx-remove_basic_group_member), [create_basic_group](#ctx-create_basic_group), [set_basic_group_admin](#ctx-set_basic_group_admin), [upgrade_basic_group](#ctx-upgrade_basic_group), [edit_chat_description](#ctx-edit_chat_description), [set_default_member_restrictions](#ctx-set_default_member_restrictions), [remove_basic_group](#ctx-remove_basic_group), [set_chat_auto_delete](#ctx-set_chat_auto_delete), [set_content_protection](#ctx-set_content_protection), [edit_member_rank](#ctx-edit_member_rank), [create_chat_invite](#ctx-create_chat_invite), [chat_invites](#ctx-chat_invites), [chat_invite_details](#ctx-chat_invite_details), [edit_chat_invite](#ctx-edit_chat_invite), [purge_revoked_chat_invites](#ctx-purge_revoked_chat_invites), [remove_chat_invite](#ctx-remove_chat_invite), [invite_admins](#ctx-invite_admins), [invite_joiners](#ctx-invite_joiners), [resolve_join_request](#ctx-resolve_join_request), [resolve_all_join_requests](#ctx-resolve_all_join_requests) +- **stats (7):** [poll_statistics](#ctx-poll_statistics), [channel_statistics](#ctx-channel_statistics), [supergroup_statistics](#ctx-supergroup_statistics), [message_statistics](#ctx-message_statistics), [message_public_forwards](#ctx-message_public_forwards), [story_statistics](#ctx-story_statistics), [story_public_forwards](#ctx-story_public_forwards) +- **channels (46):** [set_forum_enabled](#ctx-set_forum_enabled), [set_forum_message_view](#ctx-set_forum_message_view), [channel_message_author](#ctx-channel_message_author), [mark_channel_read](#ctx-mark_channel_read), [channel_members](#ctx-channel_members), [channel_member](#ctx-channel_member), [channel_details](#ctx-channel_details), [create_channel](#ctx-create_channel), [set_channel_admin](#ctx-set_channel_admin), [rename_channel](#ctx-rename_channel), [set_channel_photo](#ctx-set_channel_photo), [check_channel_username](#ctx-check_channel_username), [set_channel_username](#ctx-set_channel_username), [join_channel](#ctx-join_channel), [leave_channel](#ctx-leave_channel), [invite_channel_members](#ctx-invite_channel_members), [remove_channel](#ctx-remove_channel), [set_channel_signatures](#ctx-set_channel_signatures), [owned_public_channels](#ctx-owned_public_channels), [restrict_channel_member](#ctx-restrict_channel_member), [channel_admin_log](#ctx-channel_admin_log), [set_group_sticker_set](#ctx-set_group_sticker_set), [mark_channel_media_read](#ctx-mark_channel_media_read), [clear_channel_history](#ctx-clear_channel_history), [set_prehistory_hidden](#ctx-set_prehistory_hidden), [left_channels](#ctx-left_channels), [eligible_discussion_groups](#ctx-eligible_discussion_groups), [set_discussion_group](#ctx-set_discussion_group), [set_group_location](#ctx-set_group_location), [set_slow_mode](#ctx-set_slow_mode), [inactive_channels](#ctx-inactive_channels), [send_as_identities](#ctx-send_as_identities), [remove_member_history](#ctx-remove_member_history), [set_join_to_send](#ctx-set_join_to_send), [set_join_requests](#ctx-set_join_requests), [reorder_channel_usernames](#ctx-reorder_channel_usernames), [set_channel_username_active](#ctx-set_channel_username_active), [deactivate_channel_usernames](#ctx-deactivate_channel_usernames), [set_antispam](#ctx-set_antispam), [set_members_hidden](#ctx-set_members_hidden), [set_channel_color](#ctx-set_channel_color), [related_channels](#ctx-related_channels), [set_channel_emoji_status](#ctx-set_channel_emoji_status), [set_group_emoji_set](#ctx-set_group_emoji_set), [set_channel_auto_translation](#ctx-set_channel_auto_translation), [set_channel_profile_tab](#ctx-set_channel_profile_tab) +- **stories (29):** [story_posting_quota](#ctx-story_posting_quota), [post_story](#ctx-post_story), [edit_story](#ctx-edit_story), [delete_stories](#ctx-delete_stories), [set_stories_on_profile](#ctx-set_stories_on_profile), [story_feed](#ctx-story_feed), [profile_stories](#ctx-profile_stories), [archived_stories](#ctx-archived_stories), [stories_by_ids](#ctx-stories_by_ids), [mark_stories_read](#ctx-mark_stories_read), [story_viewers](#ctx-story_viewers), [story_view_counts](#ctx-story_view_counts), [story_link](#ctx-story_link), [activate_story_stealth](#ctx-activate_story_stealth), [react_to_story](#ctx-react_to_story), [peer_stories](#ctx-peer_stories), [story_read_markers](#ctx-story_read_markers), [peer_latest_story_ids](#ctx-peer_latest_story_ids), [story_posting_chats](#ctx-story_posting_chats), [set_peer_stories_hidden](#ctx-set_peer_stories_hidden), [story_reaction_senders](#ctx-story_reaction_senders), [reorder_profile_story_pins](#ctx-reorder_profile_story_pins), [search_stories](#ctx-search_stories), [create_story_album](#ctx-create_story_album), [edit_story_album](#ctx-edit_story_album), [reorder_story_albums](#ctx-reorder_story_albums), [remove_story_album](#ctx-remove_story_album), [story_albums](#ctx-story_albums), [story_album_items](#ctx-story_album_items) +- **stickers (11):** [create_sticker_set](#ctx-create_sticker_set), [remove_sticker](#ctx-remove_sticker), [move_sticker](#ctx-move_sticker), [add_sticker](#ctx-add_sticker), [set_sticker_set_thumbnail](#ctx-set_sticker_set_thumbnail), [check_sticker_set_name](#ctx-check_sticker_set_name), [suggest_sticker_set_name](#ctx-suggest_sticker_set_name), [edit_sticker_metadata](#ctx-edit_sticker_metadata), [rename_sticker_set](#ctx-rename_sticker_set), [remove_sticker_set](#ctx-remove_sticker_set), [replace_sticker](#ctx-replace_sticker) +- **contacts (21):** [contact_ids](#ctx-contact_ids), [contact_statuses](#ctx-contact_statuses), [contacts_list](#ctx-contacts_list), [import_contacts](#ctx-import_contacts), [remove_contacts](#ctx-remove_contacts), [remove_contacts_by_phone](#ctx-remove_contacts_by_phone), [block_peer](#ctx-block_peer), [unblock_peer](#ctx-unblock_peer), [blocked_peers](#ctx-blocked_peers), [search_public_peers](#ctx-search_public_peers), [frequent_peers](#ctx-frequent_peers), [reset_peer_rating](#ctx-reset_peer_rating), [clear_imported_contacts](#ctx-clear_imported_contacts), [imported_contacts](#ctx-imported_contacts), [set_frequent_peers_enabled](#ctx-set_frequent_peers_enabled), [add_contact](#ctx-add_contact), [accept_contact](#ctx-accept_contact), [set_close_friends](#ctx-set_close_friends), [replace_blocklist](#ctx-replace_blocklist), [contact_birthdays](#ctx-contact_birthdays), [edit_contact_note](#ctx-edit_contact_note) +- **folders (1):** [move_dialogs_to_archive](#ctx-move_dialogs_to_archive) +- **chatlists (11):** [share_chat_folder](#ctx-share_chat_folder), [remove_folder_invite](#ctx-remove_folder_invite), [edit_folder_invite](#ctx-edit_folder_invite), [folder_invites](#ctx-folder_invites), [inspect_folder_invite](#ctx-inspect_folder_invite), [join_folder_invite](#ctx-join_folder_invite), [folder_updates](#ctx-folder_updates), [accept_folder_updates](#ctx-accept_folder_updates), [dismiss_folder_updates](#ctx-dismiss_folder_updates), [folder_leave_suggestions](#ctx-folder_leave_suggestions), [leave_shared_folder](#ctx-leave_shared_folder) +- **account (30):** [edit_profile](#ctx-edit_profile), [set_online_status](#ctx-set_online_status), [check_profile_username](#ctx-check_profile_username), [set_profile_username](#ctx-set_profile_username), [privacy_rules](#ctx-privacy_rules), [account_inactivity_ttl](#ctx-account_inactivity_ttl), [set_emoji_status](#ctx-set_emoji_status), [suggested_emoji_statuses](#ctx-suggested_emoji_statuses), [recent_emoji_statuses](#ctx-recent_emoji_statuses), [clear_recent_emoji_statuses](#ctx-clear_recent_emoji_statuses), [reorder_profile_usernames](#ctx-reorder_profile_usernames), [set_profile_username_active](#ctx-set_profile_username_active), [profile_photo_emojis](#ctx-profile_photo_emojis), [set_profile_color](#ctx-set_profile_color), [set_birthday](#ctx-set_birthday), [set_personal_channel](#ctx-set_personal_channel), [set_profile_tab](#ctx-set_profile_tab), [set_music_saved](#ctx-set_music_saved), [saved_music_ids](#ctx-saved_music_ids), [notification_settings](#ctx-notification_settings), [set_notification_settings](#ctx-set_notification_settings), [reset_notification_settings](#ctx-reset_notification_settings), [contact_signup_notifications](#ctx-contact_signup_notifications), [set_contact_signup_notifications](#ctx-set_contact_signup_notifications), [notification_exceptions](#ctx-notification_exceptions), [reaction_notification_settings](#ctx-reaction_notification_settings), [set_reaction_notification_settings](#ctx-set_reaction_notification_settings), [saved_notification_sounds](#ctx-saved_notification_sounds), [set_notification_sound_saved](#ctx-set_notification_sound_saved), [upload_notification_sound](#ctx-upload_notification_sound) +- **users (5):** [user_details](#ctx-user_details), [contact_requirements](#ctx-contact_requirements), [user_music](#ctx-user_music), [user_music_by_documents](#ctx-user_music_by_documents), [suggest_contact_birthday](#ctx-suggest_contact_birthday) +- **photos (5):** [select_profile_photo](#ctx-select_profile_photo), [upload_profile_photo](#ctx-upload_profile_photo), [remove_profile_photos](#ctx-remove_profile_photos), [profile_photos](#ctx-profile_photos), [set_contact_photo](#ctx-set_contact_photo) + +### Карточки методов + + +#### 1. `ctx.set_checklist_completed` + +- **MTProto RPC:** `messages.toggleTodoCompleted` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.toggleTodoCompleted`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.toggleTodoCompleted`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_checklist_completed(*, peer=CURRENT_PEER, msg_id=CURRENT_MESSAGE, completed, incompleted) +``` + +**Порядок positional slots:** `peer, msg_id, completed, incompleted`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `msg_id` | `int` | нет | `CURRENT_MESSAGE` | +| `completed` | `Vector` | да | — | +| `incompleted` | `Vector` | да | — | + + +#### 2. `ctx.add_poll_answer` + +- **MTProto RPC:** `messages.addPollAnswer` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.addPollAnswer`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.addPollAnswer`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.add_poll_answer(*, peer=CURRENT_PEER, msg_id=CURRENT_MESSAGE, answer) +``` + +**Порядок positional slots:** `peer, msg_id, answer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `msg_id` | `int` | нет | `CURRENT_MESSAGE` | +| `answer` | `PollAnswer` | да | — | + + +#### 3. `ctx.remove_poll_answer` + +- **MTProto RPC:** `messages.deletePollAnswer` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.deletePollAnswer`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.deletePollAnswer`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_poll_answer(*, peer=CURRENT_PEER, msg_id=CURRENT_MESSAGE, option) +``` + +**Порядок positional slots:** `peer, msg_id, option`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `msg_id` | `int` | нет | `CURRENT_MESSAGE` | +| `option` | `bytes` | да | — | + + +#### 4. `ctx.unread_poll_votes` + +- **MTProto RPC:** `messages.getUnreadPollVotes` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getUnreadPollVotes`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getUnreadPollVotes`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.unread_poll_votes(*, peer=CURRENT_PEER, top_msg_id=None, offset_id=0, add_offset=0, limit=50, max_id=0, min_id=0) +``` + +**Порядок positional slots:** `peer, offset_id, add_offset, limit, max_id, min_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `top_msg_id` | `flags.0?int` | нет | поле пропускается | +| `offset_id` | `int` | нет | `0` | +| `add_offset` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | +| `max_id` | `int` | нет | `0` | +| `min_id` | `int` | нет | `0` | + + +#### 5. `ctx.mark_poll_votes_read` + +- **MTProto RPC:** `messages.readPollVotes` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.readPollVotes`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.readPollVotes`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.mark_poll_votes_read(*, peer=CURRENT_PEER, top_msg_id=None) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `top_msg_id` | `flags.0?int` | нет | поле пропускается | + + +#### 6. `ctx.poll_statistics` + +- **MTProto RPC:** `stats.getPollStats` +- **Namespace:** `stats` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stats.getPollStats`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stats.getPollStats`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.poll_statistics(*, dark=None, peer=CURRENT_PEER, msg_id=CURRENT_MESSAGE) +``` + +**Порядок positional slots:** `peer, msg_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `dark` | `flags.0?true` | нет | поле пропускается | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `msg_id` | `int` | нет | `CURRENT_MESSAGE` | + + +#### 7. `ctx.scheduled_messages` + +- **MTProto RPC:** `messages.getScheduledHistory` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getScheduledHistory`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getScheduledHistory`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.scheduled_messages(*, peer=CURRENT_PEER, hash=0) +``` + +**Порядок positional slots:** `peer, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `hash` | `long` | нет | `0` | + + +#### 8. `ctx.scheduled_by_ids` + +- **MTProto RPC:** `messages.getScheduledMessages` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getScheduledMessages`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getScheduledMessages`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.scheduled_by_ids(*, peer=CURRENT_PEER, id) +``` + +**Порядок positional slots:** `peer, id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `id` | `Vector` | да | — | + + +#### 9. `ctx.publish_scheduled` + +- **MTProto RPC:** `messages.sendScheduledMessages` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.sendScheduledMessages`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.sendScheduledMessages`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.publish_scheduled(*, peer=CURRENT_PEER, id) +``` + +**Порядок positional slots:** `peer, id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `id` | `Vector` | да | — | + + +#### 10. `ctx.cancel_scheduled` + +- **MTProto RPC:** `messages.deleteScheduledMessages` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.deleteScheduledMessages`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.deleteScheduledMessages`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.cancel_scheduled(*, peer=CURRENT_PEER, id) +``` + +**Порядок positional slots:** `peer, id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `id` | `Vector` | да | — | + + +#### 11. `ctx.configure_chat_reactions` + +- **MTProto RPC:** `messages.setChatAvailableReactions` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.setChatAvailableReactions`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.setChatAvailableReactions`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.configure_chat_reactions(*, peer=CURRENT_PEER, available_reactions, reactions_limit=None, paid_enabled=None) +``` + +**Порядок positional slots:** `peer, available_reactions`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `available_reactions` | `ChatReactions` | да | — | +| `reactions_limit` | `flags.0?int` | нет | поле пропускается | +| `paid_enabled` | `flags.1?Bool` | нет | поле пропускается | + + +#### 12. `ctx.available_reactions` + +- **MTProto RPC:** `messages.getAvailableReactions` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getAvailableReactions`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getAvailableReactions`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.available_reactions(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `int` | нет | `0` | + + +#### 13. `ctx.set_default_reaction` + +- **MTProto RPC:** `messages.setDefaultReaction` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.setDefaultReaction`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.setDefaultReaction`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_default_reaction(*, reaction) +``` + +**Порядок positional slots:** `reaction`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `reaction` | `Reaction` | да | — | + + +#### 14. `ctx.unread_reactions` + +- **MTProto RPC:** `messages.getUnreadReactions` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getUnreadReactions`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getUnreadReactions`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.unread_reactions(*, peer=CURRENT_PEER, top_msg_id=None, saved_peer_id=None, offset_id=0, add_offset=0, limit=50, max_id=0, min_id=0) +``` + +**Порядок positional slots:** `peer, offset_id, add_offset, limit, max_id, min_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `top_msg_id` | `flags.0?int` | нет | поле пропускается | +| `saved_peer_id` | `flags.1?InputPeer` | нет | поле пропускается | +| `offset_id` | `int` | нет | `0` | +| `add_offset` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | +| `max_id` | `int` | нет | `0` | +| `min_id` | `int` | нет | `0` | + + +#### 15. `ctx.mark_reactions_read` + +- **MTProto RPC:** `messages.readReactions` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.readReactions`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.readReactions`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.mark_reactions_read(*, peer=CURRENT_PEER, top_msg_id=None, saved_peer_id=None) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `top_msg_id` | `flags.0?int` | нет | поле пропускается | +| `saved_peer_id` | `flags.1?InputPeer` | нет | поле пропускается | + + +#### 16. `ctx.popular_reactions` + +- **MTProto RPC:** `messages.getTopReactions` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getTopReactions`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getTopReactions`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.popular_reactions(*, limit=50, hash=0) +``` + +**Порядок positional slots:** `limit, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `limit` | `int` | нет | `50` | +| `hash` | `long` | нет | `0` | + + +#### 17. `ctx.recent_reactions` + +- **MTProto RPC:** `messages.getRecentReactions` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getRecentReactions`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getRecentReactions`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.recent_reactions(*, limit=50, hash=0) +``` + +**Порядок positional slots:** `limit, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `limit` | `int` | нет | `50` | +| `hash` | `long` | нет | `0` | + + +#### 18. `ctx.clear_recent_reactions` + +- **MTProto RPC:** `messages.clearRecentReactions` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.clearRecentReactions`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.clearRecentReactions`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.clear_recent_reactions() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 19. `ctx.remove_member_reactions` + +- **MTProto RPC:** `messages.deleteParticipantReactions` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.deleteParticipantReactions`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.deleteParticipantReactions`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_member_reactions(*, peer=CURRENT_PEER, participant) +``` + +**Порядок positional slots:** `peer, participant`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `participant` | `InputPeer` | да | — | + + +#### 20. `ctx.remove_member_message_reaction` + +- **MTProto RPC:** `messages.deleteParticipantReaction` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.deleteParticipantReaction`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.deleteParticipantReaction`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_member_message_reaction(*, peer=CURRENT_PEER, msg_id=CURRENT_MESSAGE, participant) +``` + +**Порядок positional slots:** `peer, msg_id, participant`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `msg_id` | `int` | нет | `CURRENT_MESSAGE` | +| `participant` | `InputPeer` | да | — | + + +#### 21. `ctx.saved_dialogs` + +- **MTProto RPC:** `messages.getSavedDialogs` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getSavedDialogs`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getSavedDialogs`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.saved_dialogs(*, exclude_pinned=None, parent_peer=None, offset_date=0, offset_id=0, offset_peer={'_': 'inputPeerEmpty'}, limit=50, hash=0) +``` + +**Порядок positional slots:** `offset_date, offset_id, offset_peer, limit, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `exclude_pinned` | `flags.0?true` | нет | поле пропускается | +| `parent_peer` | `flags.1?InputPeer` | нет | поле пропускается | +| `offset_date` | `int` | нет | `0` | +| `offset_id` | `int` | нет | `0` | +| `offset_peer` | `InputPeer` | нет | `{'_': 'inputPeerEmpty'}` | +| `limit` | `int` | нет | `50` | +| `hash` | `long` | нет | `0` | + + +#### 22. `ctx.saved_history` + +- **MTProto RPC:** `messages.getSavedHistory` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getSavedHistory`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getSavedHistory`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.saved_history(*, parent_peer=None, peer, offset_id=0, offset_date=0, add_offset=0, limit=50, max_id=0, min_id=0, hash=0) +``` + +**Порядок positional slots:** `peer, offset_id, offset_date, add_offset, limit, max_id, min_id, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `parent_peer` | `flags.0?InputPeer` | нет | поле пропускается | +| `peer` | `InputPeer` | да | — | +| `offset_id` | `int` | нет | `0` | +| `offset_date` | `int` | нет | `0` | +| `add_offset` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | +| `max_id` | `int` | нет | `0` | +| `min_id` | `int` | нет | `0` | +| `hash` | `long` | нет | `0` | + + +#### 23. `ctx.clear_saved_history` + +- **MTProto RPC:** `messages.deleteSavedHistory` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.deleteSavedHistory`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.deleteSavedHistory`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.clear_saved_history(*, parent_peer=None, peer, max_id, min_date=None, max_date=None) +``` + +**Порядок positional slots:** `peer, max_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `parent_peer` | `flags.0?InputPeer` | нет | поле пропускается | +| `peer` | `InputPeer` | да | — | +| `max_id` | `int` | да | — | +| `min_date` | `flags.2?int` | нет | поле пропускается | +| `max_date` | `flags.3?int` | нет | поле пропускается | + + +#### 24. `ctx.pinned_saved_dialogs` + +- **MTProto RPC:** `messages.getPinnedSavedDialogs` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getPinnedSavedDialogs`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getPinnedSavedDialogs`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.pinned_saved_dialogs() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 25. `ctx.set_saved_dialog_pinned` + +- **MTProto RPC:** `messages.toggleSavedDialogPin` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.toggleSavedDialogPin`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.toggleSavedDialogPin`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_saved_dialog_pinned(*, pinned=None, peer) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `pinned` | `flags.0?true` | нет | поле пропускается | +| `peer` | `InputDialogPeer` | да | — | + + +#### 26. `ctx.reorder_saved_pins` + +- **MTProto RPC:** `messages.reorderPinnedSavedDialogs` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.reorderPinnedSavedDialogs`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.reorderPinnedSavedDialogs`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.reorder_saved_pins(*, force=None, order) +``` + +**Порядок positional slots:** `order`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `force` | `flags.0?true` | нет | поле пропускается | +| `order` | `Vector` | да | — | + + +#### 27. `ctx.saved_reaction_tags` + +- **MTProto RPC:** `messages.getSavedReactionTags` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getSavedReactionTags`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getSavedReactionTags`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.saved_reaction_tags(*, peer=None, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `flags.0?InputPeer` | нет | поле пропускается | +| `hash` | `long` | нет | `0` | + + +#### 28. `ctx.rename_saved_tag` + +- **MTProto RPC:** `messages.updateSavedReactionTag` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.updateSavedReactionTag`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.updateSavedReactionTag`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.rename_saved_tag(*, reaction, title=None) +``` + +**Порядок positional slots:** `reaction`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `reaction` | `Reaction` | да | — | +| `title` | `flags.0?string` | нет | поле пропускается | + + +#### 29. `ctx.suggested_saved_tags` + +- **MTProto RPC:** `messages.getDefaultTagReactions` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getDefaultTagReactions`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getDefaultTagReactions`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.suggested_saved_tags(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `long` | нет | `0` | + + +#### 30. `ctx.saved_dialogs_by_peers` + +- **MTProto RPC:** `messages.getSavedDialogsByID` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getSavedDialogsByID`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getSavedDialogsByID`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.saved_dialogs_by_peers(*, parent_peer=None, ids) +``` + +**Порядок positional slots:** `ids`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `parent_peer` | `flags.1?InputPeer` | нет | поле пропускается | +| `ids` | `Vector` | да | — | + + +#### 31. `ctx.mark_saved_history_read` + +- **MTProto RPC:** `messages.readSavedHistory` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.readSavedHistory`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.readSavedHistory`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.mark_saved_history_read(*, parent_peer, peer, max_id) +``` + +**Порядок positional slots:** `parent_peer, peer, max_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `parent_peer` | `InputPeer` | да | — | +| `peer` | `InputPeer` | да | — | +| `max_id` | `int` | да | — | + + +#### 32. `ctx.forum_topics` + +- **MTProto RPC:** `messages.getForumTopics` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getForumTopics`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getForumTopics`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.forum_topics(*, peer=CURRENT_PEER, q=None, offset_date=0, offset_id=0, offset_topic=0, limit=50) +``` + +**Порядок positional slots:** `peer, offset_date, offset_id, offset_topic, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `q` | `flags.0?string` | нет | поле пропускается | +| `offset_date` | `int` | нет | `0` | +| `offset_id` | `int` | нет | `0` | +| `offset_topic` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | + + +#### 33. `ctx.forum_topics_by_ids` + +- **MTProto RPC:** `messages.getForumTopicsByID` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getForumTopicsByID`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getForumTopicsByID`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.forum_topics_by_ids(*, peer=CURRENT_PEER, topics) +``` + +**Порядок positional slots:** `peer, topics`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `topics` | `Vector` | да | — | + + +#### 34. `ctx.edit_forum_topic` + +- **MTProto RPC:** `messages.editForumTopic` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.editForumTopic`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.editForumTopic`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.edit_forum_topic(*, peer=CURRENT_PEER, topic_id, title=None, icon_emoji_id=None, closed=None, hidden=None) +``` + +**Порядок positional slots:** `peer, topic_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `topic_id` | `int` | да | — | +| `title` | `flags.0?string` | нет | поле пропускается | +| `icon_emoji_id` | `flags.1?long` | нет | поле пропускается | +| `closed` | `flags.2?Bool` | нет | поле пропускается | +| `hidden` | `flags.3?Bool` | нет | поле пропускается | + + +#### 35. `ctx.set_forum_topic_pinned` + +- **MTProto RPC:** `messages.updatePinnedForumTopic` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.updatePinnedForumTopic`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.updatePinnedForumTopic`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_forum_topic_pinned(*, peer=CURRENT_PEER, topic_id, pinned) +``` + +**Порядок positional slots:** `peer, topic_id, pinned`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `topic_id` | `int` | да | — | +| `pinned` | `Bool` | да | — | + + +#### 36. `ctx.reorder_forum_pins` + +- **MTProto RPC:** `messages.reorderPinnedForumTopics` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.reorderPinnedForumTopics`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.reorderPinnedForumTopics`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.reorder_forum_pins(*, force=None, peer=CURRENT_PEER, order) +``` + +**Порядок positional slots:** `peer, order`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `force` | `flags.0?true` | нет | поле пропускается | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `order` | `Vector` | да | — | + + +#### 37. `ctx.create_forum_topic` + +- **MTProto RPC:** `messages.createForumTopic` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.createForumTopic`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.createForumTopic`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.create_forum_topic(*, title_missing=None, peer=CURRENT_PEER, title, icon_color=None, icon_emoji_id=None, random_id=RANDOM_ID, send_as=None) +``` + +**Порядок positional slots:** `peer, title, random_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `title_missing` | `flags.4?true` | нет | поле пропускается | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `title` | `string` | да | — | +| `icon_color` | `flags.0?int` | нет | поле пропускается | +| `icon_emoji_id` | `flags.3?long` | нет | поле пропускается | +| `random_id` | `long` | нет | `RANDOM_ID` | +| `send_as` | `flags.2?InputPeer` | нет | поле пропускается | + + +#### 38. `ctx.remove_forum_topic` + +- **MTProto RPC:** `messages.deleteTopicHistory` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.deleteTopicHistory`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.deleteTopicHistory`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_forum_topic(*, peer=CURRENT_PEER, top_msg_id) +``` + +**Порядок positional slots:** `peer, top_msg_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `top_msg_id` | `int` | да | — | + + +#### 39. `ctx.set_forum_enabled` + +- **MTProto RPC:** `channels.toggleForum` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.toggleForum`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.toggleForum`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_forum_enabled(*, channel=CURRENT_PEER, enabled, tabs) +``` + +**Порядок positional slots:** `channel, enabled, tabs`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `enabled` | `Bool` | да | — | +| `tabs` | `Bool` | да | — | + + +#### 40. `ctx.set_forum_message_view` + +- **MTProto RPC:** `channels.toggleViewForumAsMessages` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.toggleViewForumAsMessages`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.toggleViewForumAsMessages`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_forum_message_view(*, channel=CURRENT_PEER, enabled) +``` + +**Порядок positional slots:** `channel, enabled`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `enabled` | `Bool` | да | — | + + +#### 41. `ctx.story_posting_quota` + +- **MTProto RPC:** `stories.canSendStory` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.canSendStory`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.canSendStory`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.story_posting_quota(*, peer) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | + + +#### 42. `ctx.post_story` + +- **MTProto RPC:** `stories.sendStory` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.sendStory`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.sendStory`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.post_story(*, pinned=None, noforwards=None, fwd_modified=None, peer, media, media_areas=None, caption=None, entities=None, privacy_rules, random_id=RANDOM_ID, period=None, fwd_from_id=None, fwd_from_story=None, albums=None, music=None) +``` + +**Порядок positional slots:** `peer, media, privacy_rules, random_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `pinned` | `flags.2?true` | нет | поле пропускается | +| `noforwards` | `flags.4?true` | нет | поле пропускается | +| `fwd_modified` | `flags.7?true` | нет | поле пропускается | +| `peer` | `InputPeer` | да | — | +| `media` | `InputMedia` | да | — | +| `media_areas` | `flags.5?Vector` | нет | поле пропускается | +| `caption` | `flags.0?string` | нет | поле пропускается | +| `entities` | `flags.1?Vector` | нет | поле пропускается | +| `privacy_rules` | `Vector` | да | — | +| `random_id` | `long` | нет | `RANDOM_ID` | +| `period` | `flags.3?int` | нет | поле пропускается | +| `fwd_from_id` | `flags.6?InputPeer` | нет | поле пропускается | +| `fwd_from_story` | `flags.6?int` | нет | поле пропускается | +| `albums` | `flags.8?Vector` | нет | поле пропускается | +| `music` | `flags.9?InputDocument` | нет | поле пропускается | + + +#### 43. `ctx.edit_story` + +- **MTProto RPC:** `stories.editStory` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.editStory`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.editStory`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.edit_story(*, peer, id, media=None, media_areas=None, caption=None, entities=None, privacy_rules=None, music=None) +``` + +**Порядок positional slots:** `peer, id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `id` | `int` | да | — | +| `media` | `flags.0?InputMedia` | нет | поле пропускается | +| `media_areas` | `flags.3?Vector` | нет | поле пропускается | +| `caption` | `flags.1?string` | нет | поле пропускается | +| `entities` | `flags.1?Vector` | нет | поле пропускается | +| `privacy_rules` | `flags.2?Vector` | нет | поле пропускается | +| `music` | `flags.4?InputDocument` | нет | поле пропускается | + + +#### 44. `ctx.delete_stories` + +- **MTProto RPC:** `stories.deleteStories` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.deleteStories`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.deleteStories`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.delete_stories(*, peer, id) +``` + +**Порядок positional slots:** `peer, id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `id` | `Vector` | да | — | + + +#### 45. `ctx.set_stories_on_profile` + +- **MTProto RPC:** `stories.togglePinned` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.togglePinned`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.togglePinned`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_stories_on_profile(*, peer, id, pinned) +``` + +**Порядок positional slots:** `peer, id, pinned`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `id` | `Vector` | да | — | +| `pinned` | `Bool` | да | — | + + +#### 46. `ctx.story_feed` + +- **MTProto RPC:** `stories.getAllStories` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.getAllStories`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.getAllStories`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.story_feed(*, next=None, hidden=None, state=None) +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `next` | `flags.1?true` | нет | поле пропускается | +| `hidden` | `flags.2?true` | нет | поле пропускается | +| `state` | `flags.0?string` | нет | поле пропускается | + + +#### 47. `ctx.profile_stories` + +- **MTProto RPC:** `stories.getPinnedStories` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.getPinnedStories`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.getPinnedStories`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.profile_stories(*, peer, offset_id=0, limit=50) +``` + +**Порядок positional slots:** `peer, offset_id, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `offset_id` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | + + +#### 48. `ctx.archived_stories` + +- **MTProto RPC:** `stories.getStoriesArchive` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.getStoriesArchive`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.getStoriesArchive`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.archived_stories(*, peer, offset_id=0, limit=50) +``` + +**Порядок positional slots:** `peer, offset_id, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `offset_id` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | + + +#### 49. `ctx.stories_by_ids` + +- **MTProto RPC:** `stories.getStoriesByID` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.getStoriesByID`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.getStoriesByID`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.stories_by_ids(*, peer, id) +``` + +**Порядок positional slots:** `peer, id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `id` | `Vector` | да | — | + + +#### 50. `ctx.mark_stories_read` + +- **MTProto RPC:** `stories.readStories` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.readStories`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.readStories`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.mark_stories_read(*, peer, max_id=0) +``` + +**Порядок positional slots:** `peer, max_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `max_id` | `int` | нет | `0` | + + +#### 51. `ctx.story_viewers` + +- **MTProto RPC:** `stories.getStoryViewsList` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.getStoryViewsList`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.getStoryViewsList`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.story_viewers(*, just_contacts=None, reactions_first=None, forwards_first=None, peer, q=None, id, offset='', limit=50) +``` + +**Порядок positional slots:** `peer, id, offset, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `just_contacts` | `flags.0?true` | нет | поле пропускается | +| `reactions_first` | `flags.2?true` | нет | поле пропускается | +| `forwards_first` | `flags.3?true` | нет | поле пропускается | +| `peer` | `InputPeer` | да | — | +| `q` | `flags.1?string` | нет | поле пропускается | +| `id` | `int` | да | — | +| `offset` | `string` | нет | `''` | +| `limit` | `int` | нет | `50` | + + +#### 52. `ctx.story_view_counts` + +- **MTProto RPC:** `stories.getStoriesViews` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.getStoriesViews`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.getStoriesViews`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.story_view_counts(*, peer, id) +``` + +**Порядок positional slots:** `peer, id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `id` | `Vector` | да | — | + + +#### 53. `ctx.story_link` + +- **MTProto RPC:** `stories.exportStoryLink` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.exportStoryLink`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.exportStoryLink`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.story_link(*, peer, id) +``` + +**Порядок positional slots:** `peer, id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `id` | `int` | да | — | + + +#### 54. `ctx.activate_story_stealth` + +- **MTProto RPC:** `stories.activateStealthMode` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.activateStealthMode`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.activateStealthMode`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.activate_story_stealth(*, past=None, future=None) +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `past` | `flags.0?true` | нет | поле пропускается | +| `future` | `flags.1?true` | нет | поле пропускается | + + +#### 55. `ctx.react_to_story` + +- **MTProto RPC:** `stories.sendReaction` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.sendReaction`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.sendReaction`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.react_to_story(*, add_to_recent=None, peer, story_id, reaction) +``` + +**Порядок positional slots:** `peer, story_id, reaction`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `add_to_recent` | `flags.0?true` | нет | поле пропускается | +| `peer` | `InputPeer` | да | — | +| `story_id` | `int` | да | — | +| `reaction` | `Reaction` | да | — | + + +#### 56. `ctx.peer_stories` + +- **MTProto RPC:** `stories.getPeerStories` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.getPeerStories`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.getPeerStories`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.peer_stories(*, peer) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | + + +#### 57. `ctx.story_read_markers` + +- **MTProto RPC:** `stories.getAllReadPeerStories` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.getAllReadPeerStories`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.getAllReadPeerStories`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.story_read_markers() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 58. `ctx.peer_latest_story_ids` + +- **MTProto RPC:** `stories.getPeerMaxIDs` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.getPeerMaxIDs`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.getPeerMaxIDs`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.peer_latest_story_ids(*, id) +``` + +**Порядок positional slots:** `id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `Vector` | да | — | + + +#### 59. `ctx.story_posting_chats` + +- **MTProto RPC:** `stories.getChatsToSend` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.getChatsToSend`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.getChatsToSend`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.story_posting_chats() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 60. `ctx.set_peer_stories_hidden` + +- **MTProto RPC:** `stories.togglePeerStoriesHidden` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.togglePeerStoriesHidden`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.togglePeerStoriesHidden`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_peer_stories_hidden(*, peer, hidden) +``` + +**Порядок positional slots:** `peer, hidden`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `hidden` | `Bool` | да | — | + + +#### 61. `ctx.story_reaction_senders` + +- **MTProto RPC:** `stories.getStoryReactionsList` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.getStoryReactionsList`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.getStoryReactionsList`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.story_reaction_senders(*, forwards_first=None, peer, id, reaction=None, offset=None, limit=50) +``` + +**Порядок positional slots:** `peer, id, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `forwards_first` | `flags.2?true` | нет | поле пропускается | +| `peer` | `InputPeer` | да | — | +| `id` | `int` | да | — | +| `reaction` | `flags.0?Reaction` | нет | поле пропускается | +| `offset` | `flags.1?string` | нет | поле пропускается | +| `limit` | `int` | нет | `50` | + + +#### 62. `ctx.reorder_profile_story_pins` + +- **MTProto RPC:** `stories.togglePinnedToTop` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.togglePinnedToTop`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.togglePinnedToTop`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.reorder_profile_story_pins(*, peer, id) +``` + +**Порядок positional slots:** `peer, id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `id` | `Vector` | да | — | + + +#### 63. `ctx.search_stories` + +- **MTProto RPC:** `stories.searchPosts` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.searchPosts`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.searchPosts`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.search_stories(*, hashtag=None, area=None, peer=None, offset='', limit=50) +``` + +**Порядок positional slots:** `offset, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hashtag` | `flags.0?string` | нет | поле пропускается | +| `area` | `flags.1?MediaArea` | нет | поле пропускается | +| `peer` | `flags.2?InputPeer` | нет | поле пропускается | +| `offset` | `string` | нет | `''` | +| `limit` | `int` | нет | `50` | + + +#### 64. `ctx.create_story_album` + +- **MTProto RPC:** `stories.createAlbum` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.createAlbum`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.createAlbum`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.create_story_album(*, peer, title, stories) +``` + +**Порядок positional slots:** `peer, title, stories`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `title` | `string` | да | — | +| `stories` | `Vector` | да | — | + + +#### 65. `ctx.edit_story_album` + +- **MTProto RPC:** `stories.updateAlbum` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.updateAlbum`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.updateAlbum`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.edit_story_album(*, peer, album_id, title=None, delete_stories=None, add_stories=None, order=None) +``` + +**Порядок positional slots:** `peer, album_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `album_id` | `int` | да | — | +| `title` | `flags.0?string` | нет | поле пропускается | +| `delete_stories` | `flags.1?Vector` | нет | поле пропускается | +| `add_stories` | `flags.2?Vector` | нет | поле пропускается | +| `order` | `flags.3?Vector` | нет | поле пропускается | + + +#### 66. `ctx.reorder_story_albums` + +- **MTProto RPC:** `stories.reorderAlbums` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.reorderAlbums`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.reorderAlbums`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.reorder_story_albums(*, peer, order) +``` + +**Порядок positional slots:** `peer, order`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `order` | `Vector` | да | — | + + +#### 67. `ctx.remove_story_album` + +- **MTProto RPC:** `stories.deleteAlbum` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.deleteAlbum`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.deleteAlbum`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_story_album(*, peer, album_id) +``` + +**Порядок positional slots:** `peer, album_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `album_id` | `int` | да | — | + + +#### 68. `ctx.story_albums` + +- **MTProto RPC:** `stories.getAlbums` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.getAlbums`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.getAlbums`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.story_albums(*, peer, hash=0) +``` + +**Порядок positional slots:** `peer, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `hash` | `long` | нет | `0` | + + +#### 69. `ctx.story_album_items` + +- **MTProto RPC:** `stories.getAlbumStories` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.getAlbumStories`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.getAlbumStories`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.story_album_items(*, peer, album_id, offset=0, limit=50) +``` + +**Порядок positional slots:** `peer, album_id, offset, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `album_id` | `int` | да | — | +| `offset` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | + + +#### 70. `ctx.stickers_for_emoji` + +- **MTProto RPC:** `messages.getStickers` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.stickers_for_emoji(*, emoticon, hash=0) +``` + +**Порядок positional slots:** `emoticon, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `emoticon` | `string` | да | — | +| `hash` | `long` | нет | `0` | + + +#### 71. `ctx.installed_sticker_sets` + +- **MTProto RPC:** `messages.getAllStickers` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getAllStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getAllStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.installed_sticker_sets(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `long` | нет | `0` | + + +#### 72. `ctx.sticker_set` + +- **MTProto RPC:** `messages.getStickerSet` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getStickerSet`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getStickerSet`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.sticker_set(*, stickerset, hash=0) +``` + +**Порядок positional slots:** `stickerset, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `stickerset` | `InputStickerSet` | да | — | +| `hash` | `int` | нет | `0` | + + +#### 73. `ctx.install_sticker_set` + +- **MTProto RPC:** `messages.installStickerSet` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.installStickerSet`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.installStickerSet`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.install_sticker_set(*, stickerset, archived=False) +``` + +**Порядок positional slots:** `stickerset, archived`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `stickerset` | `InputStickerSet` | да | — | +| `archived` | `Bool` | нет | `False` | + + +#### 74. `ctx.uninstall_sticker_set` + +- **MTProto RPC:** `messages.uninstallStickerSet` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.uninstallStickerSet`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.uninstallStickerSet`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.uninstall_sticker_set(*, stickerset) +``` + +**Порядок positional slots:** `stickerset`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `stickerset` | `InputStickerSet` | да | — | + + +#### 75. `ctx.reorder_sticker_sets` + +- **MTProto RPC:** `messages.reorderStickerSets` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.reorderStickerSets`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.reorderStickerSets`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.reorder_sticker_sets(*, masks=None, emojis=None, order) +``` + +**Порядок positional slots:** `order`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `masks` | `flags.0?true` | нет | поле пропускается | +| `emojis` | `flags.1?true` | нет | поле пропускается | +| `order` | `Vector` | да | — | + + +#### 76. `ctx.saved_gifs` + +- **MTProto RPC:** `messages.getSavedGifs` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getSavedGifs`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getSavedGifs`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.saved_gifs(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `long` | нет | `0` | + + +#### 77. `ctx.set_gif_saved` + +- **MTProto RPC:** `messages.saveGif` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.saveGif`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.saveGif`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_gif_saved(*, id, unsave) +``` + +**Порядок positional slots:** `id, unsave`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `InputDocument` | да | — | +| `unsave` | `Bool` | да | — | + + +#### 78. `ctx.featured_sticker_sets` + +- **MTProto RPC:** `messages.getFeaturedStickers` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getFeaturedStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getFeaturedStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.featured_sticker_sets(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `long` | нет | `0` | + + +#### 79. `ctx.mark_featured_stickers_seen` + +- **MTProto RPC:** `messages.readFeaturedStickers` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.readFeaturedStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.readFeaturedStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.mark_featured_stickers_seen(*, id) +``` + +**Порядок positional slots:** `id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `Vector` | да | — | + + +#### 80. `ctx.recent_stickers` + +- **MTProto RPC:** `messages.getRecentStickers` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getRecentStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getRecentStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.recent_stickers(*, attached=None, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `attached` | `flags.0?true` | нет | поле пропускается | +| `hash` | `long` | нет | `0` | + + +#### 81. `ctx.set_sticker_recent` + +- **MTProto RPC:** `messages.saveRecentSticker` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.saveRecentSticker`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.saveRecentSticker`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_sticker_recent(*, attached=None, id, unsave) +``` + +**Порядок positional slots:** `id, unsave`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `attached` | `flags.0?true` | нет | поле пропускается | +| `id` | `InputDocument` | да | — | +| `unsave` | `Bool` | да | — | + + +#### 82. `ctx.clear_recent_stickers` + +- **MTProto RPC:** `messages.clearRecentStickers` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.clearRecentStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.clearRecentStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.clear_recent_stickers(*, attached=None) +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `attached` | `flags.0?true` | нет | поле пропускается | + + +#### 83. `ctx.archived_sticker_sets` + +- **MTProto RPC:** `messages.getArchivedStickers` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getArchivedStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getArchivedStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.archived_sticker_sets(*, masks=None, emojis=None, offset_id=0, limit=50) +``` + +**Порядок positional slots:** `offset_id, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `masks` | `flags.0?true` | нет | поле пропускается | +| `emojis` | `flags.1?true` | нет | поле пропускается | +| `offset_id` | `long` | нет | `0` | +| `limit` | `int` | нет | `50` | + + +#### 84. `ctx.installed_masks` + +- **MTProto RPC:** `messages.getMaskStickers` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getMaskStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getMaskStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.installed_masks(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `long` | нет | `0` | + + +#### 85. `ctx.media_sticker_sets` + +- **MTProto RPC:** `messages.getAttachedStickers` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getAttachedStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getAttachedStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.media_sticker_sets(*, media) +``` + +**Порядок positional slots:** `media`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `media` | `InputStickeredMedia` | да | — | + + +#### 86. `ctx.favorite_stickers` + +- **MTProto RPC:** `messages.getFavedStickers` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getFavedStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getFavedStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.favorite_stickers(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `long` | нет | `0` | + + +#### 87. `ctx.set_sticker_favorite` + +- **MTProto RPC:** `messages.faveSticker` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.faveSticker`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.faveSticker`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_sticker_favorite(*, id, unfave) +``` + +**Порядок positional slots:** `id, unfave`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `InputDocument` | да | — | +| `unfave` | `Bool` | да | — | + + +#### 88. `ctx.search_sticker_sets` + +- **MTProto RPC:** `messages.searchStickerSets` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.searchStickerSets`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.searchStickerSets`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.search_sticker_sets(*, exclude_featured=None, q, hash=0) +``` + +**Порядок positional slots:** `q, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `exclude_featured` | `flags.0?true` | нет | поле пропускается | +| `q` | `string` | да | — | +| `hash` | `long` | нет | `0` | + + +#### 89. `ctx.bulk_sticker_set_action` + +- **MTProto RPC:** `messages.toggleStickerSets` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.toggleStickerSets`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.toggleStickerSets`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.bulk_sticker_set_action(*, uninstall=None, archive=None, unarchive=None, stickersets) +``` + +**Порядок positional slots:** `stickersets`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `uninstall` | `flags.0?true` | нет | поле пропускается | +| `archive` | `flags.1?true` | нет | поле пропускается | +| `unarchive` | `flags.2?true` | нет | поле пропускается | +| `stickersets` | `Vector` | да | — | + + +#### 90. `ctx.older_featured_sticker_sets` + +- **MTProto RPC:** `messages.getOldFeaturedStickers` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getOldFeaturedStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getOldFeaturedStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.older_featured_sticker_sets(*, offset=0, limit=50, hash=0) +``` + +**Порядок positional slots:** `offset, limit, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `offset` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | +| `hash` | `long` | нет | `0` | + + +#### 91. `ctx.custom_emoji_documents` + +- **MTProto RPC:** `messages.getCustomEmojiDocuments` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getCustomEmojiDocuments`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getCustomEmojiDocuments`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.custom_emoji_documents(*, document_id) +``` + +**Порядок positional slots:** `document_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `document_id` | `Vector` | да | — | + + +#### 92. `ctx.installed_emoji_sets` + +- **MTProto RPC:** `messages.getEmojiStickers` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getEmojiStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getEmojiStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.installed_emoji_sets(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `long` | нет | `0` | + + +#### 93. `ctx.featured_emoji_sets` + +- **MTProto RPC:** `messages.getFeaturedEmojiStickers` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getFeaturedEmojiStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getFeaturedEmojiStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.featured_emoji_sets(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `long` | нет | `0` | + + +#### 94. `ctx.search_custom_emoji` + +- **MTProto RPC:** `messages.searchCustomEmoji` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.searchCustomEmoji`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.searchCustomEmoji`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.search_custom_emoji(*, emoticon, hash=0) +``` + +**Порядок positional slots:** `emoticon, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `emoticon` | `string` | да | — | +| `hash` | `long` | нет | `0` | + + +#### 95. `ctx.search_emoji_sets` + +- **MTProto RPC:** `messages.searchEmojiStickerSets` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.searchEmojiStickerSets`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.searchEmojiStickerSets`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.search_emoji_sets(*, exclude_featured=None, q, hash=0) +``` + +**Порядок positional slots:** `q, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `exclude_featured` | `flags.0?true` | нет | поле пропускается | +| `q` | `string` | да | — | +| `hash` | `long` | нет | `0` | + + +#### 96. `ctx.owned_sticker_sets` + +- **MTProto RPC:** `messages.getMyStickers` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getMyStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getMyStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.owned_sticker_sets(*, offset_id=0, limit=50) +``` + +**Порядок positional slots:** `offset_id, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `offset_id` | `long` | нет | `0` | +| `limit` | `int` | нет | `50` | + + +#### 97. `ctx.search_stickers` + +- **MTProto RPC:** `messages.searchStickers` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.searchStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.searchStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.search_stickers(*, emojis=None, q, emoticon, lang_code, offset=0, limit=50, hash=0) +``` + +**Порядок positional slots:** `q, emoticon, lang_code, offset, limit, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `emojis` | `flags.0?true` | нет | поле пропускается | +| `q` | `string` | да | — | +| `emoticon` | `string` | да | — | +| `lang_code` | `Vector` | да | — | +| `offset` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | +| `hash` | `long` | нет | `0` | + + +#### 98. `ctx.create_sticker_set` + +- **MTProto RPC:** `stickers.createStickerSet` +- **Namespace:** `stickers` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stickers.createStickerSet`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stickers.createStickerSet`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.create_sticker_set(*, masks=None, emojis=None, text_color=None, user_id, title, short_name, thumb=None, stickers, software=None) +``` + +**Порядок positional slots:** `user_id, title, short_name, stickers`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `masks` | `flags.0?true` | нет | поле пропускается | +| `emojis` | `flags.5?true` | нет | поле пропускается | +| `text_color` | `flags.6?true` | нет | поле пропускается | +| `user_id` | `InputUser` | да | — | +| `title` | `string` | да | — | +| `short_name` | `string` | да | — | +| `thumb` | `flags.2?InputDocument` | нет | поле пропускается | +| `stickers` | `Vector` | да | — | +| `software` | `flags.3?string` | нет | поле пропускается | + + +#### 99. `ctx.remove_sticker` + +- **MTProto RPC:** `stickers.removeStickerFromSet` +- **Namespace:** `stickers` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stickers.removeStickerFromSet`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stickers.removeStickerFromSet`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_sticker(*, sticker) +``` + +**Порядок positional slots:** `sticker`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `sticker` | `InputDocument` | да | — | + + +#### 100. `ctx.move_sticker` + +- **MTProto RPC:** `stickers.changeStickerPosition` +- **Namespace:** `stickers` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stickers.changeStickerPosition`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stickers.changeStickerPosition`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.move_sticker(*, sticker, position) +``` + +**Порядок positional slots:** `sticker, position`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `sticker` | `InputDocument` | да | — | +| `position` | `int` | да | — | + + +#### 101. `ctx.add_sticker` + +- **MTProto RPC:** `stickers.addStickerToSet` +- **Namespace:** `stickers` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stickers.addStickerToSet`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stickers.addStickerToSet`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.add_sticker(*, stickerset, sticker) +``` + +**Порядок positional slots:** `stickerset, sticker`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `stickerset` | `InputStickerSet` | да | — | +| `sticker` | `InputStickerSetItem` | да | — | + + +#### 102. `ctx.set_sticker_set_thumbnail` + +- **MTProto RPC:** `stickers.setStickerSetThumb` +- **Namespace:** `stickers` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stickers.setStickerSetThumb`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stickers.setStickerSetThumb`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_sticker_set_thumbnail(*, stickerset, thumb=None, thumb_document_id=None) +``` + +**Порядок positional slots:** `stickerset`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `stickerset` | `InputStickerSet` | да | — | +| `thumb` | `flags.0?InputDocument` | нет | поле пропускается | +| `thumb_document_id` | `flags.1?long` | нет | поле пропускается | + + +#### 103. `ctx.check_sticker_set_name` + +- **MTProto RPC:** `stickers.checkShortName` +- **Namespace:** `stickers` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stickers.checkShortName`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stickers.checkShortName`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.check_sticker_set_name(*, short_name) +``` + +**Порядок positional slots:** `short_name`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `short_name` | `string` | да | — | + + +#### 104. `ctx.suggest_sticker_set_name` + +- **MTProto RPC:** `stickers.suggestShortName` +- **Namespace:** `stickers` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stickers.suggestShortName`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stickers.suggestShortName`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.suggest_sticker_set_name(*, title) +``` + +**Порядок positional slots:** `title`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `title` | `string` | да | — | + + +#### 105. `ctx.edit_sticker_metadata` + +- **MTProto RPC:** `stickers.changeSticker` +- **Namespace:** `stickers` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stickers.changeSticker`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stickers.changeSticker`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.edit_sticker_metadata(*, sticker, emoji=None, mask_coords=None, keywords=None) +``` + +**Порядок positional slots:** `sticker`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `sticker` | `InputDocument` | да | — | +| `emoji` | `flags.0?string` | нет | поле пропускается | +| `mask_coords` | `flags.1?MaskCoords` | нет | поле пропускается | +| `keywords` | `flags.2?string` | нет | поле пропускается | + + +#### 106. `ctx.rename_sticker_set` + +- **MTProto RPC:** `stickers.renameStickerSet` +- **Namespace:** `stickers` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stickers.renameStickerSet`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stickers.renameStickerSet`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.rename_sticker_set(*, stickerset, title) +``` + +**Порядок positional slots:** `stickerset, title`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `stickerset` | `InputStickerSet` | да | — | +| `title` | `string` | да | — | + + +#### 107. `ctx.remove_sticker_set` + +- **MTProto RPC:** `stickers.deleteStickerSet` +- **Namespace:** `stickers` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stickers.deleteStickerSet`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stickers.deleteStickerSet`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_sticker_set(*, stickerset) +``` + +**Порядок positional slots:** `stickerset`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `stickerset` | `InputStickerSet` | да | — | + + +#### 108. `ctx.replace_sticker` + +- **MTProto RPC:** `stickers.replaceSticker` +- **Namespace:** `stickers` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stickers.replaceSticker`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stickers.replaceSticker`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.replace_sticker(*, sticker, new_sticker) +``` + +**Порядок positional slots:** `sticker, new_sticker`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `sticker` | `InputDocument` | да | — | +| `new_sticker` | `InputStickerSetItem` | да | — | + + +#### 109. `ctx.contact_ids` + +- **MTProto RPC:** `contacts.getContactIDs` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.getContactIDs`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.getContactIDs`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.contact_ids(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `long` | нет | `0` | + + +#### 110. `ctx.contact_statuses` + +- **MTProto RPC:** `contacts.getStatuses` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.getStatuses`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.getStatuses`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.contact_statuses() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 111. `ctx.contacts_list` + +- **MTProto RPC:** `contacts.getContacts` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.getContacts`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.getContacts`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.contacts_list(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `long` | нет | `0` | + + +#### 112. `ctx.import_contacts` + +- **MTProto RPC:** `contacts.importContacts` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.importContacts`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.importContacts`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.import_contacts(*, contacts) +``` + +**Порядок positional slots:** `contacts`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `contacts` | `Vector` | да | — | + + +#### 113. `ctx.remove_contacts` + +- **MTProto RPC:** `contacts.deleteContacts` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.deleteContacts`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.deleteContacts`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_contacts(*, id) +``` + +**Порядок positional slots:** `id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `Vector` | да | — | + + +#### 114. `ctx.remove_contacts_by_phone` + +- **MTProto RPC:** `contacts.deleteByPhones` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.deleteByPhones`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.deleteByPhones`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_contacts_by_phone(*, phones) +``` + +**Порядок positional slots:** `phones`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `phones` | `Vector` | да | — | + + +#### 115. `ctx.block_peer` + +- **MTProto RPC:** `contacts.block` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.block`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.block`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.block_peer(*, my_stories_from=None, id) +``` + +**Порядок positional slots:** `id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `my_stories_from` | `flags.0?true` | нет | поле пропускается | +| `id` | `InputPeer` | да | — | + + +#### 116. `ctx.unblock_peer` + +- **MTProto RPC:** `contacts.unblock` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.unblock`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.unblock`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.unblock_peer(*, my_stories_from=None, id) +``` + +**Порядок positional slots:** `id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `my_stories_from` | `flags.0?true` | нет | поле пропускается | +| `id` | `InputPeer` | да | — | + + +#### 117. `ctx.blocked_peers` + +- **MTProto RPC:** `contacts.getBlocked` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.getBlocked`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.getBlocked`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.blocked_peers(*, my_stories_from=None, offset=0, limit=50) +``` + +**Порядок positional slots:** `offset, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `my_stories_from` | `flags.0?true` | нет | поле пропускается | +| `offset` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | + + +#### 118. `ctx.search_public_peers` + +- **MTProto RPC:** `contacts.search` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.search`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.search`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.search_public_peers(*, broadcasts=None, bots=None, q, limit=50) +``` + +**Порядок positional slots:** `q, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `broadcasts` | `flags.0?true` | нет | поле пропускается | +| `bots` | `flags.1?true` | нет | поле пропускается | +| `q` | `string` | да | — | +| `limit` | `int` | нет | `50` | + + +#### 119. `ctx.frequent_peers` + +- **MTProto RPC:** `contacts.getTopPeers` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.getTopPeers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.getTopPeers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.frequent_peers(*, correspondents=None, bots_pm=None, bots_inline=None, phone_calls=None, forward_users=None, forward_chats=None, groups=None, channels=None, bots_app=None, bots_guestchat=None, offset=0, limit=50, hash=0) +``` + +**Порядок positional slots:** `offset, limit, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `correspondents` | `flags.0?true` | нет | поле пропускается | +| `bots_pm` | `flags.1?true` | нет | поле пропускается | +| `bots_inline` | `flags.2?true` | нет | поле пропускается | +| `phone_calls` | `flags.3?true` | нет | поле пропускается | +| `forward_users` | `flags.4?true` | нет | поле пропускается | +| `forward_chats` | `flags.5?true` | нет | поле пропускается | +| `groups` | `flags.10?true` | нет | поле пропускается | +| `channels` | `flags.15?true` | нет | поле пропускается | +| `bots_app` | `flags.16?true` | нет | поле пропускается | +| `bots_guestchat` | `flags.17?true` | нет | поле пропускается | +| `offset` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | +| `hash` | `long` | нет | `0` | + + +#### 120. `ctx.reset_peer_rating` + +- **MTProto RPC:** `contacts.resetTopPeerRating` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.resetTopPeerRating`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.resetTopPeerRating`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.reset_peer_rating(*, category, peer) +``` + +**Порядок positional slots:** `category, peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `category` | `TopPeerCategory` | да | — | +| `peer` | `InputPeer` | да | — | + + +#### 121. `ctx.clear_imported_contacts` + +- **MTProto RPC:** `contacts.resetSaved` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.resetSaved`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.resetSaved`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.clear_imported_contacts() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 122. `ctx.imported_contacts` + +- **MTProto RPC:** `contacts.getSaved` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.getSaved`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.getSaved`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.imported_contacts() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 123. `ctx.set_frequent_peers_enabled` + +- **MTProto RPC:** `contacts.toggleTopPeers` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.toggleTopPeers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.toggleTopPeers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_frequent_peers_enabled(*, enabled) +``` + +**Порядок positional slots:** `enabled`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `enabled` | `Bool` | да | — | + + +#### 124. `ctx.add_contact` + +- **MTProto RPC:** `contacts.addContact` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.addContact`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.addContact`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.add_contact(*, add_phone_privacy_exception=None, id, first_name, last_name, phone, note=None) +``` + +**Порядок positional slots:** `id, first_name, last_name, phone`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `add_phone_privacy_exception` | `flags.0?true` | нет | поле пропускается | +| `id` | `InputUser` | да | — | +| `first_name` | `string` | да | — | +| `last_name` | `string` | да | — | +| `phone` | `string` | да | — | +| `note` | `flags.1?TextWithEntities` | нет | поле пропускается | + + +#### 125. `ctx.accept_contact` + +- **MTProto RPC:** `contacts.acceptContact` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.acceptContact`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.acceptContact`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.accept_contact(*, id) +``` + +**Порядок positional slots:** `id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `InputUser` | да | — | + + +#### 126. `ctx.set_close_friends` + +- **MTProto RPC:** `contacts.editCloseFriends` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.editCloseFriends`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.editCloseFriends`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_close_friends(*, id) +``` + +**Порядок positional slots:** `id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `Vector` | да | — | + + +#### 127. `ctx.replace_blocklist` + +- **MTProto RPC:** `contacts.setBlocked` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.setBlocked`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.setBlocked`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.replace_blocklist(*, my_stories_from=None, id, limit=50) +``` + +**Порядок positional slots:** `id, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `my_stories_from` | `flags.0?true` | нет | поле пропускается | +| `id` | `Vector` | да | — | +| `limit` | `int` | нет | `50` | + + +#### 128. `ctx.contact_birthdays` + +- **MTProto RPC:** `contacts.getBirthdays` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.getBirthdays`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.getBirthdays`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.contact_birthdays() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 129. `ctx.edit_contact_note` + +- **MTProto RPC:** `contacts.updateContactNote` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.updateContactNote`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.updateContactNote`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.edit_contact_note(*, id, note) +``` + +**Порядок positional slots:** `id, note`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `InputUser` | да | — | +| `note` | `TextWithEntities` | да | — | + + +#### 130. `ctx.dialogs` + +- **MTProto RPC:** `messages.getDialogs` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getDialogs`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getDialogs`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.dialogs(*, exclude_pinned=None, folder_id=None, offset_date=0, offset_id=0, offset_peer={'_': 'inputPeerEmpty'}, limit=50, hash=0) +``` + +**Порядок positional slots:** `offset_date, offset_id, offset_peer, limit, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `exclude_pinned` | `flags.0?true` | нет | поле пропускается | +| `folder_id` | `flags.1?int` | нет | поле пропускается | +| `offset_date` | `int` | нет | `0` | +| `offset_id` | `int` | нет | `0` | +| `offset_peer` | `InputPeer` | нет | `{'_': 'inputPeerEmpty'}` | +| `limit` | `int` | нет | `50` | +| `hash` | `long` | нет | `0` | + + +#### 131. `ctx.chat_history` + +- **MTProto RPC:** `messages.getHistory` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getHistory`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getHistory`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.chat_history(*, peer=CURRENT_PEER, offset_id=0, offset_date=0, add_offset=0, limit=50, max_id=0, min_id=0, hash=0) +``` + +**Порядок positional slots:** `peer, offset_id, offset_date, add_offset, limit, max_id, min_id, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `offset_id` | `int` | нет | `0` | +| `offset_date` | `int` | нет | `0` | +| `add_offset` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | +| `max_id` | `int` | нет | `0` | +| `min_id` | `int` | нет | `0` | +| `hash` | `long` | нет | `0` | + + +#### 132. `ctx.search_chat_messages` + +- **MTProto RPC:** `messages.search` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.search`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.search`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.search_chat_messages(*, peer=CURRENT_PEER, q, from_id=None, saved_peer_id=None, saved_reaction=None, top_msg_id=None, filter={'_': 'inputMessagesFilterEmpty'}, min_date=0, max_date=0, offset_id=0, add_offset=0, limit=50, max_id=0, min_id=0, hash=0) +``` + +**Порядок positional slots:** `peer, q, filter, min_date, max_date, offset_id, add_offset, limit, max_id, min_id, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `q` | `string` | да | — | +| `from_id` | `flags.0?InputPeer` | нет | поле пропускается | +| `saved_peer_id` | `flags.2?InputPeer` | нет | поле пропускается | +| `saved_reaction` | `flags.3?Vector` | нет | поле пропускается | +| `top_msg_id` | `flags.1?int` | нет | поле пропускается | +| `filter` | `MessagesFilter` | нет | `{'_': 'inputMessagesFilterEmpty'}` | +| `min_date` | `int` | нет | `0` | +| `max_date` | `int` | нет | `0` | +| `offset_id` | `int` | нет | `0` | +| `add_offset` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | +| `max_id` | `int` | нет | `0` | +| `min_id` | `int` | нет | `0` | +| `hash` | `long` | нет | `0` | + + +#### 133. `ctx.mark_chat_read` + +- **MTProto RPC:** `messages.readHistory` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.readHistory`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.readHistory`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.mark_chat_read(*, peer=CURRENT_PEER, max_id) +``` + +**Порядок positional slots:** `peer, max_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `max_id` | `int` | да | — | + + +#### 134. `ctx.clear_chat_history` + +- **MTProto RPC:** `messages.deleteHistory` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.deleteHistory`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.deleteHistory`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.clear_chat_history(*, just_clear=None, revoke=None, peer=CURRENT_PEER, max_id, min_date=None, max_date=None) +``` + +**Порядок positional slots:** `peer, max_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `just_clear` | `flags.0?true` | нет | поле пропускается | +| `revoke` | `flags.1?true` | нет | поле пропускается | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `max_id` | `int` | да | — | +| `min_date` | `flags.2?int` | нет | поле пропускается | +| `max_date` | `flags.3?int` | нет | поле пропускается | + + +#### 135. `ctx.peer_settings` + +- **MTProto RPC:** `messages.getPeerSettings` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getPeerSettings`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getPeerSettings`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.peer_settings(*, peer=CURRENT_PEER) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | + + +#### 136. `ctx.basic_groups` + +- **MTProto RPC:** `messages.getChats` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getChats`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getChats`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.basic_groups(*, id) +``` + +**Порядок positional slots:** `id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `Vector` | да | — | + + +#### 137. `ctx.basic_group_details` + +- **MTProto RPC:** `messages.getFullChat` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getFullChat`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getFullChat`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.basic_group_details(*, chat_id) +``` + +**Порядок positional slots:** `chat_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chat_id` | `long` | да | — | + + +#### 138. `ctx.search_all_messages` + +- **MTProto RPC:** `messages.searchGlobal` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.searchGlobal`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.searchGlobal`, converts contextual parameters and returns the host-processed RPC response body. +- **Политика:** **BLOCKED** в проверенном CapabilityHost. Присутствует в каталоге, но не разрешён; raw `mt` запрет не снимает. + +**Справочная сигнатура (keywords):** + +```text +ctx.search_all_messages(*, broadcasts_only=None, groups_only=None, users_only=None, folder_id=None, community=None, q, filter={'_': 'inputMessagesFilterEmpty'}, min_date=0, max_date=0, offset_rate=0, offset_peer={'_': 'inputPeerEmpty'}, offset_id=0, limit=50) +``` + +**Порядок positional slots:** `q, filter, min_date, max_date, offset_rate, offset_peer, offset_id, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `broadcasts_only` | `flags.1?true` | нет | поле пропускается | +| `groups_only` | `flags.2?true` | нет | поле пропускается | +| `users_only` | `flags.3?true` | нет | поле пропускается | +| `folder_id` | `flags.0?int` | нет | поле пропускается | +| `community` | `flags.4?InputChannel` | нет | поле пропускается | +| `q` | `string` | да | — | +| `filter` | `MessagesFilter` | нет | `{'_': 'inputMessagesFilterEmpty'}` | +| `min_date` | `int` | нет | `0` | +| `max_date` | `int` | нет | `0` | +| `offset_rate` | `int` | нет | `0` | +| `offset_peer` | `InputPeer` | нет | `{'_': 'inputPeerEmpty'}` | +| `offset_id` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | + + +#### 139. `ctx.message_editability` + +- **MTProto RPC:** `messages.getMessageEditData` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getMessageEditData`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getMessageEditData`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.message_editability(*, peer=CURRENT_PEER, id=CURRENT_MESSAGE) +``` + +**Порядок positional slots:** `peer, id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `id` | `int` | нет | `CURRENT_MESSAGE` | + + +#### 140. `ctx.peer_dialogs` + +- **MTProto RPC:** `messages.getPeerDialogs` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getPeerDialogs`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getPeerDialogs`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.peer_dialogs(*, peers) +``` + +**Порядок positional slots:** `peers`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peers` | `Vector` | да | — | + + +#### 141. `ctx.all_drafts` + +- **MTProto RPC:** `messages.getAllDrafts` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getAllDrafts`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getAllDrafts`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.all_drafts() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 142. `ctx.mutual_groups` + +- **MTProto RPC:** `messages.getCommonChats` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getCommonChats`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getCommonChats`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.mutual_groups(*, user_id, max_id=0, limit=50) +``` + +**Порядок positional slots:** `user_id, max_id, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `user_id` | `InputUser` | да | — | +| `max_id` | `long` | нет | `0` | +| `limit` | `int` | нет | `50` | + + +#### 143. `ctx.set_dialog_pinned` + +- **MTProto RPC:** `messages.toggleDialogPin` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.toggleDialogPin`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.toggleDialogPin`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_dialog_pinned(*, pinned=None, peer) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `pinned` | `flags.0?true` | нет | поле пропускается | +| `peer` | `InputDialogPeer` | да | — | + + +#### 144. `ctx.reorder_dialog_pins` + +- **MTProto RPC:** `messages.reorderPinnedDialogs` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.reorderPinnedDialogs`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.reorderPinnedDialogs`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.reorder_dialog_pins(*, force=None, folder_id, order) +``` + +**Порядок positional slots:** `folder_id, order`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `force` | `flags.0?true` | нет | поле пропускается | +| `folder_id` | `int` | да | — | +| `order` | `Vector` | да | — | + + +#### 145. `ctx.pinned_dialogs` + +- **MTProto RPC:** `messages.getPinnedDialogs` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getPinnedDialogs`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getPinnedDialogs`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.pinned_dialogs(*, folder_id) +``` + +**Порядок positional slots:** `folder_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `folder_id` | `int` | да | — | + + +#### 146. `ctx.unread_mentions` + +- **MTProto RPC:** `messages.getUnreadMentions` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getUnreadMentions`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getUnreadMentions`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.unread_mentions(*, peer=CURRENT_PEER, top_msg_id=None, offset_id=0, add_offset=0, limit=50, max_id=0, min_id=0) +``` + +**Порядок positional slots:** `peer, offset_id, add_offset, limit, max_id, min_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `top_msg_id` | `flags.0?int` | нет | поле пропускается | +| `offset_id` | `int` | нет | `0` | +| `add_offset` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | +| `max_id` | `int` | нет | `0` | +| `min_id` | `int` | нет | `0` | + + +#### 147. `ctx.mark_mentions_read` + +- **MTProto RPC:** `messages.readMentions` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.readMentions`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.readMentions`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.mark_mentions_read(*, peer=CURRENT_PEER, top_msg_id=None) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `top_msg_id` | `flags.0?int` | нет | поле пропускается | + + +#### 148. `ctx.recent_live_locations` + +- **MTProto RPC:** `messages.getRecentLocations` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getRecentLocations`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getRecentLocations`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.recent_live_locations(*, peer=CURRENT_PEER, limit=50, hash=0) +``` + +**Порядок positional slots:** `peer, limit, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `limit` | `int` | нет | `50` | +| `hash` | `long` | нет | `0` | + + +#### 149. `ctx.set_dialog_unread` + +- **MTProto RPC:** `messages.markDialogUnread` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.markDialogUnread`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.markDialogUnread`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_dialog_unread(*, unread=None, parent_peer=None, peer) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `unread` | `flags.0?true` | нет | поле пропускается | +| `parent_peer` | `flags.1?InputPeer` | нет | поле пропускается | +| `peer` | `InputDialogPeer` | да | — | + + +#### 150. `ctx.unread_dialog_marks` + +- **MTProto RPC:** `messages.getDialogUnreadMarks` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getDialogUnreadMarks`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getDialogUnreadMarks`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.unread_dialog_marks(*, parent_peer=None) +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `parent_peer` | `flags.0?InputPeer` | нет | поле пропускается | + + +#### 151. `ctx.clear_all_drafts` + +- **MTProto RPC:** `messages.clearAllDrafts` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.clearAllDrafts`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.clearAllDrafts`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.clear_all_drafts() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 152. `ctx.chat_online_count` + +- **MTProto RPC:** `messages.getOnlines` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getOnlines`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getOnlines`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.chat_online_count(*, peer=CURRENT_PEER) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | + + +#### 153. `ctx.message_type_counts` + +- **MTProto RPC:** `messages.getSearchCounters` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getSearchCounters`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getSearchCounters`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.message_type_counts(*, peer=CURRENT_PEER, saved_peer_id=None, top_msg_id=None, filters) +``` + +**Порядок positional slots:** `peer, filters`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `saved_peer_id` | `flags.2?InputPeer` | нет | поле пропускается | +| `top_msg_id` | `flags.0?int` | нет | поле пропускается | +| `filters` | `Vector` | да | — | + + +#### 154. `ctx.dismiss_peer_settings_bar` + +- **MTProto RPC:** `messages.hidePeerSettingsBar` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.hidePeerSettingsBar`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.hidePeerSettingsBar`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.dismiss_peer_settings_bar(*, peer=CURRENT_PEER) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | + + +#### 155. `ctx.mark_discussion_read` + +- **MTProto RPC:** `messages.readDiscussion` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.readDiscussion`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.readDiscussion`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.mark_discussion_read(*, peer=CURRENT_PEER, msg_id=CURRENT_MESSAGE, read_max_id) +``` + +**Порядок positional slots:** `peer, msg_id, read_max_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `msg_id` | `int` | нет | `CURRENT_MESSAGE` | +| `read_max_id` | `int` | да | — | + + +#### 156. `ctx.unpin_all_chat_messages` + +- **MTProto RPC:** `messages.unpinAllMessages` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.unpinAllMessages`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.unpinAllMessages`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.unpin_all_chat_messages(*, peer=CURRENT_PEER, top_msg_id=None, saved_peer_id=None) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `top_msg_id` | `flags.0?int` | нет | поле пропускается | +| `saved_peer_id` | `flags.1?InputPeer` | нет | поле пропускается | + + +#### 157. `ctx.message_readers` + +- **MTProto RPC:** `messages.getMessageReadParticipants` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getMessageReadParticipants`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getMessageReadParticipants`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.message_readers(*, peer=CURRENT_PEER, msg_id=CURRENT_MESSAGE) +``` + +**Порядок positional slots:** `peer, msg_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `msg_id` | `int` | нет | `CURRENT_MESSAGE` | + + +#### 158. `ctx.message_search_calendar` + +- **MTProto RPC:** `messages.getSearchResultsCalendar` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getSearchResultsCalendar`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getSearchResultsCalendar`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.message_search_calendar(*, peer=CURRENT_PEER, saved_peer_id=None, filter={'_': 'inputMessagesFilterEmpty'}, offset_id=0, offset_date=0) +``` + +**Порядок positional slots:** `peer, filter, offset_id, offset_date`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `saved_peer_id` | `flags.2?InputPeer` | нет | поле пропускается | +| `filter` | `MessagesFilter` | нет | `{'_': 'inputMessagesFilterEmpty'}` | +| `offset_id` | `int` | нет | `0` | +| `offset_date` | `int` | нет | `0` | + + +#### 159. `ctx.message_search_positions` + +- **MTProto RPC:** `messages.getSearchResultsPositions` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getSearchResultsPositions`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getSearchResultsPositions`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.message_search_positions(*, peer=CURRENT_PEER, saved_peer_id=None, filter={'_': 'inputMessagesFilterEmpty'}, offset_id=0, limit=50) +``` + +**Порядок positional slots:** `peer, filter, offset_id, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `saved_peer_id` | `flags.2?InputPeer` | нет | поле пропускается | +| `filter` | `MessagesFilter` | нет | `{'_': 'inputMessagesFilterEmpty'}` | +| `offset_id` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | + + +#### 160. `ctx.set_default_send_as` + +- **MTProto RPC:** `messages.saveDefaultSendAs` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.saveDefaultSendAs`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.saveDefaultSendAs`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_default_send_as(*, peer=CURRENT_PEER, send_as) +``` + +**Порядок positional slots:** `peer, send_as`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `send_as` | `InputPeer` | да | — | + + +#### 161. `ctx.sent_media_search` + +- **MTProto RPC:** `messages.searchSentMedia` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.searchSentMedia`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.searchSentMedia`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.sent_media_search(*, q, filter={'_': 'inputMessagesFilterEmpty'}, limit=50) +``` + +**Порядок positional slots:** `q, filter, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `q` | `string` | да | — | +| `filter` | `MessagesFilter` | нет | `{'_': 'inputMessagesFilterEmpty'}` | +| `limit` | `int` | нет | `50` | + + +#### 162. `ctx.outgoing_read_date` + +- **MTProto RPC:** `messages.getOutboxReadDate` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getOutboxReadDate`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getOutboxReadDate`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.outgoing_read_date(*, peer=CURRENT_PEER, msg_id=CURRENT_MESSAGE) +``` + +**Порядок positional slots:** `peer, msg_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `msg_id` | `int` | нет | `CURRENT_MESSAGE` | + + +#### 163. `ctx.channel_message_author` + +- **MTProto RPC:** `channels.getMessageAuthor` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.getMessageAuthor`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.getMessageAuthor`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.channel_message_author(*, channel=CURRENT_PEER, id) +``` + +**Порядок positional slots:** `channel, id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `id` | `int` | да | — | + + +#### 164. `ctx.move_dialogs_to_archive` + +- **MTProto RPC:** `folders.editPeerFolders` +- **Namespace:** `folders` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `folders.editPeerFolders`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `folders.editPeerFolders`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.move_dialogs_to_archive(*, folder_peers) +``` + +**Порядок positional slots:** `folder_peers`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `folder_peers` | `Vector` | да | — | + + +#### 165. `ctx.chat_folders` + +- **MTProto RPC:** `messages.getDialogFilters` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getDialogFilters`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getDialogFilters`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.chat_folders() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 166. `ctx.suggested_chat_folders` + +- **MTProto RPC:** `messages.getSuggestedDialogFilters` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getSuggestedDialogFilters`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getSuggestedDialogFilters`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.suggested_chat_folders() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 167. `ctx.save_chat_folder` + +- **MTProto RPC:** `messages.updateDialogFilter` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.updateDialogFilter`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.updateDialogFilter`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.save_chat_folder(*, id, filter=None) +``` + +**Порядок positional slots:** `id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `int` | да | — | +| `filter` | `flags.0?DialogFilter` | нет | поле пропускается | + + +#### 168. `ctx.reorder_chat_folders` + +- **MTProto RPC:** `messages.updateDialogFiltersOrder` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.updateDialogFiltersOrder`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.updateDialogFiltersOrder`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.reorder_chat_folders(*, order) +``` + +**Порядок positional slots:** `order`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `order` | `Vector` | да | — | + + +#### 169. `ctx.set_folder_tags_visible` + +- **MTProto RPC:** `messages.toggleDialogFilterTags` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.toggleDialogFilterTags`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.toggleDialogFilterTags`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_folder_tags_visible(*, enabled) +``` + +**Порядок positional slots:** `enabled`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `enabled` | `Bool` | да | — | + + +#### 170. `ctx.share_chat_folder` + +- **MTProto RPC:** `chatlists.exportChatlistInvite` +- **Namespace:** `chatlists` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `chatlists.exportChatlistInvite`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `chatlists.exportChatlistInvite`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.share_chat_folder(*, chatlist, title, peers) +``` + +**Порядок positional slots:** `chatlist, title, peers`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chatlist` | `InputChatlist` | да | — | +| `title` | `string` | да | — | +| `peers` | `Vector` | да | — | + + +#### 171. `ctx.remove_folder_invite` + +- **MTProto RPC:** `chatlists.deleteExportedInvite` +- **Namespace:** `chatlists` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `chatlists.deleteExportedInvite`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `chatlists.deleteExportedInvite`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_folder_invite(*, chatlist, slug) +``` + +**Порядок positional slots:** `chatlist, slug`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chatlist` | `InputChatlist` | да | — | +| `slug` | `string` | да | — | + + +#### 172. `ctx.edit_folder_invite` + +- **MTProto RPC:** `chatlists.editExportedInvite` +- **Namespace:** `chatlists` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `chatlists.editExportedInvite`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `chatlists.editExportedInvite`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.edit_folder_invite(*, chatlist, slug, title=None, peers=None) +``` + +**Порядок positional slots:** `chatlist, slug`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chatlist` | `InputChatlist` | да | — | +| `slug` | `string` | да | — | +| `title` | `flags.1?string` | нет | поле пропускается | +| `peers` | `flags.2?Vector` | нет | поле пропускается | + + +#### 173. `ctx.folder_invites` + +- **MTProto RPC:** `chatlists.getExportedInvites` +- **Namespace:** `chatlists` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `chatlists.getExportedInvites`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `chatlists.getExportedInvites`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.folder_invites(*, chatlist) +``` + +**Порядок positional slots:** `chatlist`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chatlist` | `InputChatlist` | да | — | + + +#### 174. `ctx.inspect_folder_invite` + +- **MTProto RPC:** `chatlists.checkChatlistInvite` +- **Namespace:** `chatlists` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `chatlists.checkChatlistInvite`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `chatlists.checkChatlistInvite`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.inspect_folder_invite(*, slug) +``` + +**Порядок positional slots:** `slug`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `slug` | `string` | да | — | + + +#### 175. `ctx.join_folder_invite` + +- **MTProto RPC:** `chatlists.joinChatlistInvite` +- **Namespace:** `chatlists` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `chatlists.joinChatlistInvite`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `chatlists.joinChatlistInvite`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.join_folder_invite(*, slug, peers) +``` + +**Порядок positional slots:** `slug, peers`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `slug` | `string` | да | — | +| `peers` | `Vector` | да | — | + + +#### 176. `ctx.folder_updates` + +- **MTProto RPC:** `chatlists.getChatlistUpdates` +- **Namespace:** `chatlists` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `chatlists.getChatlistUpdates`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `chatlists.getChatlistUpdates`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.folder_updates(*, chatlist) +``` + +**Порядок positional slots:** `chatlist`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chatlist` | `InputChatlist` | да | — | + + +#### 177. `ctx.accept_folder_updates` + +- **MTProto RPC:** `chatlists.joinChatlistUpdates` +- **Namespace:** `chatlists` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `chatlists.joinChatlistUpdates`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `chatlists.joinChatlistUpdates`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.accept_folder_updates(*, chatlist, peers) +``` + +**Порядок positional slots:** `chatlist, peers`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chatlist` | `InputChatlist` | да | — | +| `peers` | `Vector` | да | — | + + +#### 178. `ctx.dismiss_folder_updates` + +- **MTProto RPC:** `chatlists.hideChatlistUpdates` +- **Namespace:** `chatlists` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `chatlists.hideChatlistUpdates`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `chatlists.hideChatlistUpdates`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.dismiss_folder_updates(*, chatlist) +``` + +**Порядок positional slots:** `chatlist`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chatlist` | `InputChatlist` | да | — | + + +#### 179. `ctx.folder_leave_suggestions` + +- **MTProto RPC:** `chatlists.getLeaveChatlistSuggestions` +- **Namespace:** `chatlists` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `chatlists.getLeaveChatlistSuggestions`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `chatlists.getLeaveChatlistSuggestions`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.folder_leave_suggestions(*, chatlist) +``` + +**Порядок positional slots:** `chatlist`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chatlist` | `InputChatlist` | да | — | + + +#### 180. `ctx.leave_shared_folder` + +- **MTProto RPC:** `chatlists.leaveChatlist` +- **Namespace:** `chatlists` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `chatlists.leaveChatlist`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `chatlists.leaveChatlist`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.leave_shared_folder(*, chatlist, peers) +``` + +**Порядок positional slots:** `chatlist, peers`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chatlist` | `InputChatlist` | да | — | +| `peers` | `Vector` | да | — | + + +#### 181. `ctx.edit_profile` + +- **MTProto RPC:** `account.updateProfile` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.updateProfile`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.updateProfile`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.edit_profile(*, first_name=None, last_name=None, about=None) +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `first_name` | `flags.0?string` | нет | поле пропускается | +| `last_name` | `flags.1?string` | нет | поле пропускается | +| `about` | `flags.2?string` | нет | поле пропускается | + + +#### 182. `ctx.set_online_status` + +- **MTProto RPC:** `account.updateStatus` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.updateStatus`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.updateStatus`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_online_status(*, offline) +``` + +**Порядок positional slots:** `offline`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `offline` | `Bool` | да | — | + + +#### 183. `ctx.check_profile_username` + +- **MTProto RPC:** `account.checkUsername` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.checkUsername`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.checkUsername`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.check_profile_username(*, username) +``` + +**Порядок positional slots:** `username`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `username` | `string` | да | — | + + +#### 184. `ctx.set_profile_username` + +- **MTProto RPC:** `account.updateUsername` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.updateUsername`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.updateUsername`, converts contextual parameters and returns the host-processed RPC response body. +- **Политика:** **BLOCKED** в проверенном CapabilityHost. Присутствует в каталоге, но не разрешён; raw `mt` запрет не снимает. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_profile_username(*, username) +``` + +**Порядок positional slots:** `username`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `username` | `string` | да | — | + + +#### 185. `ctx.privacy_rules` + +- **MTProto RPC:** `account.getPrivacy` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.getPrivacy`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.getPrivacy`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.privacy_rules(*, key) +``` + +**Порядок positional slots:** `key`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `key` | `InputPrivacyKey` | да | — | + + +#### 186. `ctx.account_inactivity_ttl` + +- **MTProto RPC:** `account.getAccountTTL` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.getAccountTTL`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.getAccountTTL`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.account_inactivity_ttl() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 187. `ctx.set_emoji_status` + +- **MTProto RPC:** `account.updateEmojiStatus` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.updateEmojiStatus`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.updateEmojiStatus`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_emoji_status(*, emoji_status) +``` + +**Порядок positional slots:** `emoji_status`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `emoji_status` | `EmojiStatus` | да | — | + + +#### 188. `ctx.suggested_emoji_statuses` + +- **MTProto RPC:** `account.getDefaultEmojiStatuses` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.getDefaultEmojiStatuses`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.getDefaultEmojiStatuses`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.suggested_emoji_statuses(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `long` | нет | `0` | + + +#### 189. `ctx.recent_emoji_statuses` + +- **MTProto RPC:** `account.getRecentEmojiStatuses` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.getRecentEmojiStatuses`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.getRecentEmojiStatuses`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.recent_emoji_statuses(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `long` | нет | `0` | + + +#### 190. `ctx.clear_recent_emoji_statuses` + +- **MTProto RPC:** `account.clearRecentEmojiStatuses` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.clearRecentEmojiStatuses`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.clearRecentEmojiStatuses`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.clear_recent_emoji_statuses() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 191. `ctx.reorder_profile_usernames` + +- **MTProto RPC:** `account.reorderUsernames` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.reorderUsernames`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.reorderUsernames`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.reorder_profile_usernames(*, order) +``` + +**Порядок positional slots:** `order`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `order` | `Vector` | да | — | + + +#### 192. `ctx.set_profile_username_active` + +- **MTProto RPC:** `account.toggleUsername` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.toggleUsername`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.toggleUsername`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_profile_username_active(*, username, active) +``` + +**Порядок positional slots:** `username, active`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `username` | `string` | да | — | +| `active` | `Bool` | да | — | + + +#### 193. `ctx.profile_photo_emojis` + +- **MTProto RPC:** `account.getDefaultProfilePhotoEmojis` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.getDefaultProfilePhotoEmojis`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.getDefaultProfilePhotoEmojis`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.profile_photo_emojis(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `long` | нет | `0` | + + +#### 194. `ctx.set_profile_color` + +- **MTProto RPC:** `account.updateColor` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.updateColor`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.updateColor`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_profile_color(*, for_profile=None, color=None) +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `for_profile` | `flags.1?true` | нет | поле пропускается | +| `color` | `flags.2?PeerColor` | нет | поле пропускается | + + +#### 195. `ctx.set_birthday` + +- **MTProto RPC:** `account.updateBirthday` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.updateBirthday`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.updateBirthday`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_birthday(*, birthday=None) +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `birthday` | `flags.0?Birthday` | нет | поле пропускается | + + +#### 196. `ctx.set_personal_channel` + +- **MTProto RPC:** `account.updatePersonalChannel` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.updatePersonalChannel`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.updatePersonalChannel`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_personal_channel(*, channel) +``` + +**Порядок positional slots:** `channel`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | да | — | + + +#### 197. `ctx.set_profile_tab` + +- **MTProto RPC:** `account.setMainProfileTab` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.setMainProfileTab`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.setMainProfileTab`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_profile_tab(*, tab) +``` + +**Порядок positional slots:** `tab`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `tab` | `ProfileTab` | да | — | + + +#### 198. `ctx.set_music_saved` + +- **MTProto RPC:** `account.saveMusic` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.saveMusic`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.saveMusic`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_music_saved(*, unsave=None, id, after_id=None) +``` + +**Порядок positional slots:** `id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `unsave` | `flags.0?true` | нет | поле пропускается | +| `id` | `InputDocument` | да | — | +| `after_id` | `flags.1?InputDocument` | нет | поле пропускается | + + +#### 199. `ctx.saved_music_ids` + +- **MTProto RPC:** `account.getSavedMusicIds` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.getSavedMusicIds`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.getSavedMusicIds`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.saved_music_ids(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `long` | нет | `0` | + + +#### 200. `ctx.user_details` + +- **MTProto RPC:** `users.getFullUser` +- **Namespace:** `users` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `users.getFullUser`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `users.getFullUser`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.user_details(*, id) +``` + +**Порядок positional slots:** `id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `InputUser` | да | — | + + +#### 201. `ctx.contact_requirements` + +- **MTProto RPC:** `users.getRequirementsToContact` +- **Namespace:** `users` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `users.getRequirementsToContact`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `users.getRequirementsToContact`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.contact_requirements(*, id) +``` + +**Порядок positional slots:** `id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `Vector` | да | — | + + +#### 202. `ctx.user_music` + +- **MTProto RPC:** `users.getSavedMusic` +- **Namespace:** `users` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `users.getSavedMusic`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `users.getSavedMusic`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.user_music(*, id, offset=0, limit=50, hash=0) +``` + +**Порядок positional slots:** `id, offset, limit, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `InputUser` | да | — | +| `offset` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | +| `hash` | `long` | нет | `0` | + + +#### 203. `ctx.user_music_by_documents` + +- **MTProto RPC:** `users.getSavedMusicByID` +- **Namespace:** `users` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `users.getSavedMusicByID`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `users.getSavedMusicByID`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.user_music_by_documents(*, id, documents) +``` + +**Порядок positional slots:** `id, documents`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `InputUser` | да | — | +| `documents` | `Vector` | да | — | + + +#### 204. `ctx.suggest_contact_birthday` + +- **MTProto RPC:** `users.suggestBirthday` +- **Namespace:** `users` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `users.suggestBirthday`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `users.suggestBirthday`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.suggest_contact_birthday(*, id, birthday) +``` + +**Порядок positional slots:** `id, birthday`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `InputUser` | да | — | +| `birthday` | `Birthday` | да | — | + + +#### 205. `ctx.select_profile_photo` + +- **MTProto RPC:** `photos.updateProfilePhoto` +- **Namespace:** `photos` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `photos.updateProfilePhoto`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `photos.updateProfilePhoto`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.select_profile_photo(*, fallback=None, bot=None, id) +``` + +**Порядок positional slots:** `id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `fallback` | `flags.0?true` | нет | поле пропускается | +| `bot` | `flags.1?InputUser` | нет | поле пропускается | +| `id` | `InputPhoto` | да | — | + + +#### 206. `ctx.upload_profile_photo` + +- **MTProto RPC:** `photos.uploadProfilePhoto` +- **Namespace:** `photos` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `photos.uploadProfilePhoto`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `photos.uploadProfilePhoto`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.upload_profile_photo(*, fallback=None, bot=None, file=None, video=None, video_start_ts=None, video_emoji_markup=None) +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `fallback` | `flags.3?true` | нет | поле пропускается | +| `bot` | `flags.5?InputUser` | нет | поле пропускается | +| `file` | `flags.0?InputFile` | нет | поле пропускается | +| `video` | `flags.1?InputFile` | нет | поле пропускается | +| `video_start_ts` | `flags.2?double` | нет | поле пропускается | +| `video_emoji_markup` | `flags.4?VideoSize` | нет | поле пропускается | + + +#### 207. `ctx.remove_profile_photos` + +- **MTProto RPC:** `photos.deletePhotos` +- **Namespace:** `photos` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `photos.deletePhotos`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `photos.deletePhotos`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_profile_photos(*, id) +``` + +**Порядок positional slots:** `id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `Vector` | да | — | + + +#### 208. `ctx.profile_photos` + +- **MTProto RPC:** `photos.getUserPhotos` +- **Namespace:** `photos` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `photos.getUserPhotos`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `photos.getUserPhotos`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.profile_photos(*, user_id, offset=0, max_id=0, limit=50) +``` + +**Порядок positional slots:** `user_id, offset, max_id, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `user_id` | `InputUser` | да | — | +| `offset` | `int` | нет | `0` | +| `max_id` | `long` | нет | `0` | +| `limit` | `int` | нет | `50` | + + +#### 209. `ctx.set_contact_photo` + +- **MTProto RPC:** `photos.uploadContactProfilePhoto` +- **Namespace:** `photos` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `photos.uploadContactProfilePhoto`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `photos.uploadContactProfilePhoto`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_contact_photo(*, suggest=None, save=None, user_id, file=None, video=None, video_start_ts=None, video_emoji_markup=None) +``` + +**Порядок positional slots:** `user_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `suggest` | `flags.3?true` | нет | поле пропускается | +| `save` | `flags.4?true` | нет | поле пропускается | +| `user_id` | `InputUser` | да | — | +| `file` | `flags.0?InputFile` | нет | поле пропускается | +| `video` | `flags.1?InputFile` | нет | поле пропускается | +| `video_start_ts` | `flags.2?double` | нет | поле пропускается | +| `video_emoji_markup` | `flags.5?VideoSize` | нет | поле пропускается | + + +#### 210. `ctx.notification_settings` + +- **MTProto RPC:** `account.getNotifySettings` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.getNotifySettings`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.getNotifySettings`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.notification_settings(*, peer) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputNotifyPeer` | да | — | + + +#### 211. `ctx.set_notification_settings` + +- **MTProto RPC:** `account.updateNotifySettings` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.updateNotifySettings`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.updateNotifySettings`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_notification_settings(*, peer, settings) +``` + +**Порядок positional slots:** `peer, settings`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputNotifyPeer` | да | — | +| `settings` | `InputPeerNotifySettings` | да | — | + + +#### 212. `ctx.reset_notification_settings` + +- **MTProto RPC:** `account.resetNotifySettings` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.resetNotifySettings`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.resetNotifySettings`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.reset_notification_settings() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 213. `ctx.contact_signup_notifications` + +- **MTProto RPC:** `account.getContactSignUpNotification` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.getContactSignUpNotification`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.getContactSignUpNotification`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.contact_signup_notifications() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 214. `ctx.set_contact_signup_notifications` + +- **MTProto RPC:** `account.setContactSignUpNotification` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.setContactSignUpNotification`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.setContactSignUpNotification`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_contact_signup_notifications(*, silent) +``` + +**Порядок positional slots:** `silent`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `silent` | `Bool` | да | — | + + +#### 215. `ctx.notification_exceptions` + +- **MTProto RPC:** `account.getNotifyExceptions` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.getNotifyExceptions`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.getNotifyExceptions`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.notification_exceptions(*, compare_sound=None, compare_stories=None, peer=None) +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `compare_sound` | `flags.1?true` | нет | поле пропускается | +| `compare_stories` | `flags.2?true` | нет | поле пропускается | +| `peer` | `flags.0?InputNotifyPeer` | нет | поле пропускается | + + +#### 216. `ctx.reaction_notification_settings` + +- **MTProto RPC:** `account.getReactionsNotifySettings` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.getReactionsNotifySettings`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.getReactionsNotifySettings`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.reaction_notification_settings() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 217. `ctx.set_reaction_notification_settings` + +- **MTProto RPC:** `account.setReactionsNotifySettings` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.setReactionsNotifySettings`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.setReactionsNotifySettings`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_reaction_notification_settings(*, settings) +``` + +**Порядок positional slots:** `settings`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `settings` | `ReactionsNotifySettings` | да | — | + + +#### 218. `ctx.saved_notification_sounds` + +- **MTProto RPC:** `account.getSavedRingtones` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.getSavedRingtones`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.getSavedRingtones`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.saved_notification_sounds(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `long` | нет | `0` | + + +#### 219. `ctx.set_notification_sound_saved` + +- **MTProto RPC:** `account.saveRingtone` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.saveRingtone`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.saveRingtone`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_notification_sound_saved(*, id, unsave) +``` + +**Порядок positional slots:** `id, unsave`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `InputDocument` | да | — | +| `unsave` | `Bool` | да | — | + + +#### 220. `ctx.upload_notification_sound` + +- **MTProto RPC:** `account.uploadRingtone` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.uploadRingtone`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.uploadRingtone`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.upload_notification_sound(*, file, file_name, mime_type) +``` + +**Порядок positional slots:** `file, file_name, mime_type`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `file` | `InputFile` | да | — | +| `file_name` | `string` | да | — | +| `mime_type` | `string` | да | — | + + +#### 221. `ctx.rename_basic_group` + +- **MTProto RPC:** `messages.editChatTitle` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.editChatTitle`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.editChatTitle`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.rename_basic_group(*, chat_id, title) +``` + +**Порядок positional slots:** `chat_id, title`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chat_id` | `long` | да | — | +| `title` | `string` | да | — | + + +#### 222. `ctx.set_basic_group_photo` + +- **MTProto RPC:** `messages.editChatPhoto` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.editChatPhoto`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.editChatPhoto`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_basic_group_photo(*, chat_id, photo) +``` + +**Порядок positional slots:** `chat_id, photo`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chat_id` | `long` | да | — | +| `photo` | `InputChatPhoto` | да | — | + + +#### 223. `ctx.add_basic_group_member` + +- **MTProto RPC:** `messages.addChatUser` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.addChatUser`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.addChatUser`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.add_basic_group_member(*, chat_id, user_id, fwd_limit=0) +``` + +**Порядок positional slots:** `chat_id, user_id, fwd_limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chat_id` | `long` | да | — | +| `user_id` | `InputUser` | да | — | +| `fwd_limit` | `int` | нет | `0` | + + +#### 224. `ctx.remove_basic_group_member` + +- **MTProto RPC:** `messages.deleteChatUser` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.deleteChatUser`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.deleteChatUser`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_basic_group_member(*, revoke_history=None, chat_id, user_id) +``` + +**Порядок positional slots:** `chat_id, user_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `revoke_history` | `flags.0?true` | нет | поле пропускается | +| `chat_id` | `long` | да | — | +| `user_id` | `InputUser` | да | — | + + +#### 225. `ctx.create_basic_group` + +- **MTProto RPC:** `messages.createChat` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.createChat`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.createChat`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.create_basic_group(*, users, title, ttl_period=None) +``` + +**Порядок positional slots:** `users, title`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `users` | `Vector` | да | — | +| `title` | `string` | да | — | +| `ttl_period` | `flags.0?int` | нет | поле пропускается | + + +#### 226. `ctx.set_basic_group_admin` + +- **MTProto RPC:** `messages.editChatAdmin` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.editChatAdmin`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.editChatAdmin`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_basic_group_admin(*, chat_id, user_id, is_admin) +``` + +**Порядок positional slots:** `chat_id, user_id, is_admin`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chat_id` | `long` | да | — | +| `user_id` | `InputUser` | да | — | +| `is_admin` | `Bool` | да | — | + + +#### 227. `ctx.upgrade_basic_group` + +- **MTProto RPC:** `messages.migrateChat` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.migrateChat`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.migrateChat`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.upgrade_basic_group(*, chat_id) +``` + +**Порядок positional slots:** `chat_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chat_id` | `long` | да | — | + + +#### 228. `ctx.edit_chat_description` + +- **MTProto RPC:** `messages.editChatAbout` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.editChatAbout`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.editChatAbout`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.edit_chat_description(*, peer=CURRENT_PEER, about) +``` + +**Порядок positional slots:** `peer, about`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `about` | `string` | да | — | + + +#### 229. `ctx.set_default_member_restrictions` + +- **MTProto RPC:** `messages.editChatDefaultBannedRights` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.editChatDefaultBannedRights`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.editChatDefaultBannedRights`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_default_member_restrictions(*, peer=CURRENT_PEER, banned_rights) +``` + +**Порядок positional slots:** `peer, banned_rights`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `banned_rights` | `ChatBannedRights` | да | — | + + +#### 230. `ctx.remove_basic_group` + +- **MTProto RPC:** `messages.deleteChat` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.deleteChat`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.deleteChat`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_basic_group(*, chat_id) +``` + +**Порядок positional slots:** `chat_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chat_id` | `long` | да | — | + + +#### 231. `ctx.set_chat_auto_delete` + +- **MTProto RPC:** `messages.setHistoryTTL` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.setHistoryTTL`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.setHistoryTTL`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_chat_auto_delete(*, peer=CURRENT_PEER, period) +``` + +**Порядок positional slots:** `peer, period`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `period` | `int` | да | — | + + +#### 232. `ctx.set_content_protection` + +- **MTProto RPC:** `messages.toggleNoForwards` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.toggleNoForwards`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.toggleNoForwards`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_content_protection(*, peer=CURRENT_PEER, enabled, request_msg_id=None) +``` + +**Порядок positional slots:** `peer, enabled`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `enabled` | `Bool` | да | — | +| `request_msg_id` | `flags.0?int` | нет | поле пропускается | + + +#### 233. `ctx.mark_channel_read` + +- **MTProto RPC:** `channels.readHistory` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.readHistory`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.readHistory`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.mark_channel_read(*, channel=CURRENT_PEER, max_id) +``` + +**Порядок positional slots:** `channel, max_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `max_id` | `int` | да | — | + + +#### 234. `ctx.channel_members` + +- **MTProto RPC:** `channels.getParticipants` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.getParticipants`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.getParticipants`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.channel_members(*, channel=CURRENT_PEER, filter={'_': 'channelParticipantsRecent'}, offset=0, limit=50, hash) +``` + +**Порядок positional slots:** `channel, filter, offset, limit, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `filter` | `ChannelParticipantsFilter` | нет | `{'_': 'channelParticipantsRecent'}` | +| `offset` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | +| `hash` | `long` | да | — | + + +#### 235. `ctx.channel_member` + +- **MTProto RPC:** `channels.getParticipant` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.getParticipant`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.getParticipant`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.channel_member(*, channel=CURRENT_PEER, participant) +``` + +**Порядок positional slots:** `channel, participant`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `participant` | `InputPeer` | да | — | + + +#### 236. `ctx.channel_details` + +- **MTProto RPC:** `channels.getFullChannel` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.getFullChannel`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.getFullChannel`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.channel_details(*, channel=CURRENT_PEER) +``` + +**Порядок positional slots:** `channel`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | + + +#### 237. `ctx.create_channel` + +- **MTProto RPC:** `channels.createChannel` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.createChannel`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.createChannel`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.create_channel(*, broadcast=None, megagroup=None, for_import=None, forum=None, title, about, geo_point=None, address=None, ttl_period=None) +``` + +**Порядок positional slots:** `title, about`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `broadcast` | `flags.0?true` | нет | поле пропускается | +| `megagroup` | `flags.1?true` | нет | поле пропускается | +| `for_import` | `flags.3?true` | нет | поле пропускается | +| `forum` | `flags.5?true` | нет | поле пропускается | +| `title` | `string` | да | — | +| `about` | `string` | да | — | +| `geo_point` | `flags.2?InputGeoPoint` | нет | поле пропускается | +| `address` | `flags.2?string` | нет | поле пропускается | +| `ttl_period` | `flags.4?int` | нет | поле пропускается | + + +#### 238. `ctx.set_channel_admin` + +- **MTProto RPC:** `channels.editAdmin` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.editAdmin`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.editAdmin`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_channel_admin(*, channel=CURRENT_PEER, user_id, admin_rights, rank=None) +``` + +**Порядок positional slots:** `channel, user_id, admin_rights`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `user_id` | `InputUser` | да | — | +| `admin_rights` | `ChatAdminRights` | да | — | +| `rank` | `flags.0?string` | нет | поле пропускается | + + +#### 239. `ctx.rename_channel` + +- **MTProto RPC:** `channels.editTitle` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.editTitle`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.editTitle`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.rename_channel(*, channel=CURRENT_PEER, title) +``` + +**Порядок positional slots:** `channel, title`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `title` | `string` | да | — | + + +#### 240. `ctx.set_channel_photo` + +- **MTProto RPC:** `channels.editPhoto` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.editPhoto`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.editPhoto`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_channel_photo(*, channel=CURRENT_PEER, photo) +``` + +**Порядок positional slots:** `channel, photo`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `photo` | `InputChatPhoto` | да | — | + + +#### 241. `ctx.check_channel_username` + +- **MTProto RPC:** `channels.checkUsername` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.checkUsername`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.checkUsername`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.check_channel_username(*, channel=CURRENT_PEER, username) +``` + +**Порядок positional slots:** `channel, username`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `username` | `string` | да | — | + + +#### 242. `ctx.set_channel_username` + +- **MTProto RPC:** `channels.updateUsername` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.updateUsername`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.updateUsername`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_channel_username(*, channel=CURRENT_PEER, username) +``` + +**Порядок positional slots:** `channel, username`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `username` | `string` | да | — | + + +#### 243. `ctx.join_channel` + +- **MTProto RPC:** `channels.joinChannel` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.joinChannel`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.joinChannel`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.join_channel(*, channel=CURRENT_PEER) +``` + +**Порядок positional slots:** `channel`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | + + +#### 244. `ctx.leave_channel` + +- **MTProto RPC:** `channels.leaveChannel` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.leaveChannel`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.leaveChannel`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.leave_channel(*, channel=CURRENT_PEER) +``` + +**Порядок positional slots:** `channel`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | + + +#### 245. `ctx.invite_channel_members` + +- **MTProto RPC:** `channels.inviteToChannel` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.inviteToChannel`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.inviteToChannel`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.invite_channel_members(*, channel=CURRENT_PEER, users) +``` + +**Порядок positional slots:** `channel, users`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `users` | `Vector` | да | — | + + +#### 246. `ctx.remove_channel` + +- **MTProto RPC:** `channels.deleteChannel` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.deleteChannel`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.deleteChannel`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_channel(*, channel=CURRENT_PEER) +``` + +**Порядок positional slots:** `channel`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | + + +#### 247. `ctx.set_channel_signatures` + +- **MTProto RPC:** `channels.toggleSignatures` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.toggleSignatures`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.toggleSignatures`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_channel_signatures(*, signatures_enabled=None, profiles_enabled=None, channel=CURRENT_PEER) +``` + +**Порядок positional slots:** `channel`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `signatures_enabled` | `flags.0?true` | нет | поле пропускается | +| `profiles_enabled` | `flags.1?true` | нет | поле пропускается | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | + + +#### 248. `ctx.owned_public_channels` + +- **MTProto RPC:** `channels.getAdminedPublicChannels` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.getAdminedPublicChannels`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.getAdminedPublicChannels`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.owned_public_channels(*, by_location=None, check_limit=None, for_personal=None, for_community_peer=None) +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `by_location` | `flags.0?true` | нет | поле пропускается | +| `check_limit` | `flags.1?true` | нет | поле пропускается | +| `for_personal` | `flags.2?true` | нет | поле пропускается | +| `for_community_peer` | `flags.3?true` | нет | поле пропускается | + + +#### 249. `ctx.restrict_channel_member` + +- **MTProto RPC:** `channels.editBanned` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.editBanned`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.editBanned`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.restrict_channel_member(*, channel=CURRENT_PEER, participant, banned_rights) +``` + +**Порядок positional slots:** `channel, participant, banned_rights`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `participant` | `InputPeer` | да | — | +| `banned_rights` | `ChatBannedRights` | да | — | + + +#### 250. `ctx.channel_admin_log` + +- **MTProto RPC:** `channels.getAdminLog` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.getAdminLog`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.getAdminLog`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.channel_admin_log(*, channel=CURRENT_PEER, q='', events_filter=None, admins=None, max_id, min_id, limit=50) +``` + +**Порядок positional slots:** `channel, q, max_id, min_id, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `q` | `string` | нет | `''` | +| `events_filter` | `flags.0?ChannelAdminLogEventsFilter` | нет | поле пропускается | +| `admins` | `flags.1?Vector` | нет | поле пропускается | +| `max_id` | `long` | да | — | +| `min_id` | `long` | да | — | +| `limit` | `int` | нет | `50` | + + +#### 251. `ctx.set_group_sticker_set` + +- **MTProto RPC:** `channels.setStickers` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.setStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.setStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_group_sticker_set(*, channel=CURRENT_PEER, stickerset) +``` + +**Порядок positional slots:** `channel, stickerset`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `stickerset` | `InputStickerSet` | да | — | + + +#### 252. `ctx.mark_channel_media_read` + +- **MTProto RPC:** `channels.readMessageContents` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.readMessageContents`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.readMessageContents`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.mark_channel_media_read(*, channel=CURRENT_PEER, id) +``` + +**Порядок positional slots:** `channel, id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `id` | `Vector` | да | — | + + +#### 253. `ctx.clear_channel_history` + +- **MTProto RPC:** `channels.deleteHistory` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.deleteHistory`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.deleteHistory`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.clear_channel_history(*, for_everyone=None, channel=CURRENT_PEER, max_id) +``` + +**Порядок positional slots:** `channel, max_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `for_everyone` | `flags.0?true` | нет | поле пропускается | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `max_id` | `int` | да | — | + + +#### 254. `ctx.set_prehistory_hidden` + +- **MTProto RPC:** `channels.togglePreHistoryHidden` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.togglePreHistoryHidden`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.togglePreHistoryHidden`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_prehistory_hidden(*, channel=CURRENT_PEER, enabled) +``` + +**Порядок positional slots:** `channel, enabled`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `enabled` | `Bool` | да | — | + + +#### 255. `ctx.left_channels` + +- **MTProto RPC:** `channels.getLeftChannels` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.getLeftChannels`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.getLeftChannels`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.left_channels(*, offset=0) +``` + +**Порядок positional slots:** `offset`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `offset` | `int` | нет | `0` | + + +#### 256. `ctx.eligible_discussion_groups` + +- **MTProto RPC:** `channels.getGroupsForDiscussion` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.getGroupsForDiscussion`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.getGroupsForDiscussion`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.eligible_discussion_groups() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 257. `ctx.set_discussion_group` + +- **MTProto RPC:** `channels.setDiscussionGroup` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.setDiscussionGroup`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.setDiscussionGroup`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_discussion_group(*, broadcast, group) +``` + +**Порядок positional slots:** `broadcast, group`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `broadcast` | `InputChannel` | да | — | +| `group` | `InputChannel` | да | — | + + +#### 258. `ctx.set_group_location` + +- **MTProto RPC:** `channels.editLocation` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.editLocation`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.editLocation`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_group_location(*, channel=CURRENT_PEER, geo_point, address) +``` + +**Порядок positional slots:** `channel, geo_point, address`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `geo_point` | `InputGeoPoint` | да | — | +| `address` | `string` | да | — | + + +#### 259. `ctx.set_slow_mode` + +- **MTProto RPC:** `channels.toggleSlowMode` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.toggleSlowMode`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.toggleSlowMode`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_slow_mode(*, channel=CURRENT_PEER, seconds) +``` + +**Порядок positional slots:** `channel, seconds`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `seconds` | `int` | да | — | + + +#### 260. `ctx.inactive_channels` + +- **MTProto RPC:** `channels.getInactiveChannels` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.getInactiveChannels`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.getInactiveChannels`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.inactive_channels() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 261. `ctx.send_as_identities` + +- **MTProto RPC:** `channels.getSendAs` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.getSendAs`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.getSendAs`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.send_as_identities(*, for_paid_reactions=None, for_live_stories=None, peer=CURRENT_PEER) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `for_paid_reactions` | `flags.0?true` | нет | поле пропускается | +| `for_live_stories` | `flags.1?true` | нет | поле пропускается | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | + + +#### 262. `ctx.remove_member_history` + +- **MTProto RPC:** `channels.deleteParticipantHistory` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.deleteParticipantHistory`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.deleteParticipantHistory`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_member_history(*, channel=CURRENT_PEER, participant) +``` + +**Порядок positional slots:** `channel, participant`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `participant` | `InputPeer` | да | — | + + +#### 263. `ctx.set_join_to_send` + +- **MTProto RPC:** `channels.toggleJoinToSend` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.toggleJoinToSend`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.toggleJoinToSend`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_join_to_send(*, channel=CURRENT_PEER, enabled) +``` + +**Порядок positional slots:** `channel, enabled`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `enabled` | `Bool` | да | — | + + +#### 264. `ctx.set_join_requests` + +- **MTProto RPC:** `channels.toggleJoinRequest` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.toggleJoinRequest`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.toggleJoinRequest`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_join_requests(*, apply_to_invites=None, channel=CURRENT_PEER, enabled, guard_bot=None) +``` + +**Порядок positional slots:** `channel, enabled`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `apply_to_invites` | `flags.1?true` | нет | поле пропускается | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `enabled` | `Bool` | да | — | +| `guard_bot` | `flags.0?InputUser` | нет | поле пропускается | + + +#### 265. `ctx.reorder_channel_usernames` + +- **MTProto RPC:** `channels.reorderUsernames` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.reorderUsernames`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.reorderUsernames`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.reorder_channel_usernames(*, channel=CURRENT_PEER, order) +``` + +**Порядок positional slots:** `channel, order`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `order` | `Vector` | да | — | + + +#### 266. `ctx.set_channel_username_active` + +- **MTProto RPC:** `channels.toggleUsername` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.toggleUsername`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.toggleUsername`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_channel_username_active(*, channel=CURRENT_PEER, username, active) +``` + +**Порядок positional slots:** `channel, username, active`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `username` | `string` | да | — | +| `active` | `Bool` | да | — | + + +#### 267. `ctx.deactivate_channel_usernames` + +- **MTProto RPC:** `channels.deactivateAllUsernames` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.deactivateAllUsernames`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.deactivateAllUsernames`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.deactivate_channel_usernames(*, channel=CURRENT_PEER) +``` + +**Порядок positional slots:** `channel`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | + + +#### 268. `ctx.set_antispam` + +- **MTProto RPC:** `channels.toggleAntiSpam` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.toggleAntiSpam`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.toggleAntiSpam`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_antispam(*, channel=CURRENT_PEER, enabled) +``` + +**Порядок positional slots:** `channel, enabled`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `enabled` | `Bool` | да | — | + + +#### 269. `ctx.set_members_hidden` + +- **MTProto RPC:** `channels.toggleParticipantsHidden` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.toggleParticipantsHidden`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.toggleParticipantsHidden`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_members_hidden(*, channel=CURRENT_PEER, enabled) +``` + +**Порядок positional slots:** `channel, enabled`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `enabled` | `Bool` | да | — | + + +#### 270. `ctx.set_channel_color` + +- **MTProto RPC:** `channels.updateColor` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.updateColor`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.updateColor`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_channel_color(*, for_profile=None, channel=CURRENT_PEER, color=None, background_emoji_id=None) +``` + +**Порядок positional slots:** `channel`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `for_profile` | `flags.1?true` | нет | поле пропускается | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `color` | `flags.2?int` | нет | поле пропускается | +| `background_emoji_id` | `flags.0?long` | нет | поле пропускается | + + +#### 271. `ctx.related_channels` + +- **MTProto RPC:** `channels.getChannelRecommendations` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.getChannelRecommendations`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.getChannelRecommendations`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.related_channels(*, channel=None) +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `flags.0?InputChannel` | нет | поле пропускается | + + +#### 272. `ctx.set_channel_emoji_status` + +- **MTProto RPC:** `channels.updateEmojiStatus` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.updateEmojiStatus`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.updateEmojiStatus`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_channel_emoji_status(*, channel=CURRENT_PEER, emoji_status) +``` + +**Порядок positional slots:** `channel, emoji_status`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `emoji_status` | `EmojiStatus` | да | — | + + +#### 273. `ctx.set_group_emoji_set` + +- **MTProto RPC:** `channels.setEmojiStickers` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.setEmojiStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.setEmojiStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_group_emoji_set(*, channel=CURRENT_PEER, stickerset) +``` + +**Порядок positional slots:** `channel, stickerset`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `stickerset` | `InputStickerSet` | да | — | + + +#### 274. `ctx.set_channel_auto_translation` + +- **MTProto RPC:** `channels.toggleAutotranslation` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.toggleAutotranslation`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.toggleAutotranslation`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_channel_auto_translation(*, channel=CURRENT_PEER, enabled) +``` + +**Порядок positional slots:** `channel, enabled`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `enabled` | `Bool` | да | — | + + +#### 275. `ctx.set_channel_profile_tab` + +- **MTProto RPC:** `channels.setMainProfileTab` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.setMainProfileTab`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.setMainProfileTab`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_channel_profile_tab(*, channel=CURRENT_PEER, tab) +``` + +**Порядок positional slots:** `channel, tab`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `tab` | `ProfileTab` | да | — | + + +#### 276. `ctx.edit_member_rank` + +- **MTProto RPC:** `messages.editChatParticipantRank` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.editChatParticipantRank`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.editChatParticipantRank`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.edit_member_rank(*, peer=CURRENT_PEER, participant, rank) +``` + +**Порядок positional slots:** `peer, participant, rank`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `participant` | `InputPeer` | да | — | +| `rank` | `string` | да | — | + + +#### 277. `ctx.create_chat_invite` + +- **MTProto RPC:** `messages.exportChatInvite` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.exportChatInvite`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.exportChatInvite`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.create_chat_invite(*, legacy_revoke_permanent=None, request_needed=None, peer=CURRENT_PEER, expire_date=None, usage_limit=None, title=None) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `legacy_revoke_permanent` | `flags.2?true` | нет | поле пропускается | +| `request_needed` | `flags.3?true` | нет | поле пропускается | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `expire_date` | `flags.0?int` | нет | поле пропускается | +| `usage_limit` | `flags.1?int` | нет | поле пропускается | +| `title` | `flags.4?string` | нет | поле пропускается | +| `subscription_pricing` | `flags.5?StarsSubscriptionPricing` | нельзя передавать | запрещён helper-политикой | + + +#### 278. `ctx.chat_invites` + +- **MTProto RPC:** `messages.getExportedChatInvites` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getExportedChatInvites`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getExportedChatInvites`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.chat_invites(*, revoked=None, peer=CURRENT_PEER, admin_id, offset_date=None, offset_link=None, limit=50) +``` + +**Порядок positional slots:** `peer, admin_id, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `revoked` | `flags.3?true` | нет | поле пропускается | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `admin_id` | `InputUser` | да | — | +| `offset_date` | `flags.2?int` | нет | поле пропускается | +| `offset_link` | `flags.2?string` | нет | поле пропускается | +| `limit` | `int` | нет | `50` | + + +#### 279. `ctx.chat_invite_details` + +- **MTProto RPC:** `messages.getExportedChatInvite` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getExportedChatInvite`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getExportedChatInvite`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.chat_invite_details(*, peer=CURRENT_PEER, link) +``` + +**Порядок positional slots:** `peer, link`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `link` | `string` | да | — | + + +#### 280. `ctx.edit_chat_invite` + +- **MTProto RPC:** `messages.editExportedChatInvite` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.editExportedChatInvite`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.editExportedChatInvite`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.edit_chat_invite(*, revoked=None, peer=CURRENT_PEER, link, expire_date=None, usage_limit=None, request_needed=None, title=None) +``` + +**Порядок positional slots:** `peer, link`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `revoked` | `flags.2?true` | нет | поле пропускается | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `link` | `string` | да | — | +| `expire_date` | `flags.0?int` | нет | поле пропускается | +| `usage_limit` | `flags.1?int` | нет | поле пропускается | +| `request_needed` | `flags.3?Bool` | нет | поле пропускается | +| `title` | `flags.4?string` | нет | поле пропускается | + + +#### 281. `ctx.purge_revoked_chat_invites` + +- **MTProto RPC:** `messages.deleteRevokedExportedChatInvites` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.deleteRevokedExportedChatInvites`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.deleteRevokedExportedChatInvites`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.purge_revoked_chat_invites(*, peer=CURRENT_PEER, admin_id) +``` + +**Порядок positional slots:** `peer, admin_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `admin_id` | `InputUser` | да | — | + + +#### 282. `ctx.remove_chat_invite` + +- **MTProto RPC:** `messages.deleteExportedChatInvite` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.deleteExportedChatInvite`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.deleteExportedChatInvite`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_chat_invite(*, peer=CURRENT_PEER, link) +``` + +**Порядок positional slots:** `peer, link`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `link` | `string` | да | — | + + +#### 283. `ctx.invite_admins` + +- **MTProto RPC:** `messages.getAdminsWithInvites` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getAdminsWithInvites`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getAdminsWithInvites`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.invite_admins(*, peer=CURRENT_PEER) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | + + +#### 284. `ctx.invite_joiners` + +- **MTProto RPC:** `messages.getChatInviteImporters` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getChatInviteImporters`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getChatInviteImporters`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.invite_joiners(*, requested=None, subscription_expired=None, peer=CURRENT_PEER, link=None, q=None, offset_date=0, offset_user={'_': 'inputUserEmpty'}, limit=50) +``` + +**Порядок positional slots:** `peer, offset_date, offset_user, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `requested` | `flags.0?true` | нет | поле пропускается | +| `subscription_expired` | `flags.3?true` | нет | поле пропускается | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `link` | `flags.1?string` | нет | поле пропускается | +| `q` | `flags.2?string` | нет | поле пропускается | +| `offset_date` | `int` | нет | `0` | +| `offset_user` | `InputUser` | нет | `{'_': 'inputUserEmpty'}` | +| `limit` | `int` | нет | `50` | + + +#### 285. `ctx.resolve_join_request` + +- **MTProto RPC:** `messages.hideChatJoinRequest` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.hideChatJoinRequest`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.hideChatJoinRequest`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.resolve_join_request(*, approved=None, peer=CURRENT_PEER, user_id) +``` + +**Порядок positional slots:** `peer, user_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `approved` | `flags.0?true` | нет | поле пропускается | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `user_id` | `InputUser` | да | — | + + +#### 286. `ctx.resolve_all_join_requests` + +- **MTProto RPC:** `messages.hideAllChatJoinRequests` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.hideAllChatJoinRequests`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.hideAllChatJoinRequests`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.resolve_all_join_requests(*, approved=None, peer=CURRENT_PEER, link=None) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `approved` | `flags.0?true` | нет | поле пропускается | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `link` | `flags.1?string` | нет | поле пропускается | + + +#### 287. `ctx.channel_statistics` + +- **MTProto RPC:** `stats.getBroadcastStats` +- **Namespace:** `stats` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stats.getBroadcastStats`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stats.getBroadcastStats`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.channel_statistics(*, dark=None, channel=CURRENT_PEER) +``` + +**Порядок positional slots:** `channel`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `dark` | `flags.0?true` | нет | поле пропускается | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | + + +#### 288. `ctx.supergroup_statistics` + +- **MTProto RPC:** `stats.getMegagroupStats` +- **Namespace:** `stats` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stats.getMegagroupStats`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stats.getMegagroupStats`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.supergroup_statistics(*, dark=None, channel=CURRENT_PEER) +``` + +**Порядок positional slots:** `channel`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `dark` | `flags.0?true` | нет | поле пропускается | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | + + +#### 289. `ctx.message_statistics` + +- **MTProto RPC:** `stats.getMessageStats` +- **Namespace:** `stats` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stats.getMessageStats`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stats.getMessageStats`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.message_statistics(*, dark=None, channel=CURRENT_PEER, msg_id) +``` + +**Порядок positional slots:** `channel, msg_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `dark` | `flags.0?true` | нет | поле пропускается | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `msg_id` | `int` | да | — | + + +#### 290. `ctx.message_public_forwards` + +- **MTProto RPC:** `stats.getMessagePublicForwards` +- **Namespace:** `stats` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stats.getMessagePublicForwards`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stats.getMessagePublicForwards`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.message_public_forwards(*, channel=CURRENT_PEER, msg_id, offset='', limit=50) +``` + +**Порядок positional slots:** `channel, msg_id, offset, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `msg_id` | `int` | да | — | +| `offset` | `string` | нет | `''` | +| `limit` | `int` | нет | `50` | + + +#### 291. `ctx.story_statistics` + +- **MTProto RPC:** `stats.getStoryStats` +- **Namespace:** `stats` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stats.getStoryStats`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stats.getStoryStats`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.story_statistics(*, dark=None, peer=CURRENT_PEER, id=CURRENT_MESSAGE) +``` + +**Порядок positional slots:** `peer, id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `dark` | `flags.0?true` | нет | поле пропускается | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `id` | `int` | нет | `CURRENT_MESSAGE` | + + +#### 292. `ctx.story_public_forwards` + +- **MTProto RPC:** `stats.getStoryPublicForwards` +- **Namespace:** `stats` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stats.getStoryPublicForwards`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stats.getStoryPublicForwards`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.story_public_forwards(*, peer=CURRENT_PEER, id=CURRENT_MESSAGE, offset='', limit=50) +``` + +**Порядок positional slots:** `peer, id, offset, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `id` | `int` | нет | `CURRENT_MESSAGE` | +| `offset` | `string` | нет | `''` | +| `limit` | `int` | нет | `50` | + + +## Приложение D. Самостоятельный проверочный скрипт + +Код ниже полностью включён в этот SKILL.md. **Для работы скилла сохранять скрипт +не требуется.** Только для сверки API по конкретным исходникам можно скопировать +этот блок во временный `inspect_api.py` и запустить: + +```text +python inspect_api.py --section catalog +python inspect_api.py --section tools +python inspect_api.py --section helpers +python inspect_api.py --section catalog --format markdown --output catalog.md +``` + +Это не установка и не запуск Hotaru: скрипт читает AST четырёх исходных файлов, +вычисляет SHA-256 и печатает JSON либо Markdown. Без `--output` файлы не записывает. +Он не импортирует ядро, не ставит пакеты, не подключается к Telegram и не выполняет +код проверяемых модулей. Запускай Python без `-O`, если используешь проверки assert +из других примеров документа. Сгенерированные карточки — документация, а не доказательство +успешного live RPC. Не сохраняй secrets в аргументах или выходном файле. + +```python +from __future__ import annotations + +"""Render source-derived Hotaru inventory as Markdown method cards.""" + + +from typing import Any + + +def cell(value: str) -> str: + return value.replace("|", "|").replace("\n", " ") + + +def default_repr(value: Any) -> str: + placeholders = {"$peer": "CURRENT_PEER", "$message": "CURRENT_MESSAGE", "$random": "RANDOM_ID"} + return placeholders.get(value, repr(value)) if isinstance(value, str) else repr(value) + + +def call_signature(record: dict[str, Any]) -> str: + parameters = [] + for name in record["field_types"]: + if name in record["forbidden"]: + continue + if name in record["defaults"]: + parameters.append(name + "=" + default_repr(record["defaults"][name])) + elif name not in record["positional_order"]: + parameters.append(name + "=None") + else: + parameters.append(name) + return ( + "ctx." + record["name"] + "(" + ("*, " if parameters else "") + ", ".join(parameters) + ")" + ) + + +def render_catalog(inventory: dict[str, Any]) -> str: + records = inventory["catalog"] + lines = [ + "# Hotaru: полные карточки контекстных методов", + "", + f"{len(records)} карточки, сформированные из AST исходников Hotaru; без импорта ядра и Telegram RPC.", + "Базовый снимок скилла: `8cab560e2b9dbc009aab4670c8a78a9a790e2d1a`, 2026-11-09.", + "При регенерации по другой версии актуальность определяют SHA-256 ниже, а не эта отметка.", + "", + "## Как читать карточки", + "", + "- Это справочные сигнатуры в стиле Python, не исполняемые вызовы: `*` означает", + " рекомендуемые keyword-аргументы; реальные positional slots указаны отдельно.", + "- Все операции асинхронные: в handler используй `await ctx.(...)`.", + "- `CURRENT_PEER`, `CURRENT_MESSAGE`, `RANDOM_ID` обозначают defaults ядра,", + " а не имена, которые нужно объявлять в модуле. Обычно соответствующий keyword пропускают.", + "- TL `flags.N?T` — optional поле; `Vector` — последовательность; типы сохраняют", + " запись исходной TL-схемы и не являются готовыми Python-аннотациями.", + "- «Обязательный» означает: вызывающий обязан передать значение, поскольку ядро", + " не подставляет default. Наличие обязательного TL-поля не исключает default ядра.", + "- Optional `None` в справочной сигнатуре означает пропуск поля, не обязательную", + " отправку None в Telegram. Keyword со статусом «запрещён» передавать нельзя.", + "- **Результат: `Any`, зависит от RPC.** CTX_CATALOG не хранит тип результата,", + " а host распаковывает/фильтрует response. Непроверенные returns сайта не копируются.", + " Для конкретного результата сверяй TL result schema используемого GoyGram и host adapter.", + "- «Без raw mt» не отменяет ACL Telegram, denylist, Premium, media/assets, net,", + " state и другие ограничения всей операции. Подробности: [контракт текущего SKILL.md](#context-contract).", + "", + "## Контроль источников", + "", + "| Файл | SHA-256 содержимого |", + "| --- | --- |", + ] + for path, digest in inventory["source_sha256"].items(): + lines.append(f"| `{path}` | `{digest}` |") + lines += ["", "## Навигация по namespace", ""] + namespaces = dict.fromkeys(record["rpc"].split(".", 1)[0] for record in records) + for namespace in namespaces: + subset = [record for record in records if record["rpc"].startswith(namespace + ".")] + links = ", ".join(f"[{record['name']}](#ctx-{record['name']})" for record in subset) + lines.append(f"- **{namespace} ({len(subset)}):** {links}") + lines += ["", "## Карточки методов", ""] + for number, record in enumerate(records, 1): + name = record["name"] + rpc = record["rpc"] + namespace = rpc.split(".", 1)[0] + lines += [ + f'', + f"### {number}. `ctx.{name}`", + "", + f"- **MTProto RPC:** `{rpc}`", + f"- **Namespace:** `{namespace}`", + "- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом.", + "- **Описание (RU):** Вызывает `" + rpc + "`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа.", + "- **Description (EN):** Calls `" + rpc + "`, converts contextual parameters and returns the host-processed RPC response body.", + ] + if record["policy_blocked"]: + lines.append("- **Политика:** **BLOCKED** в проверенном CapabilityHost. Присутствует в каталоге, но не разрешён; raw `mt` запрет не снимает.") + else: + lines.append("- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше.") + positional = ", ".join(record["positional_order"]) + lines += [ + "", + "**Справочная сигнатура (keywords):**", + "", + "```text", + call_signature(record), + "```", + "", + "**Порядок positional slots:** " + (f"`{positional}`." if positional else "нет, только keyword-поля при наличии."), + "", + "| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус |", + "| --- | --- | --- | --- |", + ] + for parameter, kind in record["field_types"].items(): + if parameter in record["forbidden"]: + required, default = "нельзя передавать", "запрещён helper-политикой" + elif parameter in record["defaults"]: + required, default = "нет", "`" + default_repr(record["defaults"][parameter]) + "`" + elif parameter in record["positional_order"]: + required, default = "да", "—" + else: + required, default = "нет", "поле пропускается" + lines.append(f"| `{parameter}` | `{cell(kind)}` | {required} | {cell(default)} |") + if not record["field_types"]: + lines.append("| — | — | — | Аргументов нет |") + lines.append("") + return "\n".join(lines).rstrip() + +"""Read-only inventory of Hotaru API from source AST; never imports Hotaru.""" + + +import argparse +import ast +import copy +import hashlib +import json +import sys +from pathlib import Path + + +def source_tree(root: Path, relative: str) -> tuple[str, ast.Module]: + source = (root / relative).read_text(encoding="utf-8") + return source, ast.parse(source, filename=relative) + + +def assignment(tree: ast.Module, name: str) -> ast.expr: + for node in tree.body: + if isinstance(node, ast.AnnAssign) and isinstance(node.target, ast.Name): + if node.target.id == name and node.value is not None: + return node.value + if isinstance(node, ast.Assign): + if any(isinstance(target, ast.Name) and target.id == name for target in node.targets): + return node.value + raise ValueError(f"No top-level assignment for {name}") + + +def signature(node: ast.FunctionDef | ast.AsyncFunctionDef, drop_self: bool = False) -> str: + args = copy.deepcopy(node.args) + if drop_self: + positional = args.posonlyargs if args.posonlyargs else args.args + if not positional or positional[0].arg != "self": + raise ValueError("Expected self as the first method argument") + positional.pop(0) + result = f"{node.name}({ast.unparse(args)})" + if node.returns is not None: + result += " -> " + ast.unparse(node.returns) + return result + + +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("root", type=Path) + parser.add_argument("--section", choices=("catalog", "tools", "helpers", "all"), default="all") + parser.add_argument("--format", choices=("json", "markdown"), default="json") + parser.add_argument("--output", type=Path, help="Explicit destination for a generated reference") + options = parser.parse_args() + if options.format == "markdown" and options.section != "catalog": + parser.error("Markdown cards require --section catalog") + root = options.root.resolve() + paths = ("relay/context.py", "relay/toolkit.py", "relay/sandbox.py", "relay/caps.py") + sources = {path: source_tree(root, path) for path in paths} + output: dict[str, object] = { + "source_sha256": { + path: hashlib.sha256(source.encode("utf-8")).hexdigest() + for path, (source, _) in sources.items() + } + } + if options.section in ("catalog", "all"): + catalog = ast.literal_eval(assignment(sources["relay/context.py"][1], "CTX_CATALOG")) + caps = sources["relay/caps.py"][1] + blocked = set(ast.literal_eval(assignment(caps, "MT_BLOCKED").args[0])) + prefixes = ("auth.", "phone.", *ast.literal_eval(assignment(caps, "MT_BLOCKED_PREFIXES"))) + output["catalog_count"] = len(catalog) + output["catalog"] = [ + { + "name": name, + "rpc": rpc, + "positional_order": required, + "field_types": fields, + "defaults": defaults, + "forbidden": forbidden, + "policy_blocked": rpc.lower() in blocked or rpc.lower().startswith(prefixes), + } + for name, (rpc, required, fields, defaults, forbidden) in catalog.items() + ] + if options.section in ("tools", "all"): + tree = sources["relay/toolkit.py"][1] + functions = {node.name: node for node in tree.body if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef))} + exports = assignment(tree, "TOOLKIT_FUNCS") + if not isinstance(exports, ast.Dict): + raise ValueError("TOOLKIT_FUNCS is not a literal dictionary") + records = [] + for key, value in zip(exports.keys, exports.values): + if not isinstance(value, ast.Name): + raise ValueError("Non-name TOOLKIT_FUNCS entry; inspect manually") + function = functions[value.id] + records.append({"name": ast.literal_eval(key), "signature": signature(function), "async": isinstance(function, ast.AsyncFunctionDef), "line": function.lineno}) + output["tools_count"] = len(records) + output["tools"] = records + if options.section in ("helpers", "all"): + worker = ast.parse(ast.literal_eval(assignment(sources["relay/sandbox.py"][1], "WORKER_SOURCE"))) + records = [] + for label, tree in (("shared", sources["relay/context.py"][1]), ("worker", worker)): + for node in tree.body: + if isinstance(node, ast.ClassDef) and node.name in {"MessageOperations", "ContextOperations", "SandboxContext", "_HtmlHelper", "_StateProxy", "_AssetsProxy", "_UiProxy", "_ScreensProxy"}: + for function in node.body: + if isinstance(function, (ast.FunctionDef, ast.AsyncFunctionDef)) and not function.name.startswith("_"): + positional = function.args.posonlyargs + function.args.args + records.append({"origin": label, "class": node.name, "signature": signature(function, bool(positional and positional[0].arg == "self")), "async": isinstance(function, ast.AsyncFunctionDef), "decorators": [ast.unparse(item) for item in function.decorator_list]}) + output["helpers"] = records + if hasattr(sys.stdout, "reconfigure"): + sys.stdout.reconfigure(encoding="utf-8") + if options.format == "markdown": + rendered = render_catalog(output) + else: + rendered = json.dumps(output, ensure_ascii=False, indent=2) + if options.output is not None: + options.output.write_text(rendered + "\n", encoding="utf-8") + else: + print(rendered) + + +if __name__ == "__main__": + main() +``` diff --git a/index.html b/index.html index 42d92fc..1426524 100644 --- a/index.html +++ b/index.html @@ -1,16 +1,22 @@ - + - Hotaru — Security-First Telegram Userbot + Hotaru - Security-First Telegram Userbot + + + - + - +
diff --git a/public/media/goygram-codec.png b/public/media/goygram-codec.png new file mode 100644 index 0000000..142b1fe Binary files /dev/null and b/public/media/goygram-codec.png differ diff --git a/public/media/goygram-mark.png b/public/media/goygram-mark.png new file mode 100644 index 0000000..ad54b9f Binary files /dev/null and b/public/media/goygram-mark.png differ diff --git a/public/media/hotaru-banner.png b/public/media/hotaru-banner.png new file mode 100644 index 0000000..97daeb3 Binary files /dev/null and b/public/media/hotaru-banner.png differ diff --git a/public/media/singularity-panel.png b/public/media/singularity-panel.png new file mode 100644 index 0000000..11457db Binary files /dev/null and b/public/media/singularity-panel.png differ diff --git a/public/skill/SKILL.md b/public/skill/SKILL.md index cc3a5a7..5e4de57 100644 --- a/public/skill/SKILL.md +++ b/public/skill/SKILL.md @@ -1,1055 +1,8472 @@ ---- -name: hotaru-module-developer -description: Exhaustive engineering specification and agent reference for authoring secure .hmod modules for the Hotaru Telegram userbot with Linux namespace sandboxing, capability enforcement, and complete ModuleContext API reference. ---- - -# Hotaru Module Developer Reference & Agent Skill - -Hotaru is a security-first Telegram userbot operating from a primary user account. Unlike legacy userbot platforms that load third-party scripts directly into the interpreter alongside Telegram authentication sessions, Hotaru enforces process isolation and hardware-assisted capability sandboxing. - -Modules (.hmod files) execute under strict Linux namespace boundaries: -- CLONE_NEWNS (Mount Namespace): Private filesystem table. /root, /home, /etc, sanctuary/ are concealed or read-only. Temporary files reside in ephemeral tmpfs. -- CLONE_NEWIPC (IPC Namespace): Isolated message queues and shared memory. -- CLONE_NEWUTS (Hostname Namespace): Isolated hostname identifiers. -- CLONE_NEWNET (Network Namespace): Network stack isolation. Modules without the 'net' capability have only a down loopback device. -- Privilege Dropping: Effective UID/GID set to nobody/nogroup (65534). prctl(PR_SET_NO_NEW_PRIVS, 1) enforced. -- Zero Comments Rule: Hotaru production code and .hmod modules must contain zero comments. - -## 1. Core Architecture & Linux Namespace Isolation - -Hotaru is a security-first Telegram userbot operating from a primary user account. Unlike legacy userbot platforms that load third-party scripts directly into the interpreter alongside Telegram authentication sessions, Hotaru enforces process isolation and hardware-assisted capability sandboxing. - -### Subsystem Topology - -The Hotaru repository is divided into four distinct security tiers: - -1. hotaru/ (Kernel Core): -The privileged supervisor managing account sessions, the encrypted master vault (AES-GCM), event dispatching, command registries, and interactive screen rendering. It never executes unverified third-party code in its process space. - -2. relay/ (Capability Firewall): -The security boundary mediating all communication between external modules and the Telegram MTProto transport. The relay contains capability definitions (relay/caps.py), network egress proxies (relay/proxies.py), filesystem isolation gates (relay/files.py), and the RPC denylist (relay/denylist.py). - -3. constellations/ (Built-in Modules): -System extensions implemented in the .hmod format (accounts, acl, backups, catalyst, executor, genesis, help, info, logger, power, settings, shield, singularity, translations, updater). Built-in modules are core components and their triggers are reserved. - -4. sanctuary/ (Private Runtime State): -Encrypted user data directory containing session credentials (sanctuary/hotaru.vault), SQLite state databases, and audit logs. This directory is strictly inaccessible to third-party modules. - -### Linux Namespace Isolation Model - -When Hotaru loads a third-party .hmod module, it launches an isolated worker process configured with four Linux kernel namespaces: - -• CLONE_NEWNS (Mount Namespace): -The worker process receives a private mount table. Critical directories (/root, /home, /etc, /proc/keys, and sanctuary/) are either concealed or mounted read-only. Temporary files reside in an ephemeral tmpfs mount discarded on process exit. - -• CLONE_NEWIPC (IPC Namespace): -Isolates System V IPC and POSIX message queues, preventing shared-memory snooping or signal hijacking between modules. - -• CLONE_NEWUTS (Hostname Namespace): -Isolates UTS system identifiers and hostname information. - -• CLONE_NEWNET (Network Namespace): -Isolates the network stack. Unless a module explicitly declares the 'net' capability in its manifest, its network namespace contains only a down loopback device. Raw socket calls, DNS queries, and HTTP requests fail at the OS syscall boundary with ENETUNREACH or EPERM. - -### Privilege Dropping & Syscall Control - -Before executing module code, the worker drops root privileges: -• Switches effective UID to nobody (65534) and GID to nogroup (65534). -• Enforces prctl(PR_SET_NO_NEW_PRIVS, 1) to prevent privilege escalation via setuid binaries. -• Channels all I/O through unidirectional UNIX pipes and typed JSON/TLV RPC serialization. - -## 2. The .hmod Module Specification & Lifecycle - -A Hotaru module is a self-contained Python source file ending with the .hmod extension. The runtime loads modules dynamically through the sandboxed runner. - -### Manifest Schema: HOTARU Dictionary - -Every .hmod module must expose a top-level module dictionary named HOTARU: - -```python -from __future__ import annotations -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from hotaru.response import ModuleContext - -async def qr_command(ctx: ModuleContext) -> None: - text = ctx.raw_args.strip() - if not text: - await ctx.respond(ctx.t("missing_text")) - return - url = f"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data={text}" - response = await ctx.net(url) - await ctx.reply_photo(response.content, caption=ctx.t("generated")) - -HOTARU = { - "id": "qr_tool", - "name": "QR Generator", - "version": "1.0.0", - "author": "Security Engineering", - "description": "Renders high resolution QR codes directly in chat.", - "capabilities": ["mt", "net"], - "commands": { - "qr": qr_command, - }, - "lexicon": { - "en": { - "missing_text": "Please provide text or a URL after .qr", - "generated": "Here is your generated QR code.", - }, - "ru": { - "missing_text": "Укажите текст или ссылку после .qr", - "generated": "Ваш QR-код успешно сгенерирован.", - }, - }, -} -``` - -### Manifest Fields Reference - -• id (str, required): Unique lowercase identifier containing alphanumeric characters and underscores (e.g. 'qr_tool', 'notes_mgr', 'crypto_ticker'). -• name (str, required): Human-readable display name. -• version (str, required): Semantic version string (MAJOR.MINOR.PATCH). -• author (str, optional): Author handle or organization. -• description (str, optional): Functional summary of the module. -• capabilities (list[str], required): Set of hardware and network capabilities requested by the module. -• commands (dict[str, Callable], required): Mapping of command triggers to asynchronous handler coroutines. Every handler receives ctx: ModuleContext as its single argument. -• tasks (dict[str, Callable], optional): Long-running background coroutines supervised by the core engine. -• lexicon (dict[str, dict[str, str]], optional): Localization dictionary supporting 'en', 'ru', 'uk', 'ja', 'kz', and 'zh'. - -### Reserved Kernel Triggers - -Hotaru reserves all command triggers utilized by built-in constellation modules. A third-party module attempting to bind any of the following triggers will fail validation at load time: -accounts, acl, backups, catalyst, executor, genesis, help, info, logger, power, settings, shield, singularity, translations, updater, ping, dash, restart, config, backup. - -## 3. Capability System & RPC Firewall - -Hotaru adheres to the principle of least privilege. By default, an isolated module has zero permissions: no network egress, no filesystem read or write outside its tmpfs mount, and no direct MTProto invocation. - -### Available Capabilities - -1. mt: -Grants mediated access to Telegram MTProto RPC calls via ctx.mt(method, **kwargs) and high-level messaging helpers. All RPC calls are intercepted by relay/firewall.py and verified against relay/denylist.py. - -2. net: -Enables the network namespace egress interface. Allows outgoing HTTP, HTTPS, and TCP socket requests through ctx.net(url) and ctx.stream(host, port). Modules lacking this capability cannot communicate over the Internet. - -3. state: -Provides persistent key-value storage scoped strictly to the module id. Backed by SQLite in a secured namespace. Modules cannot inspect or modify state entries belonging to other modules. - -4. files: -Grants read and write access inside the module's ephemeral tmpfs scratch directory. Path traversal attempts (such as ../../sanctuary) are trapped and terminated with a security exception. - -5. accounts: -Allows read-only introspection of configured userbot accounts via ctx.accounts. - -6. screens: -Enables the interactive UI screen rendering engine (ctx.screens) for terminal and message-based navigation. - -### The RPC Denylist - -When a module with the 'mt' capability issues raw RPC calls, relay/denylist.py evaluates the method name against destructive Telegram operations. The following methods are strictly forbidden: - -• Authentication and session revocation: -auth.logOut, auth.resetAuthorizations, auth.dropTempAuthKeys - -• Account destruction: -account.deleteAccount - -• Two-factor password modification: -account.updatePasswordSettings - -If a module attempts to invoke a denylisted method, the relay immediately intercepts the packet, drops the worker process, logs the violation, and revokes all module capabilities. - -## 4. ModuleContext: Complete Properties Catalog - -The ModuleContext instance passed to command handlers and background tasks provides real-time event metadata and execution state. - -### Properties Reference Table - -• ctx.module_id -> str -Returns the unique identifier of the executing module. -Example: -assert ctx.module_id == "qr_tool" - -• ctx.chat_id -> int -Telegram ID of the dialog, group, or channel where the command was triggered. -Example: -chat = ctx.chat_id - -• ctx.sender_id / ctx.user_id -> int | None -Telegram user ID of the individual who sent the triggering message. Returns None if the message originated from an anonymous channel. -Example: -sender = ctx.sender_id or 0 - -• ctx.topic_id -> int | None -Thread ID when the message is posted inside a forum supergroup topic. Returns None in regular chats. -Example: -if ctx.topic_id is not None: - await ctx.respond(f"Executed in topic {ctx.topic_id}") - -• ctx.is_me / ctx.out -> bool -Boolean indicating whether the triggering message was sent by the userbot account itself. -Example: -if not ctx.is_me: - return - -• ctx.message -> ModuleMessage -The underlying message object containing text, entities, reply references, and raw flags. -Example: -raw_id = ctx.message.id - -• ctx.has_media -> bool -Evaluates to True if the triggering message contains an attached photo, video, document, audio, sticker, voice note, or animation. -Example: -if not ctx.has_media: - await ctx.respond("Please attach a file.") - return - -• ctx.media / ctx.attachment -> Attachment | None -Represents the media payload attached to the current message. Exposes .file_id, .size, .mime_type, and .filename. -Example: -if ctx.attachment: - size_mb = ctx.attachment.size / (1024 * 1024) - -• ctx.reply_message -> ModuleMessage | None -If the command was executed in reply to another message, returns that referenced message. Otherwise returns None. -Example: -if ctx.reply_message: - target_author = ctx.reply_message.sender_id - -• ctx.reply_attachment -> Attachment | None -The media attachment present on the replied-to message. -Example: -if ctx.reply_attachment: - data = await ctx.download(ctx.reply_attachment) - -• ctx.args -> list[str] -List of command arguments split by whitespace, excluding the prefix and command trigger. -Example: -if len(ctx.args) < 2: - await ctx.respond("Usage: .calc ") - -• ctx.raw_args -> str -The complete, unparsed string following the command trigger. Preserves leading and trailing whitespace. -Example: -query = ctx.raw_args.strip() - -• ctx.prefix -> str -The specific prefix character used to trigger the command (e.g. '.' or '!'). -Example: -pfx = ctx.prefix - -• ctx.uptime -> float -The uptime of the Hotaru supervisor process in seconds. -Example: -up_hours = ctx.uptime / 3600.0 - -• ctx.memory / ctx.ram -> int -The resident set size (RSS) memory consumption of the worker process in bytes. -Example: -mb_used = ctx.memory / (1024 * 1024) - -• ctx.version -> str -The Hotaru core version string. -Example: -current_ver = ctx.version - -• ctx.is_stopping -> bool -Flag indicating whether the userbot has initiated shutdown. Checked by background tasks to perform graceful cleanup. -Example: -while not ctx.is_stopping: - await asyncio.sleep(1) - -## 5. ModuleContext: Messaging & Editing Methods - -ModuleContext provides methods to create, edit, forward, react to, and delete messages. - -### ctx.reply -Signature: -`await ctx.reply(text: str, *, parse_mode: str = "html", link_preview: bool = False, silent: bool = False, schedule_date: int | None = None) -> ModuleMessage` -Description: -Sends a message into the current chat in explicit reply to the triggering message. -Parameters: -• text (str): The body text to transmit. -• parse_mode (str): Entity parser ('html', 'md', or None). Defaults to 'html'. -• link_preview (bool): Enables or disables rich URL preview cards. -• silent (bool): Delivers the notification without sound. -• schedule_date (int | None): Unix timestamp for scheduled delivery. -Returns: -ModuleMessage instance of the sent message. -Exceptions: -Raises TelegramError on flood wait or chat restrictions. -Example: -```python -await ctx.reply("Calculation result: 42", parse_mode="html") -``` - -### ctx.respond -Signature: -`await ctx.respond(text: str, *, parse_mode: str = "html", link_preview: bool = False) -> ModuleMessage` -Description: -If the triggering message was sent by the userbot account (ctx.is_me is True), edits that message in place. If the message was sent by another user, sends a fresh reply. -Returns: -ModuleMessage instance. -Example: -```python -msg = await ctx.respond("Processing dataset...") -await msg.edit("Processing complete.") -``` - -### ctx.edit -Signature: -`await ctx.edit(text: str, *, parse_mode: str = "html", link_preview: bool = False) -> ModuleMessage` -Description: -Edits the content of the triggering message. Fails if the message was not authored by the userbot. -Exceptions: -Raises PermissionError if ctx.is_me is False. -Example: -```python -await ctx.edit("Status: Updated") -``` - -### ctx.delete -Signature: -`await ctx.delete(*, revoke: bool = True) -> bool` -Description: -Deletes the triggering message. -Parameters: -• revoke (bool): When True, deletes the message for all chat participants. -Returns: -bool indicating success. -Example: -```python -await ctx.delete(revoke=True) -``` - -### ctx.pin -Signature: -`await ctx.pin(*, silent: bool = False, unpin_both: bool = False) -> bool` -Description: -Pins the triggering message in the current chat. -Example: -```python -await ctx.pin(silent=True) -``` - -### ctx.unpin -Signature: -`await ctx.unpin() -> bool` -Description: -Unpins the triggering message. -Example: -```python -await ctx.unpin() -``` - -### ctx.react -Signature: -`await ctx.react(emoji: str, *, big: bool = False) -> bool` -Description: -Applies an emoji reaction to the triggering message. -Parameters: -• emoji (str): Unicode emoji character (e.g. '🔥', '👍', '❤️'). -• big (bool): Displays full-screen reaction animation. -Example: -```python -await ctx.react("🔥", big=True) -``` - -### ctx.unreact -Signature: -`await ctx.unreact() -> bool` -Description: -Removes any previously set reaction by the userbot on the current message. -Example: -```python -await ctx.unreact() -``` - -### ctx.forward_to -Signature: -`await ctx.forward_to(target_chat_id: int, *, silent: bool = False) -> ModuleMessage` -Description: -Forwards the triggering message to the specified target chat or user. -Example: -```python -await ctx.forward_to(123456789, silent=True) -``` - -### ctx.copy_to -Signature: -`await ctx.copy_to(target_chat_id: int, *, caption: str | None = None) -> ModuleMessage` -Description: -Sends a duplicate copy of the triggering message without the forwarded header. -Example: -```python -await ctx.copy_to(123456789, caption="Copied snippet") -``` - -### ctx.save -Signature: -`await ctx.save() -> ModuleMessage` -Description: -Forwards the message directly to Saved Messages ('me'). -Example: -```python -await ctx.save() -``` - -### ctx.typing -Signature: -`await ctx.typing(action: str = "typing") -> None` -Description: -Sends a chat action notification to indicate activity. -Supported actions: 'typing', 'upload_photo', 'record_video', 'upload_video', 'record_audio', 'upload_audio', 'upload_document', 'choose_sticker'. -Example: -```python -await ctx.typing("upload_document") -``` - -### ctx.read & ctx.mark_read -Signature: -`await ctx.read() -> bool` -Description: -Marks all incoming messages in the current dialog up to the current message as read. -Example: -```python -await ctx.read() -``` - -## 6. ModuleContext: Media & File Operations - -Hotaru handles media upload, transmission, and download through high-level streaming helpers that bypass disk storage when operating with memory buffers. - -### ctx.send_file & ctx.reply_file -Signature: -`await ctx.reply_file(file: bytes | str | BinaryIO, *, caption: str | None = None, force_document: bool = False, filename: str | None = None) -> ModuleMessage` -Description: -Transmits an arbitrary binary payload, local file, or memory stream as a file attachment. -Parameters: -• file: Raw bytes, string path, or file-like object. -• caption: Optional descriptive text. -• force_document: Forces document delivery even for photos or audio. -• filename: Explicit filename when transmitting raw bytes. -Example: -```python -data = b"ID,Name\n1,Alpha\n2,Beta" -await ctx.reply_file(data, filename="report.csv", caption="Weekly Export") -``` - -### ctx.send_photo & ctx.reply_photo -Signature: -`await ctx.reply_photo(photo: bytes | str | BinaryIO, *, caption: str | None = None, parse_mode: str = "html") -> ModuleMessage` -Description: -Sends a JPEG, PNG, or WEBP image formatted as a compressed Telegram photo. -Example: -```python -with open("chart.png", "rb") as f: - await ctx.reply_photo(f.read(), caption="System Metrics") -``` - -### ctx.send_video & ctx.reply_video -Signature: -`await ctx.reply_video(video: bytes | str | BinaryIO, *, caption: str | None = None, duration: int | None = None, width: int | None = None, height: int | None = None) -> ModuleMessage` -Description: -Transmits an MP4 or MOV video container with dimensions and playback duration metadata. -Example: -```python -await ctx.reply_video("capture.mp4", duration=14, caption="Recorded stream") -``` - -### ctx.send_audio & ctx.reply_audio -Signature: -`await ctx.reply_audio(audio: bytes | str | BinaryIO, *, caption: str | None = None, duration: int | None = None, performer: str | None = None, title: str | None = None) -> ModuleMessage` -Description: -Transmits an MP3, FLAC, or OGG music track with track title and performer tags. -Example: -```python -await ctx.reply_audio(audio_data, title="Synthesized Wave", performer="Hotaru") -``` - -### ctx.send_voice & ctx.reply_voice -Signature: -`await ctx.reply_voice(voice: bytes | str | BinaryIO, *, caption: str | None = None, duration: int | None = None) -> ModuleMessage` -Description: -Transmits an Opus-encoded audio stream as a voice waveform note. -Example: -```python -await ctx.reply_voice(opus_bytes, duration=5) -``` - -### ctx.send_animation & ctx.reply_animation -Signature: -`await ctx.reply_animation(animation: bytes | str | BinaryIO, *, caption: str | None = None) -> ModuleMessage` -Description: -Transmits a silent looping MP4 or GIF file as an in-chat animated sticker. -Example: -```python -await ctx.reply_animation("radar.mp4") -``` - -### ctx.send_dice & ctx.reply_dice -Signature: -`await ctx.reply_dice(emoji: str = "🎲") -> ModuleMessage` -Description: -Rolls an animated Telegram dice. Supported emojis: '🎲', '🎯', '🏀', '⚽', '🎳', '🎰'. -Example: -```python -await ctx.reply_dice("🎯") -``` - -### ctx.edit_media -Signature: -`await ctx.edit_media(media: bytes | str | BinaryIO, *, caption: str | None = None, parse_mode: str = "html") -> ModuleMessage` -Description: -Replaces the media attachment of an existing message without re-sending the message entity. -Example: -```python -await ctx.edit_media(updated_chart_bytes, caption="Updated at 12:00 UTC") -``` - -### ctx.edit_caption -Signature: -`await ctx.edit_caption(caption: str, *, parse_mode: str = "html") -> ModuleMessage` -Description: -Updates the text caption of an existing media message without re-uploading the underlying file. -Example: -```python -await ctx.edit_caption("Archived capture") -``` - -### ctx.download & ctx.download_media -Signature: -`await ctx.download(attachment: Attachment | None = None, destination: str | None = None) -> bytes | str` -Description: -Downloads the attachment associated with the triggering message or replied message. If destination is provided, streams the file to disk and returns the string path. If destination is None, buffers the complete file into memory and returns bytes. -Example: -```python -if ctx.reply_attachment: - file_bytes = await ctx.download(ctx.reply_attachment) - assert isinstance(file_bytes, bytes) -``` - -## 7. ModuleContext: Buttons, Polls & Checklists - -Hotaru enables deep interaction with inline buttons, Telegram polls, and native checklists. - -### Inline Button Operations - -• ctx.buttons -> list[list[MessageButton]] -Matrix of inline buttons present on the triggering message. Each button exposes .text, .data, and .url. - -• ctx.button_count -> int -Total count of inline buttons on the message. - -• await ctx.click(row: int, col: int) -> Any -Simulates tapping an inline button at the specified matrix coordinate. - -• await ctx.click_button(text: str | None = None, data: bytes | None = None) -> Any -Searches for an inline button matching the label or callback payload and triggers it. -Example: -```python -await ctx.click_button(text="Confirm") -``` - -• await ctx.edit_buttons(buttons: list[list[dict[str, str]]]) -> None -Updates or replaces the inline keyboard markup of the current message. -Example: -```python -markup = [ - [{"text": "Refresh", "data": "ref_1"}, {"text": "Dismiss", "data": "dis_1"}] -] -await ctx.edit_buttons(markup) -``` - -• await ctx.remove_buttons() -> None -Strips all inline keyboard buttons from the message while keeping its text intact. -Example: -```python -await ctx.remove_buttons() -``` - -### Native Poll Operations - -• await ctx.send_poll(question: str, answers: list[str], *, multiple_choice: bool = False, quiz: bool = False, correct_id: int | None = None) -> ModuleMessage -Sends an interactive poll into the chat. -Parameters: -• question: The inquiry heading (up to 255 characters). -• answers: List of 2 to 10 option strings. -• multiple_choice: Permits selecting multiple answers. -• quiz: Sets quiz mode requiring a single correct answer. -• correct_id: Zero-indexed position of the correct answer in quiz mode. -Example: -```python -await ctx.send_poll( - "Choose target deployment region:", - ["Frankfurt", "Tokyo", "Virginia"], - multiple_choice=False, -) -``` - -• await ctx.close_poll() -> Any -Closes voting on the poll contained in the current message. -Example: -```python -await ctx.close_poll() -``` - -• await ctx.vote(answers: list[int]) -> Any -Casts a vote on the poll for the specified answer indices. -Example: -```python -await ctx.vote([0]) -``` - -• await ctx.retract_vote() -> Any -Retracts the userbot's cast vote from the poll. -Example: -```python -await ctx.retract_vote() -``` - -• await ctx.get_poll_results() -> dict[str, Any] -Retrieves aggregated vote totals and percentages for the poll. - -### Native Telegram Checklists - -• await ctx.send_todo(title: str, items: list[str], *, others_can_append: bool = False, others_can_complete: bool = False) -> ModuleMessage -Transmits a native Telegram checklist with checkable boxes. -Example: -```python -await ctx.send_todo( - "Deployment Checklist", - ["Run migrations", "Flush cache", "Verify health check"], - others_can_complete=True, -) -``` - -• await ctx.append_todo(items: list[str]) -> Any -Appends additional task items to an existing checklist message. -Example: -```python -await ctx.append_todo(["Verify DNS propagation"]) -``` - -• await ctx.set_checklist_completed(completed: list[int], incompleted: list[int]) -> Any -Toggles the checked state of checklist items by index. - -## 8. Extended Telegram Subsystem Catalog - -The Hotaru relay provides direct access to over 290 granular Telegram methods through ctx. These methods are type-checked, sanitized, and bound to the current peer. - -### Forum Topics Management - -• await ctx.create_forum_topic(title: str, icon_color: int | None = None, icon_emoji_id: int | None = None) -> Any -Creates a discussion thread inside a forum supergroup. -Example: -```python -topic = await ctx.create_forum_topic("Incident #402", icon_color=0x6FB9F0) -``` - -• await ctx.edit_forum_topic(topic_id: int, title: str | None = None, closed: bool | None = None) -> Any -Modifies topic title or toggles closed status. - -• await ctx.set_forum_topic_pinned(topic_id: int, pinned: bool) -> Any -Pins or unpins a topic in the forum index. - -• await ctx.remove_forum_topic(topic_id: int) -> Any -Deletes a forum topic and its complete message history. - -• await ctx.forum_topics(offset_date: int = 0, limit: int = 50) -> Any -Lists forum topics in the current channel. - -### Channel Administration - -• await ctx.channel_details() -> Any -Fetches metadata, participant count, and description for the current channel. - -• await ctx.channel_members(limit: int = 50) -> Any -Retrieves participant records for the channel. - -• await ctx.set_channel_admin(user_id: int, is_admin: bool, rank: str = "") -> Any -Promotes or demotes an administrator with a custom badge title. - -• await ctx.restrict_channel_member(user_id: int, send_messages: bool = False) -> Any -Restricts specific permissions of a member. - -• await ctx.channel_admin_log(limit: int = 50) -> Any -Extracts audit log events including member bans, message deletions, and role changes. - -• await ctx.set_slow_mode(seconds: int) -> Any -Configures slow mode interval in seconds (0 to disable). - -• await ctx.set_antispam(enabled: bool) -> Any -Toggles Telegram native aggressive anti-spam protection. - -### Reactions & Scheduled History - -• await ctx.configure_chat_reactions(available_reactions: list[str]) -> Any -Restricts allowed reaction emojis in a group or channel. - -• await ctx.scheduled_messages() -> list[Any] -Retrieves pending scheduled messages in the current chat. - -• await ctx.cancel_scheduled(ids: list[int]) -> Any -Cancels and removes scheduled messages by their identifier. - -## 9. State Storage & Network Stream Engine - -Hotaru isolates persistence and network I/O behind dedicated capability proxies. - -### Persistent Key-Value State (ctx.state) - -Requires capability: 'state' -State is backed by an encrypted SQLite engine. Keys are scoped strictly to the calling module ID, guaranteeing isolation between modules. - -Methods: -• await ctx.state.get(key: str, default: Any = None) -> Any -Retrieves the value associated with key. If absent, returns default. - -• await ctx.state.set(key: str, value: Any) -> None -Persists a JSON-serializable value (dict, list, int, float, str, bool). - -• await ctx.state.delete(key: str) -> bool -Removes key from storage. Returns True if the key existed. - -• await ctx.state.clear() -> None -Purges all key-value entries belonging to this module. - -• await ctx.state.all() -> dict[str, Any] -Dumps the entire key-value space of the module. - -Usage Example: -```python -async def counter_command(ctx: ModuleContext) -> None: - current = await ctx.state.get("invocations", 0) - current += 1 - await ctx.state.set("invocations", current) - await ctx.respond(f"Command executed {current} times.") -``` - -### Network Client & TCP Streaming (ctx.net & ctx.stream) - -Requires capability: 'net' -All egress traffic passes through a proxy gateway enforcing TLS validation and connection rate limiting. - -1. HTTP Requests (ctx.net): -Signature: -`await ctx.net(url: str, *, method: str = "GET", headers: dict[str, str] | None = None, data: bytes | None = None, json: Any | None = None, timeout: float = 10.0) -> HttpResponse` -Properties on HttpResponse: -• .status_code (int): HTTP response status code (e.g. 200, 404). -• .text (str): Decoded unicode response body. -• .content (bytes): Raw binary response body. -• .headers (dict[str, str]): HTTP response headers. - -Usage Example: -```python -async def weather_command(ctx: ModuleContext) -> None: - city = ctx.raw_args.strip() or "London" - url = f"https://wttr.in/{city}?format=j1" - response = await ctx.net(url) - if response.status_code == 200: - data = json.loads(response.text) - temp = data["current_condition"][0]["temp_C"] - await ctx.respond(f"Temperature in {city}: {temp}°C") -``` - -2. Raw TCP Streaming (ctx.stream): -Signature: -`stream = await ctx.stream(host: str, port: int, *, ssl: bool = True) -> NetStream` -Methods on NetStream: -• await stream.send(data: bytes) -> None -• await stream.recv(size: int = 4096) -> bytes -• await stream.close() -> None - -## 10. Interactive Screens, Navigation & Form Engine - -The Hotaru Screens engine (ctx.screens) enables developers to create stateful interactive menus and terminal screens within Telegram messages. - -### Screen Components Reference - -• await ctx.screens.show(title: str, body: str, *, buttons: list[list[Any]] | None = None, pager: Any | None = None) -> FormHandle -Renders a structured message screen with header, content body, and inline keyboard controls. - -• ctx.screens.button(text: str, callback: Callable[[FormHandle], Awaitable[None]], style: str = "default") -Creates an interactive button bound to an asynchronous callback coroutine. - -• ctx.screens.primary(text: str, callback: Callable) -Creates a visually highlighted primary action button. - -• ctx.screens.danger(text: str, callback: Callable) -Creates a destructive warning button (red accent). - -• ctx.screens.success(text: str, callback: Callable) -Creates an affirmative action button (green accent). - -• ctx.screens.pager(current_page: int, total_pages: int, on_page_change: Callable[[int], Awaitable[None]]) -Constructs a pagination bar with previous, index, and next triggers. - -• ctx.screens.table(headers: list[str], rows: list[list[str]], page: int = 1, page_size: int = 5) -> str -Renders an aligned ASCII table formatted for mobile monospaced display. - -• ctx.screens.close() -Creates a dismissal button that cleanly tears down the interactive screen. - -### Stateful Navigation Example - -```python -async def notes_menu(ctx: ModuleContext) -> None: - notes = await ctx.state.get("notes_list", []) - - async def render_view(page: int = 0) -> None: - items_per_page = 3 - total = max(1, (len(notes) + items_per_page - 1) // items_per_page) - slice_items = notes[page * items_per_page:(page + 1) * items_per_page] - - body_lines = [f"{i+1}. {item}" for i, item in enumerate(slice_items)] - body = "\n".join(body_lines) or "No notes saved yet." - - rows = [] - if total > 1: - pager_row = [] - if page > 0: - pager_row.append(ctx.screens.button("Prev", lambda h: render_view(page - 1))) - pager_row.append(ctx.screens.button(f"{page + 1}/{total}", lambda h: None)) - if page < total - 1: - pager_row.append(ctx.screens.button("Next", lambda h: render_view(page + 1))) - rows.append(pager_row) - - rows.append([ - ctx.screens.success("Add Note", add_note_flow), - ctx.screens.danger("Clear All", clear_notes_flow), - ]) - - await ctx.screens.show("Notes Manager", body, buttons=rows) - - async def add_note_flow(handle: FormHandle) -> None: - notes.append(f"Note recorded at {int(ctx.uptime)}s") - await ctx.state.set("notes_list", notes) - await render_view(0) - - async def clear_notes_flow(handle: FormHandle) -> None: - notes.clear() - await ctx.state.set("notes_list", []) - await render_view(0) - - await render_view(0) -``` - -## 11. Background Supervisor Tasks & Lifecycle - -Modules can run background tasks that persist throughout the userbot runtime. Declare tasks in the tasks mapping of the HOTARU dictionary. - -### Background Task Lifecycle - -1. Registration: -During module startup, Hotaru registers every coroutine declared in HOTARU['tasks']. - -2. Supervisor Monitoring: -Tasks run inside the module's sandboxed worker process. If a task crashes due to an unhandled exception, the Hotaru supervisor restarts it with exponential backoff (up to 5 attempts). - -3. Graceful Termination: -During bot shutdown or module unloading, ctx.is_stopping is set to True. The task is given a 5-second grace period to flush buffers, close open files, and exit cleanly before SIGKILL. - -### Background Worker Pattern - -```python -import asyncio -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from hotaru.response import ModuleContext - -async def reminder_worker(ctx: ModuleContext) -> None: - while not ctx.is_stopping: - try: - reminders = await ctx.state.get("pending_reminders", []) - now = int(asyncio.get_event_loop().time()) - active = [] - for r in reminders: - if r["timestamp"] <= now: - await ctx.tg.send_message(r["chat_id"], f"Reminder: {r['text']}") - else: - active.append(r) - if len(active) != len(reminders): - await ctx.state.set("pending_reminders", active) - except Exception: - pass - - for _ in range(10): - if ctx.is_stopping: - break - await asyncio.sleep(1) - -HOTARU = { - "id": "reminders", - "name": "Background Reminder", - "version": "1.0.0", - "capabilities": ["mt", "state"], - "commands": {}, - "tasks": { - "checker": reminder_worker, - }, -} -``` - -## 12. Internationalization & Lexicons - -Hotaru user interfaces adapt dynamically to the user's configured language. Hardcoding user-facing strings in command handlers is strictly prohibited. - -### Lexicon Schema - -Declare a lexicon dictionary in the module manifest containing language sub-dictionaries: - -```python -"lexicon": { - "en": { - "welcome": "Welcome back, {user}!", - "error_empty": "Query cannot be empty.", - }, - "ru": { - "welcome": "С возвращением, {user}!", - "error_empty": "Запрос не может быть пустым.", - }, - "uk": { - "welcome": "З поверненням, {user}!", - "error_empty": "Запит не може бути порожнім.", - }, -} -``` - -### Retrieving Localized Strings: ctx.t - -Signature: -`ctx.t(key: str, **kwargs) -> str` - -Behavior: -1. Checks the user's active language setting. -2. If the key exists in that language, returns the translated string formatted with **kwargs. -3. If absent, falls back to the English ('en') translation. -4. If missing from English, returns the raw key literal as a safety measure. - -Usage Example: -```python -greeting = ctx.t("welcome", user="Alice") -await ctx.respond(greeting) -``` - -## 13. Security Audit Checklist & Semgrep Rules - -Before any module is distributed or loaded into Hotaru, it must satisfy strict static security requirements. - -### Semgrep Security Verification - -The repository enforces Semgrep rules located in .semgrep/hotaru-security.yml: - -1. No Credentials Leakage (hotaru-no-vault-leak): -Modules must never attempt to open, read, or transmit files located in sanctuary/, including hotaru.vault, runtime.db, or session files. - -2. No Private Namespace Access (hotaru-no-private-escape): -Modules must never inspect or modify private attributes of the core engine (__class__, __subclasses__, __globals__, or sys.modules). - -3. No Unsandboxed Network Sockets (hotaru-no-raw-socket): -Direct import of socket, urllib, or requests is blocked by the runtime. All network traffic must use ctx.net or ctx.stream with the 'net' capability declared. - -4. No System Shell Execution (hotaru-no-shell-exec): -Calls to os.system, subprocess.Popen, os.popen, or pty.spawn are trapped by seccomp filters and result in immediate worker SIGKILL. - -5. Zero Comments in Production Code: -In accordance with Hotaru code purity standards, production .hmod files contain zero comment lines. Code must be self-documenting through precise type annotations and explicit naming. - -## 14. Complete Production Module Blueprints - -The following production blueprints demonstrate real-world, secure module design. Notice that neither ping nor any kernel command is used. - -### Blueprint 1: Text Encryption Tool (.cipher) - -```python -from __future__ import annotations -import base64 -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from hotaru.response import ModuleContext - -async def cipher_command(ctx: ModuleContext) -> None: - text = ctx.raw_args.strip() - if not text: - await ctx.respond(ctx.t("missing_input")) - return - encoded = base64.b64encode(text.encode("utf-8")).decode("ascii") - await ctx.respond(f"{encoded}", parse_mode="html") - -HOTARU = { - "id": "b64_cipher", - "name": "Base64 Cipher", - "version": "1.0.0", - "capabilities": ["mt"], - "commands": { - "cipher": cipher_command, - }, - "lexicon": { - "en": { - "missing_input": "Usage: .cipher ", - }, - "ru": { - "missing_input": "Использование: .cipher <текст для кодирования>", - }, - }, -} -``` - -### Blueprint 2: Persistent Paste Bin (.paste) - -```python -from __future__ import annotations -import json -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from hotaru.response import ModuleContext - -async def paste_command(ctx: ModuleContext) -> None: - content = ctx.raw_args.strip() - if not content and ctx.reply_message: - content = ctx.reply_message.message.text - if not content: - await ctx.respond(ctx.t("empty_paste")) - return - await ctx.typing("upload_document") - payload = json.dumps({"content": content, "extension": "txt"}).encode("utf-8") - res = await ctx.net( - "https://paste.rs", - method="POST", - headers={"Content-Type": "text/plain"}, - data=content.encode("utf-8"), - ) - if res.status_code in (200, 201): - url = res.text.strip() - await ctx.respond(ctx.t("paste_success", url=url)) - else: - await ctx.respond(ctx.t("paste_error")) - -HOTARU = { - "id": "paste_bin", - "name": "Paste Bin Uploader", - "version": "1.0.0", - "capabilities": ["mt", "net"], - "commands": { - "paste": paste_command, - }, - "lexicon": { - "en": { - "empty_paste": "Provide text or reply to a message with .paste", - "paste_success": "Uploaded to pastebin: {url}", - "paste_error": "Failed to upload snippet.", - }, - "ru": { - "empty_paste": "Укажите текст или ответьте на сообщение через .paste", - "paste_success": "Сниппет опубликован: {url}", - "paste_error": "Ошибка при публикации сниппета.", - }, - }, -} -``` +--- +name: hotaru-modules +description: >- + Разработка, редактирование, исправление и ревью модулей Telegram-userbot Hotaru + (.hmod): манифест HOTARU, SandboxContext, команды и алиасы, MTProto/GoyGram, + сообщения и медиа, inline/rich UI, callbacks и ввод, конфиги, состояние и миграции, + watchers, lifecycle, фоновые задачи, capabilities, сеть, зависимости и тесты; + справочник контекстных методов без raw mt, ctx.tools, regdate и search. + Использовать при создании нового модуля Hotaru, добавлении функций, исправлении + ошибок и адаптации существующего .hmod. Проверять фактический API целевой версии, + сохранять поведение и пользовательские данные, не путать sandbox и ядро. +--- + +# Разработка и редактирование модулей Hotaru + +## 1. Назначение и контракт + +Ты разрабатываешь настоящий устанавливаемый модуль Hotaru, а не приблизительный +Python-пример. Выполняй пользовательскую задачу в её границах: создание, точечная +правка, расширение, диагностика или ревью. Не переписывай всё без необходимости. + +- По умолчанию результат — один самодостаточный `.hmod`. Helpers, + пользовательские строки и статические данные размещай внутри него. Не создавай + обязательные соседние `.py`, JSON, ресурсы, установщики и скрытые сервисы. +- Предпочитай стандартную библиотеку и штатные API Hotaru. Внешние зависимости + допустимы только при обоснованной необходимости и совместимости с установкой + пользователя; явно декларируй их и сообщай об этом. Не устанавливай их молча. +- Тесты можно создавать отдельно в тестовой или временной области; не превращай + их в обязательную часть устанавливаемого модуля. +- Не меняй ядро Hotaru, ACL, глобальные настройки и sandbox ради обхода ограничения + модуля. Если публичного контракта недостаточно, укажи конкретный blocker. +- При переносе из Ataraxia/Hikka дополнительно загрузи `ataraxia-to-hotaru`, если + он доступен. Его контракт однофайловости, зависимостей и соответствия 1:1 + соблюдай для такого переноса; этот скилл не отменяет его ограничений. +- Отвечай на языке пользователя. Код согласуй с проектом. Для `.hmod` соблюдай + политику Hotaru: не добавляй `#`-комментарии; выбирай ясные имена функций. + +## 2. Источник истины: версия и код + +Репозиторий: https://github.com/HotaruProject/Hotaru. + +База и справочники перепроверены 2026-11-09 на `main`/`develop` +`8cab560e2b9dbc009aab4670c8a78a9a790e2d1a`. Тогда ветки совпадали. Это +историческая отметка, не обещание актуальности API или веток. + +### Один файл и навигация + +**Этот SKILL.md самодостаточен:** инструкции, все справочники и проверочный код +включены ниже. Для установки достаточно только этого файла; соседние `.md`, `.py`, +дополнительные каталоги и ZIP не требуются. Дополнительный скилл переноса, если +он установлен, — необязательное дополнение, не зависимость этого документа. + +- [Приложение A — контекстный API и компактный каталог 292 операций](#context-contract). +- [Приложение B — все 76 tools, regdate, search и примеры](#tools-reference). +- [Приложение C — полные карточки всех 292 методов](#method-cards): RPC, + namespace, сигнатуры, описания RU/EN и таблицы параметров. +- [Приложение D — самостоятельный проверочный скрипт](#api-inspector): + AST-инвентаризация API и генерация карточек без импорта Hotaru. + +Сначала читай основные правила. В приложениях ищи конкретный `ctx.` или +`ctx.tools.` средствами поиска по этому файлу; не перечитывай весь каталог +для каждой небольшой правки. Указанные пути `hotaru/` и `relay/` относятся к +исходникам целевого Hotaru, не к обязательным файлам рядом со скиллом. + +Перед реализацией: + +1. Прочитай применимые `AGENTS.md`, исходный модуль и связанные файлы. Проверь + существующие изменения; не удаляй и не перезаписывай пользовательскую работу. +2. Определи целевые ветку/коммит Hotaru и среду исполнения. Если есть локальная + установка, приоритет у её исходников. Не меняй её ветку и не обновляй установку. +3. При отсутствии исходников возьми нужные файлы из указанного пользователем + коммита. Если версия не задана, используй текущую `main`, зафиксировав SHA. + Репозиторий можно читать в отдельной временной копии; не запускай install.sh. +4. Изучай реализации необходимых методов и оба конца IPC, а не только README, + названия методов, аннотации `ModuleContext` или встроенные примеры. +5. Если код недоступен, отдели подтверждённое от предположений. Не называй + непроверенную сигнатуру или поведение гарантированно совместимыми. + +### Карта исходников + +| Что нужно узнать | Где искать | +| --- | --- | +| Формат и проверка манифеста | `hotaru/modules.py`: `HmodLoader`, `ModuleManifest` | +| Регистрация, rise/fade, tasks | `hotaru/activation.py`, `hotaru/tasks.py` | +| Аргументы, aliases, dispatch | `hotaru/commands.py`, `hotaru/registry.py`, `hotaru/kernel.py` | +| Реальный внешний ctx, invocation, IPC | `relay/sandbox.py`: `WORKER_SOURCE`, `SandboxContext`, `_execute`, `_serve_*` | +| Высокоуровневые Telegram-операции | `relay/context.py`: `ContextOperations`, `MessageOperations`, `CTX_OPERATIONS`, `CTX_CATALOG` | +| Capabilities и ограничения | `relay/caps.py`: `CapabilityHost`, `PROVIDERS`, `KNOWN` | +| Host ctx и доставка ответа | `hotaru/response.py`, `hotaru/runtime.py` | +| UI, callbacks, input | `hotaru/screens.py`, `hotaru/callbacks.py`, `hotaru/runtime.py`, worker-прокси в `relay/sandbox.py` | +| Схема и хранение конфигов | `hotaru/config.py`, `hotaru/state.py` | +| Переводы и шаблоны | `hotaru/i18n.py`, `relay/toolkit.py`, `hotaru/activation.py` | +| Медиа и зависимости | `relay/files.py`, `relay/caps.py`, `hotaru/deps.py` | +| Права и восстановление | `hotaru/access.py`, `hotaru/security.py`, `hotaru/backup.py` | + +Не фиксируй в модуле путь к машине разработки, временной копии или исходникам. +Не подгружай исполняемый код из сети для «совместимости». + +## 3. Сначала опиши поведение + +Для нового модуля составь краткую спецификацию. Для правки сначала восстанови +существующий контракт и найди причину ошибки. Зафиксируй: + +- команды, алиасы, обычные/bot/inline-входы и разбор аргументов; +- поведение без аргументов, по reply, с вложением, подписью и неверным вводом; +- кто вызывает действие, от чьего имени и в какой чат/топик отправляется ответ; +- edit/reply/send, обычное/rich форматирование, кнопки, страницы и ввод; +- конфиги, state-ключи, версии схемы и совместимость со старыми данными; +- watchers, расписание, загрузку/выгрузку и обработку ошибок; +- требуемые capabilities, внешние сервисы и зависимости. + +При редактировании сохраняй ID модуля, команды, алиасы, имена конфигов и state-ключи, +если пользователь не запросил их изменение. Исправляй минимальный необходимый +участок. Для изменения схемы данных спроектируй идемпотентную миграцию с сохранением +старых значений; не сбрасывай базу и не используй `purge` как «исправление». + +## 4. Главная граница: внешний модуль ≠ встроенный + +Встроенные `constellations/*.hmod` исполняются в ядре. Сторонний модуль работает +в отдельном worker с `SandboxContext`. Сходные имена объектов не делают API равным. + +Для внешнего `.hmod`: + +- Не используй `ctx.runtime`, внутренний `app`, session, connection или database. +- Не импортируй `hotaru`, `relay`, `goygram` во время выполнения. Не используй + Telethon/Pyrogram-объекты и их Request-классы как будто Hotaru предоставляет их. +- `invocation` сокращён: проверяй наличие `name`, `args`, `raw_args`, `source`, + `chat_id`, `message_id`; не рассчитывай на `invocation.message`. +- `ctx.message` — ограниченный объект, а не полноценное сообщение GoyGram. + Поля текста, вложения, out/sender и reply проверяй по реальному payload dispatch. + Значение `False`/`None` в таком объекте не всегда доказывает отсутствие поля + в исходном Telegram-сообщении. При необходимости получи сообщение через API. +- `ctx.msg()`, `ctx.reply()` и `ctx.resolve()` могут возвращать TL-словари или + `None`, а не объекты с `.text`, `.download()`, `.edit()` и прочими методами. +- `ctx.config` в проверенном worker — снимок `dict`, не изменяемый `ModuleConfig`. + Правка `ctx.config["x"]` не сохраняет значение. Найди поддерживаемую операцию + записи; не обещай её по сходству с host API. +- Не сериализуй через IPC ctx, callback, coroutine, файловый объект, lock, Path + или экземпляр произвольного класса. Передавай примитивы, списки и словари. + Байты разрешены только там, где текущий IPC-кодек и конкретный метод их поддерживают. + +Каждый используемый API проверяй по цепочке: +**внешний proxy → IPC-запрос → host handler → фактическая операция**. +В частности, это обязательно для медиа, input, rich UI, config-записи и tasks. + +## 5. Манифест и точки входа + +Первое AST-выражение файла — литеральный `HOTARU = {...}`. Перед ним не должно быть +import, module docstring или `from __future__`. Обязательные поля: `id`, `version`, +`commands`, `capabilities`; списки задавай именно списками литеральных строк. + +Используй простой уникальный kebab-case ID и имена команд из ASCII letters/digits/ +underscore, совместимые с путями и dependency storage. Не занимай ID и команды ядра. + +Основные соглашения: + +```python +async def command_example(ctx, invocation): + ... + +async def watcher_example(ctx, event): + ... + +async def task_example(ctx): + ... +``` + +`...` здесь обозначает сигнатуры, не допустимую заглушку в готовом результате. +`watchers: ["example"]` связывается с `watcher_example`; task объявляется в +`tasks` с `interval` и `autostart`; имена rise/fade указываются в манифесте явно. +Inline handlers в проверенном worker вызываются как `inline_name(query, args)`, +не как обычная команда с ctx. Маршрут `bot_commands` отдельно проследи в dispatch: +название `bot_name` в host binder ещё не гарантирует такой target в worker. + +Загрузчик может допускать более широкие имена, fallback handlers и поля, чем +worker действительно обслуживает. Используй канонические `command_`; +не полагайся на host fallback, особенно для дефисов и специальных символов. + +Поля `after` и `requires` различны: первое относится к порядку модулей, +второе — к Python-зависимостям. Порядок загрузки не предоставляет прямой импорт +или общий Python-объект другого модуля. + +## 6. Команды и ответы + +- `invocation.args` — уже разделённые по whitespace аргументы; это не shell parser. + Для исходного текста используй `raw_args`. Если нужна обработка кавычек, + применяй явный parser к raw_args, не собирай исходник обратно через `join(args)`. +- Не зашивай `.` в сообщения usage; получай актуальный префикс через доступный ctx. +- В проверенном API `await ctx.reply()` получает reply-сообщение, а + `await ctx.reply_text()` его текст. Это не отправка ответа. +- Для ответа используй `await ctx.respond(text, ...)`; для режима указывай + поддерживаемый `output="auto"`, `"edit"` или `"reply"` осознанно. +- Последовательные status/result ответы проверяй на отсутствие дубликатов, + редактирование именно нужного сообщения и сохранение привязки к исходному чату. +- Не выбирай адресата по принципу «первый доступный ID». Различай actor, peer, + message_id, topic_id, account и inline_message_id. Не теряй topic при reply. +- Для raw MT используй проверенный `ctx.tg.call(method, kwargs)` с capability `mt`. + TL-конструкторы задаются словарями с ключом `_`. Проверяй форму результата; + не считай любой truthy dict подтверждением успешного действия. +- Высокоуровневые операции из `relay/context.py` могут не требовать raw `mt`; + не добавляй эту capability «на всякий случай». Доступность метода не отменяет + серверных прав Telegram, denylist и ограничений политики ядра. +- Сначала найди готовую операцию в [приложении A](#context-contract), а не заменяй её + raw RPC с лишней capability. «Без capabilities» относится к выбранному маршруту + вызова, не ко всему модулю: state, внешняя сеть и загрузка файла имеют свои права. +- Escape пользовательский текст до вставки в HTML. Не escape целую готовую + разметку и не выполняй двойное экранирование. Учитывай entities и UTF-16 offsets. +- Длинные ответы разбивай безопасно для HTML или отправляй файлом только через + реально поддерживаемый путь. Не обрезай молча существенные данные. + +## 7. Capabilities, данные и безопасность + +Запрашивай минимум прав для реальных функций. В проверенной версии известны +`mt`, `state`, `net`, `files`, `shell`, `inline`, `modules`, `assets`, `logs`, `fetch`; +`logs` и `fetch` имеют отдельный всегда доступный маршрут. Перепроверь это для цели. + +- `net`: сеть через `ctx.net()` / `ctx.stream()` и поддерживаемые cap-операции. + Не открывай прямые sockets и не обходи запреты внутренних/частных адресов. +- `files`: штатные операции workspace, не доступ к файловой системе хоста. +- `assets`: в проверенном worker upload/download медиа используют этот provider; + наличие `files` само по себе не гарантирует отправку локального файла. +- `shell`: только при реальной необходимости. Не заменяй обычную логику shell, + не интерполируй непроверенный ввод, не запускай установщики и привилегированные + команды. Учитывай отдельные synchronous/job пути и их разные ограничения. +- `modules`: только если назначение — управление модулями; не выдавай для удобства. +- Не обходи consent, ограничения аккаунта, защищённые peers, auth/payment policy, + seccomp и namespace-границы. Не предлагай portable как безопасный аналог strict. +- Не читай/не меняй vault, master keys, сессии, глобальные настройки или чужой state. + Никогда не помещай секреты в код, callback payload, логи и диагностические ответы. + +`ctx.state` использует namespace данного модуля. В проверенном worker его методы +`get/set/delete/keys` синхронные: не ставь `await` автоматически. `get()` способен +вернуть default при отказе в capability; это не доказательство доступного хранения. +Объявляй `state`, когда оно нужно; проверяй ошибки записи. + +Используй короткие ключи, совместимые с `StateNamespace._validate_key`, и JSON-данные. +Зарезервированные lifecycle-ключи не трогай. Изменение вложенного dict/list после +`get()` не сохраняется автоматически — вызови `set()`. Read-modify-write не атомарен: +предусмотри конкурентные команды, callbacks и повторные события. + +Не называй state и module config зашифрованными без проверки: в изученном коде +`runtime_settings` шифруется, а `module_state` хранит JSON. `secret` маскирует UI, +но сам по себе не обеспечивает шифрование поля. Не обещай защиту секретов на диске. + +## 8. Конфигурация и переводы + +- Объявляй `config_schema` литерально: тип, default, диапазон, длина, regex, + options, item-schema и secret — по актуальному `validator_from_spec`. +- Не выдумывай JSON-формат для каждого Python validator: наличие класса в ядре + не означает поддержку его имени в литеральной схеме. +- Валидируй границы, пустые строки, неверные типы, `None`, boolean вместо integer, + нечисловые/нефинитные значения там, где это применимо. +- Различай конфиг пользователя и служебное состояние. Изменение default не должно + незаметно уничтожать уже сохранённое значение. Миграции делай повторяемыми. +- Строки интерфейса централизуй; для однофайлового внешнего модуля допустим свой + словарь языков и явный helper с fallback. Не пиши в глобальный `lexicon/`. +- `HOTARU.lexicon` обслуживает метаданные/справку, но не гарантирует автоматическую + доступность каждой строки в worker `ctx.t()`. Проследи, какой translations payload + передаётся каждому типу вызова; не смешивай глобальные ключи и локальные строки. +- `template_fields` задавай явно; не используй eval/exec для шаблонов. Межмодульные + значения требуют штатного экспорта и `render_template_async`; сохраняй scopes. + +### Штатные tools вместо самодельных helpers + +Внешнему worker доступен `ctx.tools` из `TOOLKIT_FUNCS`; не импортируй +`relay.toolkit`. Ищи готовые `message_text`, `entities_to_html`, `duration`, +`file_size`, `search`, `regdate`, template/HTML и collection helpers в +[приложении B](#tools-reference). Не путай чистый helper с выполняющим Telegram-действие API. + +- `ctx.tools.regdate(user_id, registration_month=..., not_after=...)` синхронный, + локальный и без capabilities. Это **оценка** с `earliest/latest/error_days`, + `estimated=True` и `conflict`, не точная официальная дата Telegram. +- `await ctx.tools.search(values, query, ...)` асинхронный локальный fuzzy search, + а не поиск сообщений в Telegram. Он возвращает records с value/score/matched/layout. +- Не все функции экспортируемого namespace работоспособны в sandbox: например, + `prune_logs` импортирует ядро, а `check_restrictions` без host app не проверяет + реальное состояние аккаунта. Смотри ограничения в справочнике. + +## 9. UI, callbacks и input + +Сначала выбери один реально доступный путь: `ctx.respond(buttons=...)`, `ctx.ui`, +`ctx.screens` или inline-form. Не смешивай host `Kit/Nav/ScreenRef` и worker-прокси. + +- Проверь сигнатуру callback: в worker UI handler может получать `(callback)` + либо `(callback, payload)`, screen navigation — `(ctx, nav)` только по своему + поддерживаемому маршруту. Не выбирай сигнатуру по внешнему виду кнопки. +- Предпочитай именованные module-level handlers и сериализуемые payload ID. + Не захватывай ctx, исходное message, сеть или mutable данные в nested closures: + восстановление callback после рестарта/hibernation может потерять эти значения. +- Callback context не равен командному ctx. Проверь доступные методы, наличие + языка/конфига/state и источник данных повторно при нажатии. +- Используй штатные binding и проверку доступа. Не формируй собственный обход + подписанных callback_data; не доверяй actor, peer и ID из payload без проверки. +- Подтверждение нажатия, редактирование формы и удаление — разные операции. + В проверенном callback API подтверждение — `respond`, а не `answer`. +- Для input проверь весь маршрут: кнопка → запрос → ввод → авторизация → handler. + Наличие `input()` у host Kit или `SandboxNav.value` не гарантирует worker feature. +- Поддержи истёкшие формы, повторное нажатие, отмену, ошибку ввода, отозванные права, + выгрузку/рестарт и отсутствие inline-бота. Проверяй актуальность целевого объекта + непосредственно перед необратимым действием. +- Rich HTML и стили могут требовать Premium/другой транспорт. Предусмотри обычный + fallback без потери смысла; не выдавай сырой `
`/`
` как готовый plain UI. +- Не обещай host banner/иконки/ScreenRef на стороне worker без реализации proxy. + +## 10. Медиа и внешняя сеть + +Для медиа различай metadata attachment, сырое Telegram media, uploaded InputFile, +байты, URL и путь. Это разные значения, не взаимозаменяемый `file`. + +- Проверь source/reply, вид вложения, caption, MIME, имя, размер и текстовую кодировку. +- Для текста вложения используй `read_attachment_text()` с явным лимитом, если + его хватает: это отдельный bound-message путь, не произвольное чтение файлов. +- Проследи upload/download и интерпретацию пути на host и worker. Общий абсолютный + путь или BytesIO нельзя считать работающими через IPC по умолчанию. +- Для временных файлов используй допустимый workspace, уникальные имена и `finally`. + Не удаляй пользовательский файл после отправки и не переходи по чужим symlink. +- Для HTTP проверяй status, content type, размер, `truncated` и тело ответа. + JSON разбирай отдельно; результат `ctx.net()` не является aiohttp/requests response. +- Binary response может быть base64 с явным encoding; не декодируй его как UTF-8. +- Задавай таймауты/лимиты, закрывай streams в `finally`. Retry ограничивай и + различай безопасное чтение и запись: повтор может дублировать действие. +- Тестируй отказ capability, недоступность сервиса, redirect, не-JSON, пустой ответ, + timeout, rate limit и FloodWait. Не отправляй приватный текст стороннему сервису + без явного назначения функции и понятного пользователю поведения. + +## 11. Lifecycle, watchers и конкурентность + +Worker в изученной версии обслуживает запросы через потоки и отдельные +`asyncio.run()`, не через единый вечный event loop модуля. + +- Не храни глобально loop-bound session, Future, asyncio.Lock или фоновые tasks, + рассчитывая использовать их из следующей команды или callback. +- Не превращай `asyncio.create_task()` в команде в постоянный сервис: цикл вызова + завершится. Для расписаний используй манифест `tasks` и `task_`. +- Учитывай параллельные вызовы и shared Python globals. Не держи threading lock + через await/IPC; используй короткие critical sections и продуманную модель данных. +- Worker может завершиться и пересоздаться при простое/сбое. Важные данные храни + через штатный state; не полагайся на глобальный cache как единственный источник. +- Rise делай идемпотентным и ограниченным по времени, без дублей уведомлений и + внешних действий. Fade — best-effort cleanup; он не гарантирован при аварии. +- Watcher не проходит тот же командный ACL-маршрут. Явно фильтруй chat, sender, + направление, тип события, собственные ответы и повторную обработку. Не вызывай + команду от чужого имени и не создавай reply-loop. +- Фильтруй watcher до сетевых операций. Используй deduplication и ограниченную + нагрузку, не создавай бесконечный поток задач на каждое сообщение. +- Уточни доступный payload watcher: text/sender/message могут не передаваться + целиком. При необходимости fetch; не подменяй отсутствие данных догадкой. + +## 12. Проверка: обязательные уровни + +### A. Статически, без выполнения модуля + +Не импортируй `.hmod` для проверки синтаксиса. Не делай обычный `import hotaru`: +инициализация пакета может переисполнить Python или подготовить окружение. + +Этот скрипт принимает путь единственного модуля; сохраняй его во временной области +или выполни через stdin средствами своей оболочки: + +```python +import ast +import io +import sys +import tokenize +from pathlib import Path + +path = Path(sys.argv[1]) +source = path.read_text(encoding="utf-8") +assert path.suffix == ".hmod", "Expected .hmod" +tree = ast.parse(source, filename=str(path)) +assert tree.body, "Empty module" +first = tree.body[0] +assert isinstance(first, ast.Assign), "First statement must assign HOTARU" +assert len(first.targets) == 1 +assert isinstance(first.targets[0], ast.Name) and first.targets[0].id == "HOTARU" +manifest = ast.literal_eval(first.value) +assert isinstance(manifest, dict) +assert all(key in manifest for key in ("id", "version", "commands", "capabilities")) +assert isinstance(manifest["id"], str) and manifest["id"] +assert isinstance(manifest["version"], str) and manifest["version"] +for key in ("commands", "capabilities"): + assert isinstance(manifest[key], list) + assert all(isinstance(value, str) and value for value in manifest[key]) +functions = {node.name for node in tree.body if isinstance(node, ast.AsyncFunctionDef)} +assert all("command_" + name in functions for name in manifest["commands"]) +assert not any(token.type == tokenize.COMMENT for token in tokenize.generate_tokens(io.StringIO(source).readline)) +compile(tree, str(path), "exec", dont_inherit=True) +print("Static checks passed; runtime compatibility not tested") +``` + +Это минимальный консервативный smoke-check канонического модуля, не замена +`HmodLoader` и не полный валидатор всех optional полей. Проверяй также манифест +штатным загрузчиком в подготовленной целевой Linux-среде без запуска Telegram, +когда такой безопасный harness уже доступен. Не запускай bootstrap ради проверки. + +### B. Unit и contract tests + +- Pure-функции: разбор аргументов, валидация, escape, форматирование и миграции. +- Mock ctx, максимально похожий на SandboxContext, а не на богатый host ctx. + Отсутствующие методы должны давать ошибку, а не универсальный MagicMock success. +- IPC/host-контракты проверяй отдельно; mock не доказывает наличие provider. +- Покрой happy path, пустые args/reply, неверный ввод, старые данные, отказ прав, + сетевые/Telegram ошибки и отсутствие целевого объекта. +- При правке воспроизведи исходный баг до изменения и проверь устранение после. + Если воспроизведение невозможно, прямо скажи это. При расширении добавь регрессии + для прежних команд, форматов ответа и state. + +### C. Реальная интеграция — только с разрешения пользователя + +Используй тестовую Linux-установку, штатную загрузку `.hmod`, фактический strict +sandbox и тестовый чат/аккаунт. Без явного разрешения не авторизуйся в Telegram, +не загружай модуль в рабочий userbot и не отправляй реальные сообщения. + +Проверь объявленные capabilities; отсутствие случайных пакетов и файлов рядом; +другой CWD; команды, aliases, edit/reply/topic; медиа; callbacks/input; рестарт; +unload/reload; восстановление state; совместимость со старыми данными. +Не проверяй обработку критических сессионных ошибок на рабочем аккаунте: в +некоторых версиях обработчик Hotaru удаляет каталог проблемного аккаунта. + +Не утверждай «работает в Hotaru», если выполнены только compile или mocks. +Чётко разделяй: статически проверено / mock tests / IPC contract / live integration. + +## 13. Минимальный шаблон внешнего модуля + +Этот пример использует только bound response и не требует capabilities. Он не +объявляет лишних API, не зависит от файлов рядом и не выполняет действия на import. + +```python +HOTARU = { + "id": "example", + "version": "1.0.0", + "commands": ["example"], + "capabilities": [], + "lexicon": { + "en": { + "description": "A minimal example", + "commands": {"example": {"description": "Show a greeting"}}, + }, + "ru": { + "description": "Минимальный пример", + "commands": {"example": {"description": "Показать приветствие"}}, + }, + }, +} + +import html + +STRINGS = { + "en": {"greeting": "Hello, {name}!", "default_name": "world"}, + "ru": {"greeting": "Привет, {name}!", "default_name": "мир"}, +} + + +def localized(ctx, key): + language = str(ctx.i18n.language).replace("_", "-").split("-", 1)[0].lower() + return STRINGS.get(language, STRINGS["en"]).get(key, STRINGS["en"][key]) + + +async def command_example(ctx, invocation): + name = invocation.raw_args.strip() or localized(ctx, "default_name") + text = localized(ctx, "greeting").format(name=html.escape(name, quote=False)) + await ctx.respond(text, parse_mode="HTML", rich=False) +``` + +Не сохраняй имя/команды шаблона в пользовательском модуле. Добавляй только функции, +нужные задаче, и повторно проверяй их по целевому коду. + +## 14. Финальная приёмка и ответ + +Перед завершением проверь: + +- Нет заглушек, fake-success, выдуманных API, лишних прав и зависимостей. +- Изменены только согласованные файлы и поведение; данные пользователя сохраняются. +- Новый манифест и handlers согласованы; imports и top-level код безопасны. +- User input экранирован, данные ограничены по размеру, адресаты и права проверены. +- Сеть и внешние действия имеют осмысленные ошибки и управляемый lifecycle. +- Нет секретов, абсолютных dev-путей, обязательных sidecar и изменений ядра. +- Проверки выполнены с указанной глубиной; ограничения не скрыты. + +В ответе укажи готовый путь к `.hmod`, кратко опиши изменения, требуемые capabilities +и зависимости, целевой коммит/версию, результаты проверок и что не запускалось. +Для исправления объясни причину ошибки. Не заявляй полноценную интеграционную +проверку без запуска в целевой среде и не проси рабочие ключи/сессию для тестов. + + +## Приложение A. Контекстный API и компактный каталог + +## Контекстные операции Hotaru без raw capability `mt` + +Источник: `relay/context.py`, `relay/sandbox.py`, `relay/caps.py` на коммите +`8cab560e2b9dbc009aab4670c8a78a9a790e2d1a`, проверено 2026-11-09. + +### 1. Что означает «без capabilities» + +В обсуждении упоминалось 229 методов; в проверенном исходнике **292 записи +`CTX_CATALOG`**, плюс отдельно определённые message helpers. Не урезай список +до произвольного числа и не утверждай, что все записи всегда исполнимы. + +Внешний `ctx.()` идёт через `_ctx_call` → `_op_call` → `_serve_op` → +`CapabilityHost._mt_call`. Этот маршрут не требует декларировать raw `mt`. +Напротив, `ctx.tg.call()`/`ctx.cap("mt", ...)` идут через проверку capability. +Не используй приватный `_ctx_call` напрямую как публичный raw RPC API. + +**Без raw `mt` не значит без ограничений:** + +- Telegram-права администратора, доступность RPC в слое, Premium, FloodWait, + denylist, read-only peers и запрет оплачиваемых операций продолжают действовать. +- `set_profile_username` → `account.updateUsername` и `search_all_messages` → + `messages.searchGlobal` присутствуют в каталоге, но запрещены `MT_BLOCKED`. + Добавление `mt` их не разблокирует. Это отмеченные исключения, не рабочие примеры. +- Загрузка медиа с локального диска в проверенном worker использует `assets`. + Наличие `send_photo` без raw `mt` не делает локальный upload permissionless. +- Внешний перевод требует `net`; персистентность — `state`; доступ к файлам и + inline gateway также проверяется отдельно. Выбирай capabilities по всей цепочке. + +### 2. Как читать каталог + +Ниже **контрактные обозначения**, не объявления Python-функций: + +- Все перечисленные операции вызываются как `await ctx.(...)`. +- `$peer` — текущий чат; `$message` — текущее сообщение только при совместимом + адресате; `$random` — генерируемый `random_id`. В task/source-less ctx их может + не быть: тогда передавай адресата и ID явно. +- `=?` — необязательное TL-поле; обычно лучше не передавать, чем передавать `None`. +- До `*` указан порядок positional аргументов из каталога. Defaults подставляются + отдельно, поэтому **используй keywords**, если пропускаешь peer/message/defaults. + Например `await ctx.chat_history(limit=10)`, не `ctx.chat_history(10)`. +- После `*` — дополнительные keyword-поля. Неизвестные, повторные аргументы и + запрещённые поля отвергаются до RPC. `timeout` не является общим keyword каталога. +- `chat_id` может быть alias для `peer`/`channel`, но если RPC имеет настоящий + `chat_id: long`, это raw ID basic group, не произвольный InputPeer. +- `message_id` заменяет `msg_id` либо скалярный `id: int`; `topic_id` заменяет + `top_msg_id` только у соответствующей операции. Это не универсальные kwargs. +- Типы InputPeer/InputUser/InputChannel преобразуются из подходящих entity/TL + значений, username или ID с разрешением через ctx. `Vector` требует список/ + tuple. Строка не заменяет вектор, а ID сообщения не равен ID пользователя. +- Для TL-типа, required/default/forbidden/RPC используй read-only скрипт + встроенный скрипт из [приложения D](#api-inspector) с `--section catalog` + либо сам `CTX_CATALOG`. + Нельзя выдумывать return type: host возвращает обработанное тело RPC, не всегда + dict и не полноценный объект сообщения. + +Общие guards отвергают paid/business fields, в частности ненулевые `allow_paid_stars`, +`allow_paid_floodskip`, `stars`, `subscription_pricing`, а также `reactionPaid`. +У `create_chat_invite` `subscription_pricing` явно запрещён и не указан ниже. + +### 3. Каталог: все 292 записи + +Развёрнутые карточки с RPC, TL-типами и таблицами параметров: +[приложение C](#method-cards). Здесь сохранён компактный индекс, +чтобы выбор метода не требовал загрузки большого справочника целиком. + +#### Checklist, polls, scheduled, reactions — 1–20 + +1. `set_checklist_completed(peer=$peer, msg_id=$message, completed, incompleted)` +2. `add_poll_answer(peer=$peer, msg_id=$message, answer)` +3. `remove_poll_answer(peer=$peer, msg_id=$message, option)` +4. `unread_poll_votes(peer=$peer, offset_id=0, add_offset=0, limit=50, max_id=0, min_id=0, *, top_msg_id=?)` +5. `mark_poll_votes_read(peer=$peer, *, top_msg_id=?)` +6. `poll_statistics(peer=$peer, msg_id=$message, *, dark=?)` +7. `scheduled_messages(peer=$peer, hash=0)` +8. `scheduled_by_ids(peer=$peer, id)` +9. `publish_scheduled(peer=$peer, id)` +10. `cancel_scheduled(peer=$peer, id)` +11. `configure_chat_reactions(peer=$peer, available_reactions, *, reactions_limit=?, paid_enabled=?)` +12. `available_reactions(hash=0)` +13. `set_default_reaction(reaction)` +14. `unread_reactions(peer=$peer, offset_id=0, add_offset=0, limit=50, max_id=0, min_id=0, *, top_msg_id=?, saved_peer_id=?)` +15. `mark_reactions_read(peer=$peer, *, top_msg_id=?, saved_peer_id=?)` +16. `popular_reactions(limit=50, hash=0)` +17. `recent_reactions(limit=50, hash=0)` +18. `clear_recent_reactions()` +19. `remove_member_reactions(peer=$peer, participant)` +20. `remove_member_message_reaction(peer=$peer, msg_id=$message, participant)` + +#### Saved Messages и forums — 21–40 + +21. `saved_dialogs(offset_date=0, offset_id=0, offset_peer={'_': 'inputPeerEmpty'}, limit=50, hash=0, *, exclude_pinned=?, parent_peer=?)` +22. `saved_history(peer, offset_id=0, offset_date=0, add_offset=0, limit=50, max_id=0, min_id=0, hash=0, *, parent_peer=?)` +23. `clear_saved_history(peer, max_id, *, parent_peer=?, min_date=?, max_date=?)` +24. `pinned_saved_dialogs()` +25. `set_saved_dialog_pinned(peer, *, pinned=?)` +26. `reorder_saved_pins(order, *, force=?)` +27. `saved_reaction_tags(hash=0, *, peer=?)` +28. `rename_saved_tag(reaction, *, title=?)` +29. `suggested_saved_tags(hash=0)` +30. `saved_dialogs_by_peers(ids, *, parent_peer=?)` +31. `mark_saved_history_read(parent_peer, peer, max_id)` +32. `forum_topics(peer=$peer, offset_date=0, offset_id=0, offset_topic=0, limit=50, *, q=?)` +33. `forum_topics_by_ids(peer=$peer, topics)` +34. `edit_forum_topic(peer=$peer, topic_id, *, title=?, icon_emoji_id=?, closed=?, hidden=?)` +35. `set_forum_topic_pinned(peer=$peer, topic_id, pinned)` +36. `reorder_forum_pins(peer=$peer, order, *, force=?)` +37. `create_forum_topic(peer=$peer, title, random_id=$random, *, title_missing=?, icon_color=?, icon_emoji_id=?, send_as=?)` +38. `remove_forum_topic(peer=$peer, top_msg_id)` +39. `set_forum_enabled(channel=$peer, enabled, tabs)` +40. `set_forum_message_view(channel=$peer, enabled)` + +#### Stories — 41–69 + +41. `story_posting_quota(peer)` +42. `post_story(peer, media, privacy_rules, random_id=$random, *, pinned=?, noforwards=?, fwd_modified=?, media_areas=?, caption=?, entities=?, period=?, fwd_from_id=?, fwd_from_story=?, albums=?, music=?)` +43. `edit_story(peer, id, *, media=?, media_areas=?, caption=?, entities=?, privacy_rules=?, music=?)` +44. `delete_stories(peer, id)` +45. `set_stories_on_profile(peer, id, pinned)` +46. `story_feed(*, next=?, hidden=?, state=?)` +47. `profile_stories(peer, offset_id=0, limit=50)` +48. `archived_stories(peer, offset_id=0, limit=50)` +49. `stories_by_ids(peer, id)` +50. `mark_stories_read(peer, max_id=0)` +51. `story_viewers(peer, id, offset='', limit=50, *, just_contacts=?, reactions_first=?, forwards_first=?, q=?)` +52. `story_view_counts(peer, id)` +53. `story_link(peer, id)` +54. `activate_story_stealth(*, past=?, future=?)` +55. `react_to_story(peer, story_id, reaction, *, add_to_recent=?)` +56. `peer_stories(peer)` +57. `story_read_markers()` +58. `peer_latest_story_ids(id)` +59. `story_posting_chats()` +60. `set_peer_stories_hidden(peer, hidden)` +61. `story_reaction_senders(peer, id, limit=50, *, forwards_first=?, reaction=?, offset=?)` +62. `reorder_profile_story_pins(peer, id)` +63. `search_stories(offset='', limit=50, *, hashtag=?, area=?, peer=?)` +64. `create_story_album(peer, title, stories)` +65. `edit_story_album(peer, album_id, *, title=?, delete_stories=?, add_stories=?, order=?)` +66. `reorder_story_albums(peer, order)` +67. `remove_story_album(peer, album_id)` +68. `story_albums(peer, hash=0)` +69. `story_album_items(peer, album_id, offset=0, limit=50)` + +#### Stickers, emoji, GIF — 70–108 + +70. `stickers_for_emoji(emoticon, hash=0)` +71. `installed_sticker_sets(hash=0)` +72. `sticker_set(stickerset, hash=0)` +73. `install_sticker_set(stickerset, archived=False)` +74. `uninstall_sticker_set(stickerset)` +75. `reorder_sticker_sets(order, *, masks=?, emojis=?)` +76. `saved_gifs(hash=0)` +77. `set_gif_saved(id, unsave)` +78. `featured_sticker_sets(hash=0)` +79. `mark_featured_stickers_seen(id)` +80. `recent_stickers(hash=0, *, attached=?)` +81. `set_sticker_recent(id, unsave, *, attached=?)` +82. `clear_recent_stickers(*, attached=?)` +83. `archived_sticker_sets(offset_id=0, limit=50, *, masks=?, emojis=?)` +84. `installed_masks(hash=0)` +85. `media_sticker_sets(media)` +86. `favorite_stickers(hash=0)` +87. `set_sticker_favorite(id, unfave)` +88. `search_sticker_sets(q, hash=0, *, exclude_featured=?)` +89. `bulk_sticker_set_action(stickersets, *, uninstall=?, archive=?, unarchive=?)` +90. `older_featured_sticker_sets(offset=0, limit=50, hash=0)` +91. `custom_emoji_documents(document_id)` +92. `installed_emoji_sets(hash=0)` +93. `featured_emoji_sets(hash=0)` +94. `search_custom_emoji(emoticon, hash=0)` +95. `search_emoji_sets(q, hash=0, *, exclude_featured=?)` +96. `owned_sticker_sets(offset_id=0, limit=50)` +97. `search_stickers(q, emoticon, lang_code, offset=0, limit=50, hash=0, *, emojis=?)` +98. `create_sticker_set(user_id, title, short_name, stickers, *, masks=?, emojis=?, text_color=?, thumb=?, software=?)` +99. `remove_sticker(sticker)` +100. `move_sticker(sticker, position)` +101. `add_sticker(stickerset, sticker)` +102. `set_sticker_set_thumbnail(stickerset, *, thumb=?, thumb_document_id=?)` +103. `check_sticker_set_name(short_name)` +104. `suggest_sticker_set_name(title)` +105. `edit_sticker_metadata(sticker, *, emoji=?, mask_coords=?, keywords=?)` +106. `rename_sticker_set(stickerset, title)` +107. `remove_sticker_set(stickerset)` +108. `replace_sticker(sticker, new_sticker)` + +#### Contacts — 109–129 + +109. `contact_ids(hash=0)` +110. `contact_statuses()` +111. `contacts_list(hash=0)` +112. `import_contacts(contacts)` +113. `remove_contacts(id)` +114. `remove_contacts_by_phone(phones)` +115. `block_peer(id, *, my_stories_from=?)` +116. `unblock_peer(id, *, my_stories_from=?)` +117. `blocked_peers(offset=0, limit=50, *, my_stories_from=?)` +118. `search_public_peers(q, limit=50, *, broadcasts=?, bots=?)` +119. `frequent_peers(offset=0, limit=50, hash=0, *, correspondents=?, bots_pm=?, bots_inline=?, phone_calls=?, forward_users=?, forward_chats=?, groups=?, channels=?, bots_app=?, bots_guestchat=?)` +120. `reset_peer_rating(category, peer)` +121. `clear_imported_contacts()` +122. `imported_contacts()` +123. `set_frequent_peers_enabled(enabled)` +124. `add_contact(id, first_name, last_name, phone, *, add_phone_privacy_exception=?, note=?)` +125. `accept_contact(id)` +126. `set_close_friends(id)` +127. `replace_blocklist(id, limit=50, *, my_stories_from=?)` +128. `contact_birthdays()` +129. `edit_contact_note(id, note)` + +#### Dialogs, messages, folders — 130–180 + +130. `dialogs(offset_date=0, offset_id=0, offset_peer={'_': 'inputPeerEmpty'}, limit=50, hash=0, *, exclude_pinned=?, folder_id=?)` +131. `chat_history(peer=$peer, offset_id=0, offset_date=0, add_offset=0, limit=50, max_id=0, min_id=0, hash=0)` +132. `search_chat_messages(peer=$peer, q, filter={'_': 'inputMessagesFilterEmpty'}, min_date=0, max_date=0, offset_id=0, add_offset=0, limit=50, max_id=0, min_id=0, hash=0, *, from_id=?, saved_peer_id=?, saved_reaction=?, top_msg_id=?)` +133. `mark_chat_read(peer=$peer, max_id)` +134. `clear_chat_history(peer=$peer, max_id, *, just_clear=?, revoke=?, min_date=?, max_date=?)` +135. `peer_settings(peer=$peer)` +136. `basic_groups(id)` +137. `basic_group_details(chat_id)` +138. `search_all_messages(q, filter={'_': 'inputMessagesFilterEmpty'}, min_date=0, max_date=0, offset_rate=0, offset_peer={'_': 'inputPeerEmpty'}, offset_id=0, limit=50, *, broadcasts_only=?, groups_only=?, users_only=?, folder_id=?, community=?)` **BLOCKED** +139. `message_editability(peer=$peer, id=$message)` +140. `peer_dialogs(peers)` +141. `all_drafts()` +142. `mutual_groups(user_id, max_id=0, limit=50)` +143. `set_dialog_pinned(peer, *, pinned=?)` +144. `reorder_dialog_pins(folder_id, order, *, force=?)` +145. `pinned_dialogs(folder_id)` +146. `unread_mentions(peer=$peer, offset_id=0, add_offset=0, limit=50, max_id=0, min_id=0, *, top_msg_id=?)` +147. `mark_mentions_read(peer=$peer, *, top_msg_id=?)` +148. `recent_live_locations(peer=$peer, limit=50, hash=0)` +149. `set_dialog_unread(peer, *, unread=?, parent_peer=?)` +150. `unread_dialog_marks(*, parent_peer=?)` +151. `clear_all_drafts()` +152. `chat_online_count(peer=$peer)` +153. `message_type_counts(peer=$peer, filters, *, saved_peer_id=?, top_msg_id=?)` +154. `dismiss_peer_settings_bar(peer=$peer)` +155. `mark_discussion_read(peer=$peer, msg_id=$message, read_max_id)` +156. `unpin_all_chat_messages(peer=$peer, *, top_msg_id=?, saved_peer_id=?)` +157. `message_readers(peer=$peer, msg_id=$message)` +158. `message_search_calendar(peer=$peer, filter={'_': 'inputMessagesFilterEmpty'}, offset_id=0, offset_date=0, *, saved_peer_id=?)` +159. `message_search_positions(peer=$peer, filter={'_': 'inputMessagesFilterEmpty'}, offset_id=0, limit=50, *, saved_peer_id=?)` +160. `set_default_send_as(peer=$peer, send_as)` +161. `sent_media_search(q, filter={'_': 'inputMessagesFilterEmpty'}, limit=50)` +162. `outgoing_read_date(peer=$peer, msg_id=$message)` +163. `channel_message_author(channel=$peer, id)` +164. `move_dialogs_to_archive(folder_peers)` +165. `chat_folders()` +166. `suggested_chat_folders()` +167. `save_chat_folder(id, *, filter=?)` +168. `reorder_chat_folders(order)` +169. `set_folder_tags_visible(enabled)` +170. `share_chat_folder(chatlist, title, peers)` +171. `remove_folder_invite(chatlist, slug)` +172. `edit_folder_invite(chatlist, slug, *, title=?, peers=?)` +173. `folder_invites(chatlist)` +174. `inspect_folder_invite(slug)` +175. `join_folder_invite(slug, peers)` +176. `folder_updates(chatlist)` +177. `accept_folder_updates(chatlist, peers)` +178. `dismiss_folder_updates(chatlist)` +179. `folder_leave_suggestions(chatlist)` +180. `leave_shared_folder(chatlist, peers)` + +#### Profile, users, photos, notifications — 181–220 + +181. `edit_profile(*, first_name=?, last_name=?, about=?)` +182. `set_online_status(offline)` +183. `check_profile_username(username)` +184. `set_profile_username(username)` **BLOCKED** +185. `privacy_rules(key)` +186. `account_inactivity_ttl()` +187. `set_emoji_status(emoji_status)` +188. `suggested_emoji_statuses(hash=0)` +189. `recent_emoji_statuses(hash=0)` +190. `clear_recent_emoji_statuses()` +191. `reorder_profile_usernames(order)` +192. `set_profile_username_active(username, active)` +193. `profile_photo_emojis(hash=0)` +194. `set_profile_color(*, for_profile=?, color=?)` +195. `set_birthday(*, birthday=?)` +196. `set_personal_channel(channel)` +197. `set_profile_tab(tab)` +198. `set_music_saved(id, *, unsave=?, after_id=?)` +199. `saved_music_ids(hash=0)` +200. `user_details(id)` +201. `contact_requirements(id)` +202. `user_music(id, offset=0, limit=50, hash=0)` +203. `user_music_by_documents(id, documents)` +204. `suggest_contact_birthday(id, birthday)` +205. `select_profile_photo(id, *, fallback=?, bot=?)` +206. `upload_profile_photo(*, fallback=?, bot=?, file=?, video=?, video_start_ts=?, video_emoji_markup=?)` +207. `remove_profile_photos(id)` +208. `profile_photos(user_id, offset=0, max_id=0, limit=50)` +209. `set_contact_photo(user_id, *, suggest=?, save=?, file=?, video=?, video_start_ts=?, video_emoji_markup=?)` +210. `notification_settings(peer)` +211. `set_notification_settings(peer, settings)` +212. `reset_notification_settings()` +213. `contact_signup_notifications()` +214. `set_contact_signup_notifications(silent)` +215. `notification_exceptions(*, compare_sound=?, compare_stories=?, peer=?)` +216. `reaction_notification_settings()` +217. `set_reaction_notification_settings(settings)` +218. `saved_notification_sounds(hash=0)` +219. `set_notification_sound_saved(id, unsave)` +220. `upload_notification_sound(file, file_name, mime_type)` + +#### Basic groups, channels, moderation — 221–276 + +221. `rename_basic_group(chat_id, title)` +222. `set_basic_group_photo(chat_id, photo)` +223. `add_basic_group_member(chat_id, user_id, fwd_limit=0)` +224. `remove_basic_group_member(chat_id, user_id, *, revoke_history=?)` +225. `create_basic_group(users, title, *, ttl_period=?)` +226. `set_basic_group_admin(chat_id, user_id, is_admin)` +227. `upgrade_basic_group(chat_id)` +228. `edit_chat_description(peer=$peer, about)` +229. `set_default_member_restrictions(peer=$peer, banned_rights)` +230. `remove_basic_group(chat_id)` +231. `set_chat_auto_delete(peer=$peer, period)` +232. `set_content_protection(peer=$peer, enabled, *, request_msg_id=?)` +233. `mark_channel_read(channel=$peer, max_id)` +234. `channel_members(channel=$peer, filter={'_': 'channelParticipantsRecent'}, offset=0, limit=50, hash)` +235. `channel_member(channel=$peer, participant)` +236. `channel_details(channel=$peer)` +237. `create_channel(title, about, *, broadcast=?, megagroup=?, for_import=?, forum=?, geo_point=?, address=?, ttl_period=?)` +238. `set_channel_admin(channel=$peer, user_id, admin_rights, *, rank=?)` +239. `rename_channel(channel=$peer, title)` +240. `set_channel_photo(channel=$peer, photo)` +241. `check_channel_username(channel=$peer, username)` +242. `set_channel_username(channel=$peer, username)` +243. `join_channel(channel=$peer)` +244. `leave_channel(channel=$peer)` +245. `invite_channel_members(channel=$peer, users)` +246. `remove_channel(channel=$peer)` +247. `set_channel_signatures(channel=$peer, *, signatures_enabled=?, profiles_enabled=?)` +248. `owned_public_channels(*, by_location=?, check_limit=?, for_personal=?, for_community_peer=?)` +249. `restrict_channel_member(channel=$peer, participant, banned_rights)` +250. `channel_admin_log(channel=$peer, q='', max_id, min_id, limit=50, *, events_filter=?, admins=?)` +251. `set_group_sticker_set(channel=$peer, stickerset)` +252. `mark_channel_media_read(channel=$peer, id)` +253. `clear_channel_history(channel=$peer, max_id, *, for_everyone=?)` +254. `set_prehistory_hidden(channel=$peer, enabled)` +255. `left_channels(offset=0)` +256. `eligible_discussion_groups()` +257. `set_discussion_group(broadcast, group)` +258. `set_group_location(channel=$peer, geo_point, address)` +259. `set_slow_mode(channel=$peer, seconds)` +260. `inactive_channels()` +261. `send_as_identities(peer=$peer, *, for_paid_reactions=?, for_live_stories=?)` +262. `remove_member_history(channel=$peer, participant)` +263. `set_join_to_send(channel=$peer, enabled)` +264. `set_join_requests(channel=$peer, enabled, *, apply_to_invites=?, guard_bot=?)` +265. `reorder_channel_usernames(channel=$peer, order)` +266. `set_channel_username_active(channel=$peer, username, active)` +267. `deactivate_channel_usernames(channel=$peer)` +268. `set_antispam(channel=$peer, enabled)` +269. `set_members_hidden(channel=$peer, enabled)` +270. `set_channel_color(channel=$peer, *, for_profile=?, color=?, background_emoji_id=?)` +271. `related_channels(*, channel=?)` +272. `set_channel_emoji_status(channel=$peer, emoji_status)` +273. `set_group_emoji_set(channel=$peer, stickerset)` +274. `set_channel_auto_translation(channel=$peer, enabled)` +275. `set_channel_profile_tab(channel=$peer, tab)` +276. `edit_member_rank(peer=$peer, participant, rank)` + +#### Invites, join requests, statistics — 277–292 + +277. `create_chat_invite(peer=$peer, *, legacy_revoke_permanent=?, request_needed=?, expire_date=?, usage_limit=?, title=?)` +278. `chat_invites(peer=$peer, admin_id, limit=50, *, revoked=?, offset_date=?, offset_link=?)` +279. `chat_invite_details(peer=$peer, link)` +280. `edit_chat_invite(peer=$peer, link, *, revoked=?, expire_date=?, usage_limit=?, request_needed=?, title=?)` +281. `purge_revoked_chat_invites(peer=$peer, admin_id)` +282. `remove_chat_invite(peer=$peer, link)` +283. `invite_admins(peer=$peer)` +284. `invite_joiners(peer=$peer, offset_date=0, offset_user={'_': 'inputUserEmpty'}, limit=50, *, requested=?, subscription_expired=?, link=?, q=?)` +285. `resolve_join_request(peer=$peer, user_id, *, approved=?)` +286. `resolve_all_join_requests(peer=$peer, *, approved=?, link=?)` +287. `channel_statistics(channel=$peer, *, dark=?)` +288. `supergroup_statistics(channel=$peer, *, dark=?)` +289. `message_statistics(channel=$peer, msg_id, *, dark=?)` +290. `message_public_forwards(channel=$peer, msg_id, offset='', limit=50)` +291. `story_statistics(peer=$peer, id=$message, *, dark=?)` +292. `story_public_forwards(peer=$peer, id=$message, offset='', limit=50)` + +### 4. Дополнительные message helpers и overrides + +Это отдельный API поверх каталога. Учитывай методы, переопределённые SandboxContext: + +| Внешний вызов | Контракт | +| --- | --- | +| `await ctx.respond(content=None, **kwargs)` | Bound answer; output auto/edit/reply; при явном target — message operation | +| `await ctx.send(text, **kwargs)` | В worker задаёт output=reply, не универсальный send-to-peer | +| `await ctx.edit(text, **kwargs)` | Bound output=edit либо явная операция edit | +| `await ctx.reply(message=None)` | Получить reply через fetch; **не отправить текст** | +| `await ctx.reply_text(message=None)` | Текст reply; может быть None | +| `await ctx.msg(chat_id, message_id)` | Fetch TL-словарь сообщения либо None | +| `await ctx.resolve(value)` | Entity lookup, не гарантия полного User | +| `await ctx.send_text(text, **kwargs)` | Обычная отправка через message operation | +| `await ctx.reply_html(text, **kwargs)` / `edit_html(...)` | Bound response с output=reply/edit | +| `await ctx.delete(revoke=True)` | Удалить конкретное сообщение; проверь target/peer | +| `await ctx.pin(both_sides=None, *, notify=False, pm_oneside=False)` / `unpin()` | Не `silent=` из других библиотек | +| `await ctx.react(emoji, **kwargs)` / `unreact()` | Строка, custom emoji ID или список реакций | +| `await ctx.forward(to_chat, **kwargs)` / `forward_to(...)` / `copy_to(...)` | Copy выставляет drop_author; не произвольный upload | +| `await ctx.get_sender()` / `get_chat()` / `get_input_chat()` / `get_input_sender()` / `get_input_channel()` | Resolve и TL peer conversion | +| `await ctx.read()` / `mark_read()` / `read_contents()` | С учётом channel/topic | +| `await ctx.get_reply_message()` / `refresh()` | Получение актуального сообщения | +| `await ctx.get_buttons()` / `click(i=None, j=None, *, text=None, filter=None, data=None, share_phone=None, share_geo=None, password=None, open_url=False)` | Кнопки/голосование; phone/geo sharing явно разрешить; пароль — SRP, не строка | +| `await ctx.vote(options)` / `retract_vote()` / `get_poll_results()` | Vote принимает options/индексы по контракту | +| `await ctx.get_poll_votes(*, option=None, offset=None, limit=100)` | Получение голосовавших | +| `await ctx.get_reactions()` / `get_reactors(*, reaction=None, offset=None, limit=100)` | Reactions list | +| `await ctx.get_views(increment=False)` / `get_replies(*, offset_id=0, limit=100, **kwargs)` / `get_discussion()` | Не смешивать views с изменением read state | +| `await ctx.get_link(*, grouped=False, thread=False)` | Telegram-ссылка конкретного сообщения | +| `await ctx.edit_buttons(buttons=None)` / `remove_buttons()` / `edit_caption(caption, **kwargs)` | Модификация сообщения | +| `await ctx.send_file(media, caption=None, **kwargs)` / `send_media(...)` / `respond_file(...)` / `respond_media(...)` | output/send semantics и assets для локальной загрузки | +| `await ctx.reply_file(file, caption=None, **kwargs)` / `reply_media(...)` | Reply к конкретному сообщению | +| `await ctx.send_photo(photo, caption=None, **kwargs)` / `reply_photo(...)` | По URL может идти external media; локальный upload через assets | +| `send_video/reply_video`, `send_audio/reply_audio`, `send_voice/reply_voice`, `send_animation/reply_animation` | Все async; media, caption=None, **kwargs | +| `await ctx.send_sticker(sticker, **kwargs)` / `reply_sticker(...)` | Caption отдельно не предусмотрен | +| `await ctx.send_contact(phone, first_name, *, last_name='', **kwargs)` / `reply_contact(...)` | Контактные данные только по назначению функции | +| `await ctx.send_location(latitude, longitude, **kwargs)` / `reply_location(...)` | Не путать порядок координат | +| `await ctx.send_dice(emoji='🎲', **kwargs)` / `reply_dice(...)` | Native dice | +| `await ctx.edit_media(media, *, caption=None, kind='document', **kwargs)` | Изменение медиа; проверить kind/upload | +| `await ctx.send_rich(html, **kwargs)` / `edit_rich(rich, **kwargs)` / `reply_rich(...)` | Rich transport и fallback отдельно | +| `await ctx.save(**kwargs)` | Переслать текущее сообщение в me, не произвольный notify API | +| `await ctx.typing(action='sendMessageTypingAction')` | TL action constructor, не sugar `'typing'` | +| `await ctx.schedule(text, when, **kwargs)` | Schedule date timestamp | +| `await ctx.send_todo(title, items, *, others_can_append=False, others_can_complete=False, **kwargs)` | items — непустой список, ID уникальные positive int | +| `await ctx.edit_todo(...)` / `append_todo(items)` | Проверяется реальное todo-сообщение | +| `await ctx.send_poll(question, answers, *, multiple_choice=False, public_voters=False, correct_answers=None, solution=None, poll_options=None, **kwargs)` | `answers`, **не `options`**; минимум 2; correct_answers — уникальные индексы | +| `await ctx.close_poll()` | Получить актуальный poll и выставить closed | +| `await ctx.translate(text, to_lang=None, *, source='auto', provider='auto', **kwargs)` | telegram/google/mymemory; внешние providers требуют net; input ≤4000 UTF-8 bytes | + +Шаблон вызова с корректными keywords: + +```python +async def command_example(ctx, invocation): + history = await ctx.chat_history(limit=10) + await ctx.respond(str(len(history.get("messages", []))), rich=False) +``` + +Пример предполагает `messages` dict-result для конкретного RPC; при других +операциях проверяй их реальную форму. Не выполняй destructive methods как smoke-test. + +### 5. Fetch, системные данные, файлы + +Без raw `mt`: bound responses, fetch (`reply/msg/resolve`), `ctx.html` formatting, +`ctx.tools` (с оговорками приложения B), `ctx.version`, `ctx.uptime`, `ctx.config` snapshot, +`ctx.i18n.language`, `ctx.t`, доступные `ctx.ui/screens`/forms. Не выдумывай прямые +`ctx.sender_id`, `ctx.out`, `ctx.raw_args`, `ctx.logs` по аналогии с другой платформой. + +`ctx.memory/ram/get_memory/get_ram` и `prefix/get_prefix` в worker имеют особенности: +после замены base class на shared ContextOperations некоторые fallback значения +могут оказаться 0/'.', а не переданный в payload runtime snapshot. Проверяй +исполнение, не делай метрики/адресацию зависимыми от предполагаемого значения. + +`ctx.mt` — метод, возвращающий callable MTContext, а не безусловно готовый callable +RPC-объект; для raw API предпочитай явно подтверждённый `ctx.tg.call` и `mt` capability. + +#### Assets (capability `assets`) + +В `8cab560` исправлен путь: host `assets` использует тот же `sandbox.workspace`, +что worker. В старых версиях это не гарантировалось. + +- `await ctx.upload_file(source, file_name=...)` или `ctx.assets.upload(file, filename=...)`: + source в проверенном provider — **путь к существующему файлу workspace**, не BytesIO + и не произвольные bytes; возвращается uploaded file record. +- `await ctx.download_file(source, destination=None)` / `ctx.assets.download(...)`: + source — message dict с `chat_id` и `id`/`message_id`. Результат — относительный + путь workspace. Не bytes. Не передавай один media dict без message identity. +- `ctx.file_media(up, *, mime='application/octet-stream', file_name=None, force_file=True)` + — синхронная сборка InputMediaUploadedDocument; это не отправка и не upload. +- `await ctx.read_attachment_text(*, reply=False, max_bytes=1048576)` использует + bound fetch; лимит допустим 1..4194304, декодирует UTF-8-sig, не требует assets. + +### 6. Что нельзя считать доказанным тестом + +Каталог проверен статически и contract-mocks; реальные Telegram RPC, namespace jail, +права аккаунта и все 292 операции не запускались. Добавление списка в скилл не +является обещанием, что каждый серверный метод доступен конкретной установке. + + +## Приложение B. Tools, regdate и search + +## Hotaru tools, regdate, search и formatting helpers + +Проверено 2026-11-09 по `relay/toolkit.py`, `relay/sandbox.py`, `relay/context.py` +на `8cab560e2b9dbc009aab4670c8a78a9a790e2d1a`. + +### 1. Доступ и границы + +В worker `_build_tools` исполняет штатный toolkit и передаёт **76 экспортов +`TOOLKIT_FUNCS`** в `ctx.tools`. Пользуйся `ctx.tools.`, без импорта +`relay.toolkit`. В host есть alias `ctx.toolkit`, но у проверенного SandboxContext +его нет: не добавляй его в готовый внешний модуль по аналогии. + +Все функции ниже **синхронные**, кроме `search` и `check_restrictions`. `regdate`, +formatting, парсеры и локальные преобразования не требуют capabilities и не +делают сетевых запросов. Но экспорт имени не гарантирует работоспособность +функции в sandbox: `prune_logs` и restriction-check имеют ограничения ниже. + +Типы в сигнатурах документируют код, а не runtime validation каждого аргумента. +Не передавай недоверенные данные без проверки. Примеры — фрагменты тела handler, +не самостоятельные `.hmod`: у готового файла сначала должен быть HOTARU. + +### 2. regdate — оценка регистрации Telegram + +```text +ctx.tools.regdate(user_id, *, registration_month=None, not_after=None) +``` + +**Sync, локально, без `mt/net/state`.** Алгоритм использует встроенные ID/date +anchors и интерполяцию, не Telegram RPC и не внешний API. + +Вход: + +- `user_id`: положительный integer `< 2**63` либо строка ASCII decimal digits; + bool, отрицательный marked chat ID, username и Telegram entity не подходят. +- `registration_month`: optional строка строго `MM.YYYY`, не раньше запуска + Telegram 2013-08-14 и не из будущего. Это **заданное вызывающим ограничение**, + не автоматически полученная официальная дата. Не заполняй его догадкой. +- `not_after`: optional строка строго `YYYY-MM-DD`, не из будущего: верхняя граница + по независимо известному событию/дате. Не интерпретируется как дата регистрации. +- ID вне `_REGDATE_POINTS` без registration_month даёт ValueError. Не экстраполируй + за калибровку незаметно и не подавляй ошибку фиктивной датой. + +Результат — dict: + +| Ключ | Значение | +| --- | --- | +| `date` | Центральная оценка, ISO `YYYY-MM-DD` | +| `earliest`, `latest` | Границы оценочного диапазона, ISO даты | +| `error_days` | Максимальное отклонение от оценки до границ, integer | +| `age_days` | Возраст относительно текущей даты UTC по центральной оценке | +| `estimated` | Всегда True, включая anchor | +| `source` | `anchor`, `model`, `registration_month`; может иметь `+upper_bound` или `conflict` | +| `conflict` | Несовместимость известных ограничений с оценкой/диапазоном | +| `registration_month`, `not_after` | Переданные ограничения либо пустые строки | + +Показывай пользователю «примерно», диапазон и при необходимости конфликт. +Даже при `source='anchor'` это не подтверждённая точная дата. Не используй её +как надёжный критерий блокировки/доверия. Если конфликт=True, не выдавай результат +как точное пересечение ограничений: функция сохраняет диагностический конфликт. + +Пример без лишних capabilities: + +```python +async def command_regdate(ctx, invocation): + try: + info = ctx.tools.regdate(invocation.raw_args.strip()) + except (TypeError, ValueError): + await ctx.respond("Нужен числовой ID в поддерживаемом диапазоне.", rich=False) + return + text = ( + f"Примерная регистрация: {info['date']}\n" + f"Диапазон: {info['earliest']} — {info['latest']}\n" + f"Погрешность: до {info['error_days']} дней" + ) + if info["conflict"]: + text += "\nОграничения противоречат оценке." + await ctx.respond(text, rich=False) +``` + +Локализуй строки в настоящем модуле. Для username отдельно resolve → положительный +user ID → regdate; не передавай `ctx.message.id` (это ID сообщения). + +### 3. Асинхронный локальный поиск search + +```text +await ctx.tools.search(values, query, *, key=None, limit=10, min_score=0.76, layout=True) +``` + +Без capabilities, не ищет в Telegram/интернете. Нормализует Unicode NFKC, +регистр, ё/е, слова; учитывает совпадения, префиксы и ограниченные опечатки. +При `layout=True` пробует RU/EN раскладку с небольшим штрафом к score. +Периодически делает `await asyncio.sleep(0)`, не создаёт внешние jobs. + +- `values`: коллекция значений, не строка/bytes. +- `query`: str; пустой нормализованный запрос возвращает []. +- `key=None`: каждый value должен быть строкой либо последовательностью строк. +- `key='name'`: извлекает `value['name']`, не object attribute. +- Callable key: локальная функция, возвращающая строку или list/tuple строк; + не coroutine. Неверные типы поисковых полей дают TypeError. +- `limit`: nonnegative int, bool недопустим; 0 возвращает []. +- `min_score`: от 0 до 1. +- Результат отсортирован по score; при равенстве сохраняется приоритет исходного + порядка. Запись: `{'value': original, 'score': float, 'matched': str, 'layout': bool}`. + Это не список исходных объектов: извлекай hit['value'] явно. + +```python +async def command_find(ctx, invocation): + items = [{"name": "Backup", "id": "backups"}, {"name": "Settings", "id": "settings"}] + hits = await ctx.tools.search(items, invocation.raw_args, key="name", limit=5) + text = "\n".join(ctx.tools.escape(hit["value"]["name"]) for hit in hits) + await ctx.respond(text or "Нет совпадений.", rich=False) +``` + +### 4. Полный каталог tools: 76 экспортов + +В следующих строках вызов без префикса означает `ctx.tools.(...)`. +Возвращаемые типы взяты из определения функции. `Any` не означает сериализацию +любого объекта через IPC: tools исполняются локально внутри worker. + +#### Аргументы — 6 + +| Сигнатура | Что делает / ограничения | +| --- | --- | +| `args_parse(text: str) -> list[str]` | **Полный текст команды**; отбрасывает первый токен, применяет shlex к остатку; при неверных кавычках возвращает остаток одним элементом | +| `args_raw(text: str) -> str` | Отбрасывает первый токен полного текста команды | +| `args_split(text: str, separator: str \| list[str]) -> list[str]` | Разбивает raw args, trim и удаление пустых частей | +| `args_int(text: str) -> list[int]` | Числа из args_parse; нечисловые токены пропускаются | +| `args_bool(text: str) -> list[bool]` | Известные yes/no/on/off/true/false/1/0/да/нет/вкл/выкл; остальные пропускаются | +| `args_float(text: str) -> list[float]` | Floats из args_parse; неверные токены пропускаются | + +**Ловушка:** `args_parse(invocation.raw_args)` потеряет первый аргумент. Для raw_args +используй `shlex.split(invocation.raw_args)` с явной обработкой ошибок либо передай +synthetic full command text, если именно toolkit parser нужен по контракту. + +#### HTML, entities и ссылки — 12 + +| Сигнатура | Семантика | +| --- | --- | +| `escape(value: Any) -> str` | HTML text escaping без quotes | +| `escape_attr(value: Any) -> str` | HTML attribute escaping с quotes | +| `escape_smart(text: str) -> str` | Сохраняет allowlisted tags, escape остальное; **не sanitizer атрибутов/URL** | +| `strip_tags(text: str, keep_tg: bool=True) -> str` | В текущей реализации итоговый regex удаляет все tags даже при keep_tg=True; не обещай сохранение Telegram tags | +| `strip_emoji(text: str) -> str` | Regex-удаление диапазонов emoji; не универсальный grapheme parser | +| `flag(code: str) -> str` | Две ASCII letters → regional indicator flag; иначе исходник | +| `entity_url(entity: object, openmessage: bool=False) -> str` | Локальная сборка tg:// для user/username; не делает resolve | +| `entity_link(entity: object, label: str \| None=None) -> str` | Escaped HTML link по entity_url; без URL возвращает escaped label | +| `valid_url(url: str) -> bool` | Только bool(urlparse(url).netloc); это **не** проверка безопасности/SSRF | +| `is_url(text: str) -> bool` | Ограниченный HTTP(S) regex, не полный стандарт URL | +| `urls_extract(text: str) -> list[str]` | Regex извлекает HTTP(S) ссылки | +| `html_fix(text: str) -> str` | Alias escape_smart; не структурный HTML validator | + +Ни valid_url, ни is_url, ни escape_smart не дают права обходить сетевую политику. +Для полностью недоверенного текста используй escape, а не escape_smart. + +#### Коллекции и служебные данные — 9 + +| Сигнатура | Семантика | +| --- | --- | +| `chunk(items: list[Any] \| tuple[Any, ...] \| str, size: int) -> list[Any]` | Slices размера size>0; не HTML-aware | +| `random_str(size: int, charset: str \| None=None) -> str` | random.choice; **не криптографический токен**; size<1 → '' | +| `merge_dicts(a: dict[str, Any], b: dict[str, Any], *, deep: bool=True) -> dict[str, Any]` | Мутирует **b**, приоритет у a; list merge убирает дубли через dict.fromkeys | +| `json_ok(value: Any) -> bool` | Проверяет json.dumps; не проверяет IPC limits или business schema | +| `flatten(nested: list[Any]) -> list[Any]` | Разворачивает только один уровень вложенных list, не рекурсивно | +| `censor(obj: Any, fields: list[str] \| None=None, replacement: str='***') -> Any` | Рекурсивно dict/list, маскирует строковые значения известных ключей; numeric и неизвестные секреты могут остаться | +| `attr(obj: Any, name: str, default: Any=None) -> Any` | getattr с подавлением Exception; **не dict.get** | +| `face() -> str` | Случайный escaped kaomoji | +| `hash_short(text: str, length: int=8) -> str` | Срез hex SHA-256; не парольный hash и не уникальный ID-гарант | + +#### Message/entity introspection — 7 + +| Сигнатура | Семантика | +| --- | --- | +| `chat_id(message: Any) -> int \| None` | Извлекает chat_id; для marked channel ID удаляет -100 prefix, то есть может вернуть **raw positive channel ID** | +| `entity_id(entity: Any) -> int \| None` | channel_id/chat_id/user_id/id для dict, иначе .id; не делает Telegram resolve | +| `topic_id(message: Any) -> int \| None` | topic_id/message_thread_id/top_msg_id; не разбирает все варианты reply header | +| `mime(message: Any) -> str` | Шаллоу media/document lookup; при иной структуре может вернуть '' | +| `msg_link(message: Any, chat: Any=None) -> str` | Локальная сборка ссылки; raw/marked ID и username могут потребовать дополнительной обработки | +| `has_media(message: Any) -> bool` | Проверяет доступные поля; не fetch скрытого/непереданного attachment | +| `target_id(message: Any, arg_index: int=0) -> int \| None` | Text mention/числовой аргумент; не полноценный username resolver | + +`tools.chat_id` нельзя бездумно передавать как адресата RPC: не путай raw channel +ID и marked chat ID. Для достоверной ссылки используй `await ctx.get_link()` на +полном конкретном сообщении, для пользователя — `ctx.resolve` и проверку типа entity. + +#### Время и числа — 12 + +| Сигнатура | Семантика | +| --- | --- | +| `file_size(size_bytes: int \| float) -> str` | Формат по 1024, B..PB | +| `iso_time() -> str` | Текущее datetime UTC isoformat | +| `uptime() -> int` | Секунды с импорта toolkit в данном процессе, **не обязательно runtime uptime** | +| `uptime_fmt(language: str='en') -> str` | duration(toolkit uptime, language) | +| `duration(seconds: int \| float, language: str='en') -> str` | Локализованная длительность; normalize locale; отрицательное → 0; не планировщик | +| `timestamp(value: int \| float, language: str='en') -> str` | Unix timestamp → локализованная дата/время **UTC** | +| `time_range(start: int \| float, end: int \| float \| None=None, language: str='en') -> str` | Форматированный UTC диапазон | +| `plural(count: int \| float, one: str, few: str='', many: str='') -> str` | Выбирает форму; возвращает форму, **не число + форму** | +| `percent(value: int \| float, total: int \| float, decimals: int=1) -> str` | Процент; total=0 → '0%'; не clamp до 100 | +| `clamp(value: int \| float, minimum: int \| float, maximum: int \| float) -> int \| float` | Ограничить диапазон | +| `mask(value: str, visible: int=4, char: str='•') -> str` | Маскирование строки; проверяй visible>0: крайние значения ведут себя по Python slices | +| `countdown(seconds: int \| float) -> str` | duration или 'now'; это отображение, **не timer/task** | + +Для uptime самого userbot предпочитай подтверждённый `ctx.uptime`, а не время +жизни worker/toolkit. Поддержка локалей formatter не равна наличию перевода ядра. + +#### Шаблоны и представление — 17 + +| Сигнатура | Семантика | +| --- | --- | +| `render(template: str, **data: Any) -> str` | Простой replace `{key}`; **нет escaping, type validation и scopes** | +| `template_fields(raw: object) -> dict[str, dict[str, Any]]` | Валидация 1..64 полей, type/example/description/format | +| `template_names(template: str, fields: dict[str, Any] \| None=None, *, legacy_braces: bool=False) -> list[str]` | Имена placeholders; с fields проверяет declared names | +| `template_render(template: object, fields: object, values: object=None, *, legacy_braces: bool=False) -> str` | Безопасный declared-template pipeline; values=None использует example values | +| `truncate(text: str, limit: int, suffix: str='…') -> str` | Текстовое обрезание с попыткой сохранить слово; не HTML-safe split | +| `table(rows: list[list[Any] \| tuple[Any, ...] \| dict[str, Any]], headers: list[str] \| None=None) -> str` | **Rich HTML `
`**, escaped cells; не ASCII table | +| `progress(current: int \| float, total: int \| float, width: int=10, filled: str='█', empty: str='░') -> str` | Текстовый progress bar с clamp ratio | +| `code_block(text: str, language: str='') -> str` | Escaped `
` |
+| `spoiler(text: str) -> str` | Оборачивает в tg-spoiler, **не escape содержимое** |
+| `blockquote(text: str, expandable: bool=False) -> str` | Оборачивает HTML; содержимое **не escape** |
+| `mention(user_id: int \| str, name: str \| None=None) -> str` | tg://user; label escape; user_id сначала validate |
+| `link(label: str, url: str) -> str` | Escaped HTML label/href; URL safety отдельно |
+| `list_items(items: list[str], ordered: bool=False) -> str` | Rich ul/ol; items **не escape** |
+| `kv(pairs: dict[str, Any] \| list[tuple[str, Any]], bold_keys: bool=True) -> str` | Escaped key/value, `
` separators | +| `tree(items: list[str], indent: str=' ') -> str` | Escaped плоское дерево в code; indent в текущем теле не используется | +| `badge(text: str, style: str='info') -> str` | Текстовый icon+escaped label, не Telegram button | +| `wordmark() -> str` | Статическая последовательность tg-emoji wordmark | + +`template_validate` существует внутри файла, но **не экспортирован** в +TOOLKIT_FUNCS: не вызывай `ctx.tools.template_validate`. Для межмодульных полей +нужен `ctx.render_template_async`, не локальная подстановка с обходом scopes. + +#### Rich/text/buttons — 7 + +| Сигнатура | Семантика | +| --- | --- | +| `rich_to_html(message: object) -> str` | TL rich_message blocks из dict → HTML; не произвольный HTML renderer | +| `message_text(message: object) -> str` | Plain текст из rich/message/raw_text/text/caption; str возвращается как есть; None/неполное сообщение → '' | +| `entities_to_html(text: str \| None, entities: list[object] \| tuple[object, ...] \| None=None) -> str` | Telegram UTF-16 entity offsets → HTML; не удаляй offsets до преобразования | +| `btn_html(button: dict[str, Any]) -> str` | Rich tg-button из url/copy_text/callback_data; **не регистрирует handler и не подписывает callback** | +| `buttons_html(buttons: list[Any], kind: str='page') -> str` | Row/group rich HTML, kind='text' → плоский список tags | +| `needs_form(buttons: object) -> bool` | Input detection по старому dict-полю input, не универсальная проверка всех UI routes | +| `needs_callback(buttons: object) -> bool` | Проверяет некоторые callback/input поля; **не учитывает все worker action_id/Screen kinds** | + +`message_text` работает только с переданными данными. Для неполного ctx.message +сначала fetch при необходимости. Он может вернуть plain текст с `<`/`&`, поэтому +escape перед повторной HTML-отправкой обязателен. + +#### Пагинация, диагностика, special tools — 6 + +| Сигнатура | Семантика | +| --- | --- | +| `paginate_chunks(text: str, limit: int=4000) -> list[str]` | Деление текста по строкам/символам; **не HTML-aware**; '' → ['']; limit должен быть положительным | +| `classify_error(exc: Any) -> dict[str, Any]` | Локальная эвристика по тексту/seconds, поля type/is_restriction/flood_wait/detail/recoverable | +| `await check_restrictions(ctx: Any) -> dict[str, Any]` | Проверяет users.getUsers только если ctx имеет настоящий app/runtime.app; в sandbox обычно его нет | +| `prune_logs(root: str \| Path='.', max_file_bytes: int=8*1024*1024, keep_tail_bytes: int=1*1024*1024) -> int` | Внутри импортирует hotaru.observatory; **не worker-safe**, не вызывай из внешнего модуля | +| `regdate(user_id: object, *, registration_month: object=None, not_after: object=None) -> dict[str, str \| int \| bool]` | Локальная оценка регистрации, см. раздел 2 | +| `await search(values: Any, query: object, *, key: Any=None, limit: object=10, min_score: float=0.76, layout: bool=True) -> list[dict[str, Any]]` | Локальный fuzzy search, см. раздел 3 | + +`check_restrictions` без host app вернёт default `can_send=True`, но это **не +проверка** состояния Telegram. `ctx.classify_error`/`ctx.check_restrictions` из +shared ContextOperations тоже могут импортировать relay.toolkit, что запрещено +worker audit hook. Для локальной классификации используй `ctx.tools.classify_error`. +Не обещай успешный account health check по default результату и не импортируй +ядро, чтобы обойти ограничение. + +### 5. Отдельный ctx.html (не tools) + +Проверенный `_HtmlHelper` worker предоставляет sync: + +- `ctx.html.escape(value)`; +- `bold(value)`, `italic(value)`, `code(value)`, `underline(value)`, `quote(value)`; +- `link(label, url)`; +- `pre(value, language=None)`. + +Они escape содержимое. Это отличается от `tools.blockquote/spoiler/list_items`, +которые принимают уже подготовленную разметку. Форматирование не отправляет +сообщение и не требует capabilities. + +### 6. Критерий достоверности + +Список экспортов и сигнатуры проверяются встроенным скриптом +из [приложения D](#api-inspector) с аргументами ` --section tools`. Источник `TOOLKIT_FUNCS` важнее случайных top-level def и +неполного автодополнения. Не устанавливай внешние библиотеки для уже имеющихся +tools. При обновлении исходника сравни состав, сигнатуры и поведение, а не только +число функций. Live Telegram и Linux sandbox не подтверждены одним AST-тестом. + + +## Приложение C. Полные карточки методов + +## Hotaru: полные карточки контекстных методов + +292 карточки, сформированные из AST исходников Hotaru; без импорта ядра и Telegram RPC. +Базовый снимок скилла: `8cab560e2b9dbc009aab4670c8a78a9a790e2d1a`, 2026-11-09. +При регенерации по другой версии актуальность определяют SHA-256 ниже, а не эта отметка. + +### Как читать карточки + +- Это справочные сигнатуры в стиле Python, не исполняемые вызовы: `*` означает + рекомендуемые keyword-аргументы; реальные positional slots указаны отдельно. +- Все операции асинхронные: в handler используй `await ctx.(...)`. +- `CURRENT_PEER`, `CURRENT_MESSAGE`, `RANDOM_ID` обозначают defaults ядра, + а не имена, которые нужно объявлять в модуле. Обычно соответствующий keyword пропускают. +- TL `flags.N?T` — optional поле; `Vector` — последовательность; типы сохраняют + запись исходной TL-схемы и не являются готовыми Python-аннотациями. +- «Обязательный» означает: вызывающий обязан передать значение, поскольку ядро + не подставляет default. Наличие обязательного TL-поля не исключает default ядра. +- Optional `None` в справочной сигнатуре означает пропуск поля, не обязательную + отправку None в Telegram. Keyword со статусом «запрещён» передавать нельзя. +- **Результат: `Any`, зависит от RPC.** CTX_CATALOG не хранит тип результата, + а host распаковывает/фильтрует response. Непроверенные returns сайта не копируются. + Для конкретного результата сверяй TL result schema используемого GoyGram и host adapter. +- «Без raw mt» не отменяет ACL Telegram, denylist, Premium, media/assets, net, + state и другие ограничения всей операции. Подробности: [приложение A](#context-contract). + +### Контроль источников + +| Файл | SHA-256 содержимого | +| --- | --- | +| `relay/context.py` | `af66ab88029113b354451c0748a5adb641f3dcfab0a7998d073368f4c5f79b74` | +| `relay/toolkit.py` | `6fbae44abad4595b3695fecead063fa66c50ea72b3784924e2c9e6e023d9f013` | +| `relay/sandbox.py` | `34c660ebc571fac589dc1406da093c7cedfe78654d4ae394c06a1af3cb904815` | +| `relay/caps.py` | `215248de25954b1023342b1ea4a328230b499dd68d411f04200dba7fe29ab9d7` | + +### Навигация по namespace + +- **messages (126):** [set_checklist_completed](#ctx-set_checklist_completed), [add_poll_answer](#ctx-add_poll_answer), [remove_poll_answer](#ctx-remove_poll_answer), [unread_poll_votes](#ctx-unread_poll_votes), [mark_poll_votes_read](#ctx-mark_poll_votes_read), [scheduled_messages](#ctx-scheduled_messages), [scheduled_by_ids](#ctx-scheduled_by_ids), [publish_scheduled](#ctx-publish_scheduled), [cancel_scheduled](#ctx-cancel_scheduled), [configure_chat_reactions](#ctx-configure_chat_reactions), [available_reactions](#ctx-available_reactions), [set_default_reaction](#ctx-set_default_reaction), [unread_reactions](#ctx-unread_reactions), [mark_reactions_read](#ctx-mark_reactions_read), [popular_reactions](#ctx-popular_reactions), [recent_reactions](#ctx-recent_reactions), [clear_recent_reactions](#ctx-clear_recent_reactions), [remove_member_reactions](#ctx-remove_member_reactions), [remove_member_message_reaction](#ctx-remove_member_message_reaction), [saved_dialogs](#ctx-saved_dialogs), [saved_history](#ctx-saved_history), [clear_saved_history](#ctx-clear_saved_history), [pinned_saved_dialogs](#ctx-pinned_saved_dialogs), [set_saved_dialog_pinned](#ctx-set_saved_dialog_pinned), [reorder_saved_pins](#ctx-reorder_saved_pins), [saved_reaction_tags](#ctx-saved_reaction_tags), [rename_saved_tag](#ctx-rename_saved_tag), [suggested_saved_tags](#ctx-suggested_saved_tags), [saved_dialogs_by_peers](#ctx-saved_dialogs_by_peers), [mark_saved_history_read](#ctx-mark_saved_history_read), [forum_topics](#ctx-forum_topics), [forum_topics_by_ids](#ctx-forum_topics_by_ids), [edit_forum_topic](#ctx-edit_forum_topic), [set_forum_topic_pinned](#ctx-set_forum_topic_pinned), [reorder_forum_pins](#ctx-reorder_forum_pins), [create_forum_topic](#ctx-create_forum_topic), [remove_forum_topic](#ctx-remove_forum_topic), [stickers_for_emoji](#ctx-stickers_for_emoji), [installed_sticker_sets](#ctx-installed_sticker_sets), [sticker_set](#ctx-sticker_set), [install_sticker_set](#ctx-install_sticker_set), [uninstall_sticker_set](#ctx-uninstall_sticker_set), [reorder_sticker_sets](#ctx-reorder_sticker_sets), [saved_gifs](#ctx-saved_gifs), [set_gif_saved](#ctx-set_gif_saved), [featured_sticker_sets](#ctx-featured_sticker_sets), [mark_featured_stickers_seen](#ctx-mark_featured_stickers_seen), [recent_stickers](#ctx-recent_stickers), [set_sticker_recent](#ctx-set_sticker_recent), [clear_recent_stickers](#ctx-clear_recent_stickers), [archived_sticker_sets](#ctx-archived_sticker_sets), [installed_masks](#ctx-installed_masks), [media_sticker_sets](#ctx-media_sticker_sets), [favorite_stickers](#ctx-favorite_stickers), [set_sticker_favorite](#ctx-set_sticker_favorite), [search_sticker_sets](#ctx-search_sticker_sets), [bulk_sticker_set_action](#ctx-bulk_sticker_set_action), [older_featured_sticker_sets](#ctx-older_featured_sticker_sets), [custom_emoji_documents](#ctx-custom_emoji_documents), [installed_emoji_sets](#ctx-installed_emoji_sets), [featured_emoji_sets](#ctx-featured_emoji_sets), [search_custom_emoji](#ctx-search_custom_emoji), [search_emoji_sets](#ctx-search_emoji_sets), [owned_sticker_sets](#ctx-owned_sticker_sets), [search_stickers](#ctx-search_stickers), [dialogs](#ctx-dialogs), [chat_history](#ctx-chat_history), [search_chat_messages](#ctx-search_chat_messages), [mark_chat_read](#ctx-mark_chat_read), [clear_chat_history](#ctx-clear_chat_history), [peer_settings](#ctx-peer_settings), [basic_groups](#ctx-basic_groups), [basic_group_details](#ctx-basic_group_details), [search_all_messages](#ctx-search_all_messages), [message_editability](#ctx-message_editability), [peer_dialogs](#ctx-peer_dialogs), [all_drafts](#ctx-all_drafts), [mutual_groups](#ctx-mutual_groups), [set_dialog_pinned](#ctx-set_dialog_pinned), [reorder_dialog_pins](#ctx-reorder_dialog_pins), [pinned_dialogs](#ctx-pinned_dialogs), [unread_mentions](#ctx-unread_mentions), [mark_mentions_read](#ctx-mark_mentions_read), [recent_live_locations](#ctx-recent_live_locations), [set_dialog_unread](#ctx-set_dialog_unread), [unread_dialog_marks](#ctx-unread_dialog_marks), [clear_all_drafts](#ctx-clear_all_drafts), [chat_online_count](#ctx-chat_online_count), [message_type_counts](#ctx-message_type_counts), [dismiss_peer_settings_bar](#ctx-dismiss_peer_settings_bar), [mark_discussion_read](#ctx-mark_discussion_read), [unpin_all_chat_messages](#ctx-unpin_all_chat_messages), [message_readers](#ctx-message_readers), [message_search_calendar](#ctx-message_search_calendar), [message_search_positions](#ctx-message_search_positions), [set_default_send_as](#ctx-set_default_send_as), [sent_media_search](#ctx-sent_media_search), [outgoing_read_date](#ctx-outgoing_read_date), [chat_folders](#ctx-chat_folders), [suggested_chat_folders](#ctx-suggested_chat_folders), [save_chat_folder](#ctx-save_chat_folder), [reorder_chat_folders](#ctx-reorder_chat_folders), [set_folder_tags_visible](#ctx-set_folder_tags_visible), [rename_basic_group](#ctx-rename_basic_group), [set_basic_group_photo](#ctx-set_basic_group_photo), [add_basic_group_member](#ctx-add_basic_group_member), [remove_basic_group_member](#ctx-remove_basic_group_member), [create_basic_group](#ctx-create_basic_group), [set_basic_group_admin](#ctx-set_basic_group_admin), [upgrade_basic_group](#ctx-upgrade_basic_group), [edit_chat_description](#ctx-edit_chat_description), [set_default_member_restrictions](#ctx-set_default_member_restrictions), [remove_basic_group](#ctx-remove_basic_group), [set_chat_auto_delete](#ctx-set_chat_auto_delete), [set_content_protection](#ctx-set_content_protection), [edit_member_rank](#ctx-edit_member_rank), [create_chat_invite](#ctx-create_chat_invite), [chat_invites](#ctx-chat_invites), [chat_invite_details](#ctx-chat_invite_details), [edit_chat_invite](#ctx-edit_chat_invite), [purge_revoked_chat_invites](#ctx-purge_revoked_chat_invites), [remove_chat_invite](#ctx-remove_chat_invite), [invite_admins](#ctx-invite_admins), [invite_joiners](#ctx-invite_joiners), [resolve_join_request](#ctx-resolve_join_request), [resolve_all_join_requests](#ctx-resolve_all_join_requests) +- **stats (7):** [poll_statistics](#ctx-poll_statistics), [channel_statistics](#ctx-channel_statistics), [supergroup_statistics](#ctx-supergroup_statistics), [message_statistics](#ctx-message_statistics), [message_public_forwards](#ctx-message_public_forwards), [story_statistics](#ctx-story_statistics), [story_public_forwards](#ctx-story_public_forwards) +- **channels (46):** [set_forum_enabled](#ctx-set_forum_enabled), [set_forum_message_view](#ctx-set_forum_message_view), [channel_message_author](#ctx-channel_message_author), [mark_channel_read](#ctx-mark_channel_read), [channel_members](#ctx-channel_members), [channel_member](#ctx-channel_member), [channel_details](#ctx-channel_details), [create_channel](#ctx-create_channel), [set_channel_admin](#ctx-set_channel_admin), [rename_channel](#ctx-rename_channel), [set_channel_photo](#ctx-set_channel_photo), [check_channel_username](#ctx-check_channel_username), [set_channel_username](#ctx-set_channel_username), [join_channel](#ctx-join_channel), [leave_channel](#ctx-leave_channel), [invite_channel_members](#ctx-invite_channel_members), [remove_channel](#ctx-remove_channel), [set_channel_signatures](#ctx-set_channel_signatures), [owned_public_channels](#ctx-owned_public_channels), [restrict_channel_member](#ctx-restrict_channel_member), [channel_admin_log](#ctx-channel_admin_log), [set_group_sticker_set](#ctx-set_group_sticker_set), [mark_channel_media_read](#ctx-mark_channel_media_read), [clear_channel_history](#ctx-clear_channel_history), [set_prehistory_hidden](#ctx-set_prehistory_hidden), [left_channels](#ctx-left_channels), [eligible_discussion_groups](#ctx-eligible_discussion_groups), [set_discussion_group](#ctx-set_discussion_group), [set_group_location](#ctx-set_group_location), [set_slow_mode](#ctx-set_slow_mode), [inactive_channels](#ctx-inactive_channels), [send_as_identities](#ctx-send_as_identities), [remove_member_history](#ctx-remove_member_history), [set_join_to_send](#ctx-set_join_to_send), [set_join_requests](#ctx-set_join_requests), [reorder_channel_usernames](#ctx-reorder_channel_usernames), [set_channel_username_active](#ctx-set_channel_username_active), [deactivate_channel_usernames](#ctx-deactivate_channel_usernames), [set_antispam](#ctx-set_antispam), [set_members_hidden](#ctx-set_members_hidden), [set_channel_color](#ctx-set_channel_color), [related_channels](#ctx-related_channels), [set_channel_emoji_status](#ctx-set_channel_emoji_status), [set_group_emoji_set](#ctx-set_group_emoji_set), [set_channel_auto_translation](#ctx-set_channel_auto_translation), [set_channel_profile_tab](#ctx-set_channel_profile_tab) +- **stories (29):** [story_posting_quota](#ctx-story_posting_quota), [post_story](#ctx-post_story), [edit_story](#ctx-edit_story), [delete_stories](#ctx-delete_stories), [set_stories_on_profile](#ctx-set_stories_on_profile), [story_feed](#ctx-story_feed), [profile_stories](#ctx-profile_stories), [archived_stories](#ctx-archived_stories), [stories_by_ids](#ctx-stories_by_ids), [mark_stories_read](#ctx-mark_stories_read), [story_viewers](#ctx-story_viewers), [story_view_counts](#ctx-story_view_counts), [story_link](#ctx-story_link), [activate_story_stealth](#ctx-activate_story_stealth), [react_to_story](#ctx-react_to_story), [peer_stories](#ctx-peer_stories), [story_read_markers](#ctx-story_read_markers), [peer_latest_story_ids](#ctx-peer_latest_story_ids), [story_posting_chats](#ctx-story_posting_chats), [set_peer_stories_hidden](#ctx-set_peer_stories_hidden), [story_reaction_senders](#ctx-story_reaction_senders), [reorder_profile_story_pins](#ctx-reorder_profile_story_pins), [search_stories](#ctx-search_stories), [create_story_album](#ctx-create_story_album), [edit_story_album](#ctx-edit_story_album), [reorder_story_albums](#ctx-reorder_story_albums), [remove_story_album](#ctx-remove_story_album), [story_albums](#ctx-story_albums), [story_album_items](#ctx-story_album_items) +- **stickers (11):** [create_sticker_set](#ctx-create_sticker_set), [remove_sticker](#ctx-remove_sticker), [move_sticker](#ctx-move_sticker), [add_sticker](#ctx-add_sticker), [set_sticker_set_thumbnail](#ctx-set_sticker_set_thumbnail), [check_sticker_set_name](#ctx-check_sticker_set_name), [suggest_sticker_set_name](#ctx-suggest_sticker_set_name), [edit_sticker_metadata](#ctx-edit_sticker_metadata), [rename_sticker_set](#ctx-rename_sticker_set), [remove_sticker_set](#ctx-remove_sticker_set), [replace_sticker](#ctx-replace_sticker) +- **contacts (21):** [contact_ids](#ctx-contact_ids), [contact_statuses](#ctx-contact_statuses), [contacts_list](#ctx-contacts_list), [import_contacts](#ctx-import_contacts), [remove_contacts](#ctx-remove_contacts), [remove_contacts_by_phone](#ctx-remove_contacts_by_phone), [block_peer](#ctx-block_peer), [unblock_peer](#ctx-unblock_peer), [blocked_peers](#ctx-blocked_peers), [search_public_peers](#ctx-search_public_peers), [frequent_peers](#ctx-frequent_peers), [reset_peer_rating](#ctx-reset_peer_rating), [clear_imported_contacts](#ctx-clear_imported_contacts), [imported_contacts](#ctx-imported_contacts), [set_frequent_peers_enabled](#ctx-set_frequent_peers_enabled), [add_contact](#ctx-add_contact), [accept_contact](#ctx-accept_contact), [set_close_friends](#ctx-set_close_friends), [replace_blocklist](#ctx-replace_blocklist), [contact_birthdays](#ctx-contact_birthdays), [edit_contact_note](#ctx-edit_contact_note) +- **folders (1):** [move_dialogs_to_archive](#ctx-move_dialogs_to_archive) +- **chatlists (11):** [share_chat_folder](#ctx-share_chat_folder), [remove_folder_invite](#ctx-remove_folder_invite), [edit_folder_invite](#ctx-edit_folder_invite), [folder_invites](#ctx-folder_invites), [inspect_folder_invite](#ctx-inspect_folder_invite), [join_folder_invite](#ctx-join_folder_invite), [folder_updates](#ctx-folder_updates), [accept_folder_updates](#ctx-accept_folder_updates), [dismiss_folder_updates](#ctx-dismiss_folder_updates), [folder_leave_suggestions](#ctx-folder_leave_suggestions), [leave_shared_folder](#ctx-leave_shared_folder) +- **account (30):** [edit_profile](#ctx-edit_profile), [set_online_status](#ctx-set_online_status), [check_profile_username](#ctx-check_profile_username), [set_profile_username](#ctx-set_profile_username), [privacy_rules](#ctx-privacy_rules), [account_inactivity_ttl](#ctx-account_inactivity_ttl), [set_emoji_status](#ctx-set_emoji_status), [suggested_emoji_statuses](#ctx-suggested_emoji_statuses), [recent_emoji_statuses](#ctx-recent_emoji_statuses), [clear_recent_emoji_statuses](#ctx-clear_recent_emoji_statuses), [reorder_profile_usernames](#ctx-reorder_profile_usernames), [set_profile_username_active](#ctx-set_profile_username_active), [profile_photo_emojis](#ctx-profile_photo_emojis), [set_profile_color](#ctx-set_profile_color), [set_birthday](#ctx-set_birthday), [set_personal_channel](#ctx-set_personal_channel), [set_profile_tab](#ctx-set_profile_tab), [set_music_saved](#ctx-set_music_saved), [saved_music_ids](#ctx-saved_music_ids), [notification_settings](#ctx-notification_settings), [set_notification_settings](#ctx-set_notification_settings), [reset_notification_settings](#ctx-reset_notification_settings), [contact_signup_notifications](#ctx-contact_signup_notifications), [set_contact_signup_notifications](#ctx-set_contact_signup_notifications), [notification_exceptions](#ctx-notification_exceptions), [reaction_notification_settings](#ctx-reaction_notification_settings), [set_reaction_notification_settings](#ctx-set_reaction_notification_settings), [saved_notification_sounds](#ctx-saved_notification_sounds), [set_notification_sound_saved](#ctx-set_notification_sound_saved), [upload_notification_sound](#ctx-upload_notification_sound) +- **users (5):** [user_details](#ctx-user_details), [contact_requirements](#ctx-contact_requirements), [user_music](#ctx-user_music), [user_music_by_documents](#ctx-user_music_by_documents), [suggest_contact_birthday](#ctx-suggest_contact_birthday) +- **photos (5):** [select_profile_photo](#ctx-select_profile_photo), [upload_profile_photo](#ctx-upload_profile_photo), [remove_profile_photos](#ctx-remove_profile_photos), [profile_photos](#ctx-profile_photos), [set_contact_photo](#ctx-set_contact_photo) + +### Карточки методов + + +#### 1. `ctx.set_checklist_completed` + +- **MTProto RPC:** `messages.toggleTodoCompleted` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.toggleTodoCompleted`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.toggleTodoCompleted`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_checklist_completed(*, peer=CURRENT_PEER, msg_id=CURRENT_MESSAGE, completed, incompleted) +``` + +**Порядок positional slots:** `peer, msg_id, completed, incompleted`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `msg_id` | `int` | нет | `CURRENT_MESSAGE` | +| `completed` | `Vector` | да | — | +| `incompleted` | `Vector` | да | — | + + +#### 2. `ctx.add_poll_answer` + +- **MTProto RPC:** `messages.addPollAnswer` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.addPollAnswer`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.addPollAnswer`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.add_poll_answer(*, peer=CURRENT_PEER, msg_id=CURRENT_MESSAGE, answer) +``` + +**Порядок positional slots:** `peer, msg_id, answer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `msg_id` | `int` | нет | `CURRENT_MESSAGE` | +| `answer` | `PollAnswer` | да | — | + + +#### 3. `ctx.remove_poll_answer` + +- **MTProto RPC:** `messages.deletePollAnswer` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.deletePollAnswer`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.deletePollAnswer`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_poll_answer(*, peer=CURRENT_PEER, msg_id=CURRENT_MESSAGE, option) +``` + +**Порядок positional slots:** `peer, msg_id, option`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `msg_id` | `int` | нет | `CURRENT_MESSAGE` | +| `option` | `bytes` | да | — | + + +#### 4. `ctx.unread_poll_votes` + +- **MTProto RPC:** `messages.getUnreadPollVotes` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getUnreadPollVotes`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getUnreadPollVotes`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.unread_poll_votes(*, peer=CURRENT_PEER, top_msg_id=None, offset_id=0, add_offset=0, limit=50, max_id=0, min_id=0) +``` + +**Порядок positional slots:** `peer, offset_id, add_offset, limit, max_id, min_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `top_msg_id` | `flags.0?int` | нет | поле пропускается | +| `offset_id` | `int` | нет | `0` | +| `add_offset` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | +| `max_id` | `int` | нет | `0` | +| `min_id` | `int` | нет | `0` | + + +#### 5. `ctx.mark_poll_votes_read` + +- **MTProto RPC:** `messages.readPollVotes` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.readPollVotes`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.readPollVotes`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.mark_poll_votes_read(*, peer=CURRENT_PEER, top_msg_id=None) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `top_msg_id` | `flags.0?int` | нет | поле пропускается | + + +#### 6. `ctx.poll_statistics` + +- **MTProto RPC:** `stats.getPollStats` +- **Namespace:** `stats` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stats.getPollStats`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stats.getPollStats`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.poll_statistics(*, dark=None, peer=CURRENT_PEER, msg_id=CURRENT_MESSAGE) +``` + +**Порядок positional slots:** `peer, msg_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `dark` | `flags.0?true` | нет | поле пропускается | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `msg_id` | `int` | нет | `CURRENT_MESSAGE` | + + +#### 7. `ctx.scheduled_messages` + +- **MTProto RPC:** `messages.getScheduledHistory` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getScheduledHistory`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getScheduledHistory`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.scheduled_messages(*, peer=CURRENT_PEER, hash=0) +``` + +**Порядок positional slots:** `peer, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `hash` | `long` | нет | `0` | + + +#### 8. `ctx.scheduled_by_ids` + +- **MTProto RPC:** `messages.getScheduledMessages` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getScheduledMessages`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getScheduledMessages`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.scheduled_by_ids(*, peer=CURRENT_PEER, id) +``` + +**Порядок positional slots:** `peer, id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `id` | `Vector` | да | — | + + +#### 9. `ctx.publish_scheduled` + +- **MTProto RPC:** `messages.sendScheduledMessages` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.sendScheduledMessages`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.sendScheduledMessages`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.publish_scheduled(*, peer=CURRENT_PEER, id) +``` + +**Порядок positional slots:** `peer, id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `id` | `Vector` | да | — | + + +#### 10. `ctx.cancel_scheduled` + +- **MTProto RPC:** `messages.deleteScheduledMessages` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.deleteScheduledMessages`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.deleteScheduledMessages`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.cancel_scheduled(*, peer=CURRENT_PEER, id) +``` + +**Порядок positional slots:** `peer, id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `id` | `Vector` | да | — | + + +#### 11. `ctx.configure_chat_reactions` + +- **MTProto RPC:** `messages.setChatAvailableReactions` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.setChatAvailableReactions`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.setChatAvailableReactions`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.configure_chat_reactions(*, peer=CURRENT_PEER, available_reactions, reactions_limit=None, paid_enabled=None) +``` + +**Порядок positional slots:** `peer, available_reactions`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `available_reactions` | `ChatReactions` | да | — | +| `reactions_limit` | `flags.0?int` | нет | поле пропускается | +| `paid_enabled` | `flags.1?Bool` | нет | поле пропускается | + + +#### 12. `ctx.available_reactions` + +- **MTProto RPC:** `messages.getAvailableReactions` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getAvailableReactions`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getAvailableReactions`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.available_reactions(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `int` | нет | `0` | + + +#### 13. `ctx.set_default_reaction` + +- **MTProto RPC:** `messages.setDefaultReaction` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.setDefaultReaction`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.setDefaultReaction`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_default_reaction(*, reaction) +``` + +**Порядок positional slots:** `reaction`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `reaction` | `Reaction` | да | — | + + +#### 14. `ctx.unread_reactions` + +- **MTProto RPC:** `messages.getUnreadReactions` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getUnreadReactions`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getUnreadReactions`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.unread_reactions(*, peer=CURRENT_PEER, top_msg_id=None, saved_peer_id=None, offset_id=0, add_offset=0, limit=50, max_id=0, min_id=0) +``` + +**Порядок positional slots:** `peer, offset_id, add_offset, limit, max_id, min_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `top_msg_id` | `flags.0?int` | нет | поле пропускается | +| `saved_peer_id` | `flags.1?InputPeer` | нет | поле пропускается | +| `offset_id` | `int` | нет | `0` | +| `add_offset` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | +| `max_id` | `int` | нет | `0` | +| `min_id` | `int` | нет | `0` | + + +#### 15. `ctx.mark_reactions_read` + +- **MTProto RPC:** `messages.readReactions` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.readReactions`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.readReactions`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.mark_reactions_read(*, peer=CURRENT_PEER, top_msg_id=None, saved_peer_id=None) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `top_msg_id` | `flags.0?int` | нет | поле пропускается | +| `saved_peer_id` | `flags.1?InputPeer` | нет | поле пропускается | + + +#### 16. `ctx.popular_reactions` + +- **MTProto RPC:** `messages.getTopReactions` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getTopReactions`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getTopReactions`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.popular_reactions(*, limit=50, hash=0) +``` + +**Порядок positional slots:** `limit, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `limit` | `int` | нет | `50` | +| `hash` | `long` | нет | `0` | + + +#### 17. `ctx.recent_reactions` + +- **MTProto RPC:** `messages.getRecentReactions` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getRecentReactions`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getRecentReactions`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.recent_reactions(*, limit=50, hash=0) +``` + +**Порядок positional slots:** `limit, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `limit` | `int` | нет | `50` | +| `hash` | `long` | нет | `0` | + + +#### 18. `ctx.clear_recent_reactions` + +- **MTProto RPC:** `messages.clearRecentReactions` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.clearRecentReactions`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.clearRecentReactions`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.clear_recent_reactions() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 19. `ctx.remove_member_reactions` + +- **MTProto RPC:** `messages.deleteParticipantReactions` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.deleteParticipantReactions`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.deleteParticipantReactions`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_member_reactions(*, peer=CURRENT_PEER, participant) +``` + +**Порядок positional slots:** `peer, participant`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `participant` | `InputPeer` | да | — | + + +#### 20. `ctx.remove_member_message_reaction` + +- **MTProto RPC:** `messages.deleteParticipantReaction` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.deleteParticipantReaction`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.deleteParticipantReaction`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_member_message_reaction(*, peer=CURRENT_PEER, msg_id=CURRENT_MESSAGE, participant) +``` + +**Порядок positional slots:** `peer, msg_id, participant`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `msg_id` | `int` | нет | `CURRENT_MESSAGE` | +| `participant` | `InputPeer` | да | — | + + +#### 21. `ctx.saved_dialogs` + +- **MTProto RPC:** `messages.getSavedDialogs` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getSavedDialogs`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getSavedDialogs`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.saved_dialogs(*, exclude_pinned=None, parent_peer=None, offset_date=0, offset_id=0, offset_peer={'_': 'inputPeerEmpty'}, limit=50, hash=0) +``` + +**Порядок positional slots:** `offset_date, offset_id, offset_peer, limit, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `exclude_pinned` | `flags.0?true` | нет | поле пропускается | +| `parent_peer` | `flags.1?InputPeer` | нет | поле пропускается | +| `offset_date` | `int` | нет | `0` | +| `offset_id` | `int` | нет | `0` | +| `offset_peer` | `InputPeer` | нет | `{'_': 'inputPeerEmpty'}` | +| `limit` | `int` | нет | `50` | +| `hash` | `long` | нет | `0` | + + +#### 22. `ctx.saved_history` + +- **MTProto RPC:** `messages.getSavedHistory` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getSavedHistory`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getSavedHistory`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.saved_history(*, parent_peer=None, peer, offset_id=0, offset_date=0, add_offset=0, limit=50, max_id=0, min_id=0, hash=0) +``` + +**Порядок positional slots:** `peer, offset_id, offset_date, add_offset, limit, max_id, min_id, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `parent_peer` | `flags.0?InputPeer` | нет | поле пропускается | +| `peer` | `InputPeer` | да | — | +| `offset_id` | `int` | нет | `0` | +| `offset_date` | `int` | нет | `0` | +| `add_offset` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | +| `max_id` | `int` | нет | `0` | +| `min_id` | `int` | нет | `0` | +| `hash` | `long` | нет | `0` | + + +#### 23. `ctx.clear_saved_history` + +- **MTProto RPC:** `messages.deleteSavedHistory` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.deleteSavedHistory`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.deleteSavedHistory`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.clear_saved_history(*, parent_peer=None, peer, max_id, min_date=None, max_date=None) +``` + +**Порядок positional slots:** `peer, max_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `parent_peer` | `flags.0?InputPeer` | нет | поле пропускается | +| `peer` | `InputPeer` | да | — | +| `max_id` | `int` | да | — | +| `min_date` | `flags.2?int` | нет | поле пропускается | +| `max_date` | `flags.3?int` | нет | поле пропускается | + + +#### 24. `ctx.pinned_saved_dialogs` + +- **MTProto RPC:** `messages.getPinnedSavedDialogs` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getPinnedSavedDialogs`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getPinnedSavedDialogs`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.pinned_saved_dialogs() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 25. `ctx.set_saved_dialog_pinned` + +- **MTProto RPC:** `messages.toggleSavedDialogPin` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.toggleSavedDialogPin`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.toggleSavedDialogPin`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_saved_dialog_pinned(*, pinned=None, peer) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `pinned` | `flags.0?true` | нет | поле пропускается | +| `peer` | `InputDialogPeer` | да | — | + + +#### 26. `ctx.reorder_saved_pins` + +- **MTProto RPC:** `messages.reorderPinnedSavedDialogs` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.reorderPinnedSavedDialogs`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.reorderPinnedSavedDialogs`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.reorder_saved_pins(*, force=None, order) +``` + +**Порядок positional slots:** `order`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `force` | `flags.0?true` | нет | поле пропускается | +| `order` | `Vector` | да | — | + + +#### 27. `ctx.saved_reaction_tags` + +- **MTProto RPC:** `messages.getSavedReactionTags` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getSavedReactionTags`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getSavedReactionTags`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.saved_reaction_tags(*, peer=None, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `flags.0?InputPeer` | нет | поле пропускается | +| `hash` | `long` | нет | `0` | + + +#### 28. `ctx.rename_saved_tag` + +- **MTProto RPC:** `messages.updateSavedReactionTag` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.updateSavedReactionTag`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.updateSavedReactionTag`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.rename_saved_tag(*, reaction, title=None) +``` + +**Порядок positional slots:** `reaction`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `reaction` | `Reaction` | да | — | +| `title` | `flags.0?string` | нет | поле пропускается | + + +#### 29. `ctx.suggested_saved_tags` + +- **MTProto RPC:** `messages.getDefaultTagReactions` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getDefaultTagReactions`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getDefaultTagReactions`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.suggested_saved_tags(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `long` | нет | `0` | + + +#### 30. `ctx.saved_dialogs_by_peers` + +- **MTProto RPC:** `messages.getSavedDialogsByID` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getSavedDialogsByID`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getSavedDialogsByID`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.saved_dialogs_by_peers(*, parent_peer=None, ids) +``` + +**Порядок positional slots:** `ids`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `parent_peer` | `flags.1?InputPeer` | нет | поле пропускается | +| `ids` | `Vector` | да | — | + + +#### 31. `ctx.mark_saved_history_read` + +- **MTProto RPC:** `messages.readSavedHistory` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.readSavedHistory`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.readSavedHistory`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.mark_saved_history_read(*, parent_peer, peer, max_id) +``` + +**Порядок positional slots:** `parent_peer, peer, max_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `parent_peer` | `InputPeer` | да | — | +| `peer` | `InputPeer` | да | — | +| `max_id` | `int` | да | — | + + +#### 32. `ctx.forum_topics` + +- **MTProto RPC:** `messages.getForumTopics` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getForumTopics`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getForumTopics`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.forum_topics(*, peer=CURRENT_PEER, q=None, offset_date=0, offset_id=0, offset_topic=0, limit=50) +``` + +**Порядок positional slots:** `peer, offset_date, offset_id, offset_topic, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `q` | `flags.0?string` | нет | поле пропускается | +| `offset_date` | `int` | нет | `0` | +| `offset_id` | `int` | нет | `0` | +| `offset_topic` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | + + +#### 33. `ctx.forum_topics_by_ids` + +- **MTProto RPC:** `messages.getForumTopicsByID` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getForumTopicsByID`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getForumTopicsByID`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.forum_topics_by_ids(*, peer=CURRENT_PEER, topics) +``` + +**Порядок positional slots:** `peer, topics`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `topics` | `Vector` | да | — | + + +#### 34. `ctx.edit_forum_topic` + +- **MTProto RPC:** `messages.editForumTopic` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.editForumTopic`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.editForumTopic`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.edit_forum_topic(*, peer=CURRENT_PEER, topic_id, title=None, icon_emoji_id=None, closed=None, hidden=None) +``` + +**Порядок positional slots:** `peer, topic_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `topic_id` | `int` | да | — | +| `title` | `flags.0?string` | нет | поле пропускается | +| `icon_emoji_id` | `flags.1?long` | нет | поле пропускается | +| `closed` | `flags.2?Bool` | нет | поле пропускается | +| `hidden` | `flags.3?Bool` | нет | поле пропускается | + + +#### 35. `ctx.set_forum_topic_pinned` + +- **MTProto RPC:** `messages.updatePinnedForumTopic` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.updatePinnedForumTopic`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.updatePinnedForumTopic`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_forum_topic_pinned(*, peer=CURRENT_PEER, topic_id, pinned) +``` + +**Порядок positional slots:** `peer, topic_id, pinned`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `topic_id` | `int` | да | — | +| `pinned` | `Bool` | да | — | + + +#### 36. `ctx.reorder_forum_pins` + +- **MTProto RPC:** `messages.reorderPinnedForumTopics` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.reorderPinnedForumTopics`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.reorderPinnedForumTopics`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.reorder_forum_pins(*, force=None, peer=CURRENT_PEER, order) +``` + +**Порядок positional slots:** `peer, order`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `force` | `flags.0?true` | нет | поле пропускается | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `order` | `Vector` | да | — | + + +#### 37. `ctx.create_forum_topic` + +- **MTProto RPC:** `messages.createForumTopic` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.createForumTopic`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.createForumTopic`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.create_forum_topic(*, title_missing=None, peer=CURRENT_PEER, title, icon_color=None, icon_emoji_id=None, random_id=RANDOM_ID, send_as=None) +``` + +**Порядок positional slots:** `peer, title, random_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `title_missing` | `flags.4?true` | нет | поле пропускается | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `title` | `string` | да | — | +| `icon_color` | `flags.0?int` | нет | поле пропускается | +| `icon_emoji_id` | `flags.3?long` | нет | поле пропускается | +| `random_id` | `long` | нет | `RANDOM_ID` | +| `send_as` | `flags.2?InputPeer` | нет | поле пропускается | + + +#### 38. `ctx.remove_forum_topic` + +- **MTProto RPC:** `messages.deleteTopicHistory` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.deleteTopicHistory`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.deleteTopicHistory`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_forum_topic(*, peer=CURRENT_PEER, top_msg_id) +``` + +**Порядок positional slots:** `peer, top_msg_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `top_msg_id` | `int` | да | — | + + +#### 39. `ctx.set_forum_enabled` + +- **MTProto RPC:** `channels.toggleForum` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.toggleForum`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.toggleForum`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_forum_enabled(*, channel=CURRENT_PEER, enabled, tabs) +``` + +**Порядок positional slots:** `channel, enabled, tabs`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `enabled` | `Bool` | да | — | +| `tabs` | `Bool` | да | — | + + +#### 40. `ctx.set_forum_message_view` + +- **MTProto RPC:** `channels.toggleViewForumAsMessages` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.toggleViewForumAsMessages`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.toggleViewForumAsMessages`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_forum_message_view(*, channel=CURRENT_PEER, enabled) +``` + +**Порядок positional slots:** `channel, enabled`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `enabled` | `Bool` | да | — | + + +#### 41. `ctx.story_posting_quota` + +- **MTProto RPC:** `stories.canSendStory` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.canSendStory`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.canSendStory`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.story_posting_quota(*, peer) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | + + +#### 42. `ctx.post_story` + +- **MTProto RPC:** `stories.sendStory` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.sendStory`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.sendStory`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.post_story(*, pinned=None, noforwards=None, fwd_modified=None, peer, media, media_areas=None, caption=None, entities=None, privacy_rules, random_id=RANDOM_ID, period=None, fwd_from_id=None, fwd_from_story=None, albums=None, music=None) +``` + +**Порядок positional slots:** `peer, media, privacy_rules, random_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `pinned` | `flags.2?true` | нет | поле пропускается | +| `noforwards` | `flags.4?true` | нет | поле пропускается | +| `fwd_modified` | `flags.7?true` | нет | поле пропускается | +| `peer` | `InputPeer` | да | — | +| `media` | `InputMedia` | да | — | +| `media_areas` | `flags.5?Vector` | нет | поле пропускается | +| `caption` | `flags.0?string` | нет | поле пропускается | +| `entities` | `flags.1?Vector` | нет | поле пропускается | +| `privacy_rules` | `Vector` | да | — | +| `random_id` | `long` | нет | `RANDOM_ID` | +| `period` | `flags.3?int` | нет | поле пропускается | +| `fwd_from_id` | `flags.6?InputPeer` | нет | поле пропускается | +| `fwd_from_story` | `flags.6?int` | нет | поле пропускается | +| `albums` | `flags.8?Vector` | нет | поле пропускается | +| `music` | `flags.9?InputDocument` | нет | поле пропускается | + + +#### 43. `ctx.edit_story` + +- **MTProto RPC:** `stories.editStory` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.editStory`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.editStory`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.edit_story(*, peer, id, media=None, media_areas=None, caption=None, entities=None, privacy_rules=None, music=None) +``` + +**Порядок positional slots:** `peer, id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `id` | `int` | да | — | +| `media` | `flags.0?InputMedia` | нет | поле пропускается | +| `media_areas` | `flags.3?Vector` | нет | поле пропускается | +| `caption` | `flags.1?string` | нет | поле пропускается | +| `entities` | `flags.1?Vector` | нет | поле пропускается | +| `privacy_rules` | `flags.2?Vector` | нет | поле пропускается | +| `music` | `flags.4?InputDocument` | нет | поле пропускается | + + +#### 44. `ctx.delete_stories` + +- **MTProto RPC:** `stories.deleteStories` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.deleteStories`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.deleteStories`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.delete_stories(*, peer, id) +``` + +**Порядок positional slots:** `peer, id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `id` | `Vector` | да | — | + + +#### 45. `ctx.set_stories_on_profile` + +- **MTProto RPC:** `stories.togglePinned` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.togglePinned`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.togglePinned`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_stories_on_profile(*, peer, id, pinned) +``` + +**Порядок positional slots:** `peer, id, pinned`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `id` | `Vector` | да | — | +| `pinned` | `Bool` | да | — | + + +#### 46. `ctx.story_feed` + +- **MTProto RPC:** `stories.getAllStories` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.getAllStories`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.getAllStories`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.story_feed(*, next=None, hidden=None, state=None) +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `next` | `flags.1?true` | нет | поле пропускается | +| `hidden` | `flags.2?true` | нет | поле пропускается | +| `state` | `flags.0?string` | нет | поле пропускается | + + +#### 47. `ctx.profile_stories` + +- **MTProto RPC:** `stories.getPinnedStories` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.getPinnedStories`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.getPinnedStories`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.profile_stories(*, peer, offset_id=0, limit=50) +``` + +**Порядок positional slots:** `peer, offset_id, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `offset_id` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | + + +#### 48. `ctx.archived_stories` + +- **MTProto RPC:** `stories.getStoriesArchive` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.getStoriesArchive`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.getStoriesArchive`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.archived_stories(*, peer, offset_id=0, limit=50) +``` + +**Порядок positional slots:** `peer, offset_id, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `offset_id` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | + + +#### 49. `ctx.stories_by_ids` + +- **MTProto RPC:** `stories.getStoriesByID` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.getStoriesByID`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.getStoriesByID`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.stories_by_ids(*, peer, id) +``` + +**Порядок positional slots:** `peer, id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `id` | `Vector` | да | — | + + +#### 50. `ctx.mark_stories_read` + +- **MTProto RPC:** `stories.readStories` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.readStories`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.readStories`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.mark_stories_read(*, peer, max_id=0) +``` + +**Порядок positional slots:** `peer, max_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `max_id` | `int` | нет | `0` | + + +#### 51. `ctx.story_viewers` + +- **MTProto RPC:** `stories.getStoryViewsList` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.getStoryViewsList`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.getStoryViewsList`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.story_viewers(*, just_contacts=None, reactions_first=None, forwards_first=None, peer, q=None, id, offset='', limit=50) +``` + +**Порядок positional slots:** `peer, id, offset, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `just_contacts` | `flags.0?true` | нет | поле пропускается | +| `reactions_first` | `flags.2?true` | нет | поле пропускается | +| `forwards_first` | `flags.3?true` | нет | поле пропускается | +| `peer` | `InputPeer` | да | — | +| `q` | `flags.1?string` | нет | поле пропускается | +| `id` | `int` | да | — | +| `offset` | `string` | нет | `''` | +| `limit` | `int` | нет | `50` | + + +#### 52. `ctx.story_view_counts` + +- **MTProto RPC:** `stories.getStoriesViews` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.getStoriesViews`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.getStoriesViews`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.story_view_counts(*, peer, id) +``` + +**Порядок positional slots:** `peer, id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `id` | `Vector` | да | — | + + +#### 53. `ctx.story_link` + +- **MTProto RPC:** `stories.exportStoryLink` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.exportStoryLink`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.exportStoryLink`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.story_link(*, peer, id) +``` + +**Порядок positional slots:** `peer, id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `id` | `int` | да | — | + + +#### 54. `ctx.activate_story_stealth` + +- **MTProto RPC:** `stories.activateStealthMode` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.activateStealthMode`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.activateStealthMode`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.activate_story_stealth(*, past=None, future=None) +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `past` | `flags.0?true` | нет | поле пропускается | +| `future` | `flags.1?true` | нет | поле пропускается | + + +#### 55. `ctx.react_to_story` + +- **MTProto RPC:** `stories.sendReaction` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.sendReaction`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.sendReaction`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.react_to_story(*, add_to_recent=None, peer, story_id, reaction) +``` + +**Порядок positional slots:** `peer, story_id, reaction`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `add_to_recent` | `flags.0?true` | нет | поле пропускается | +| `peer` | `InputPeer` | да | — | +| `story_id` | `int` | да | — | +| `reaction` | `Reaction` | да | — | + + +#### 56. `ctx.peer_stories` + +- **MTProto RPC:** `stories.getPeerStories` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.getPeerStories`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.getPeerStories`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.peer_stories(*, peer) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | + + +#### 57. `ctx.story_read_markers` + +- **MTProto RPC:** `stories.getAllReadPeerStories` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.getAllReadPeerStories`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.getAllReadPeerStories`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.story_read_markers() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 58. `ctx.peer_latest_story_ids` + +- **MTProto RPC:** `stories.getPeerMaxIDs` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.getPeerMaxIDs`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.getPeerMaxIDs`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.peer_latest_story_ids(*, id) +``` + +**Порядок positional slots:** `id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `Vector` | да | — | + + +#### 59. `ctx.story_posting_chats` + +- **MTProto RPC:** `stories.getChatsToSend` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.getChatsToSend`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.getChatsToSend`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.story_posting_chats() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 60. `ctx.set_peer_stories_hidden` + +- **MTProto RPC:** `stories.togglePeerStoriesHidden` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.togglePeerStoriesHidden`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.togglePeerStoriesHidden`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_peer_stories_hidden(*, peer, hidden) +``` + +**Порядок positional slots:** `peer, hidden`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `hidden` | `Bool` | да | — | + + +#### 61. `ctx.story_reaction_senders` + +- **MTProto RPC:** `stories.getStoryReactionsList` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.getStoryReactionsList`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.getStoryReactionsList`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.story_reaction_senders(*, forwards_first=None, peer, id, reaction=None, offset=None, limit=50) +``` + +**Порядок positional slots:** `peer, id, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `forwards_first` | `flags.2?true` | нет | поле пропускается | +| `peer` | `InputPeer` | да | — | +| `id` | `int` | да | — | +| `reaction` | `flags.0?Reaction` | нет | поле пропускается | +| `offset` | `flags.1?string` | нет | поле пропускается | +| `limit` | `int` | нет | `50` | + + +#### 62. `ctx.reorder_profile_story_pins` + +- **MTProto RPC:** `stories.togglePinnedToTop` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.togglePinnedToTop`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.togglePinnedToTop`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.reorder_profile_story_pins(*, peer, id) +``` + +**Порядок positional slots:** `peer, id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `id` | `Vector` | да | — | + + +#### 63. `ctx.search_stories` + +- **MTProto RPC:** `stories.searchPosts` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.searchPosts`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.searchPosts`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.search_stories(*, hashtag=None, area=None, peer=None, offset='', limit=50) +``` + +**Порядок positional slots:** `offset, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hashtag` | `flags.0?string` | нет | поле пропускается | +| `area` | `flags.1?MediaArea` | нет | поле пропускается | +| `peer` | `flags.2?InputPeer` | нет | поле пропускается | +| `offset` | `string` | нет | `''` | +| `limit` | `int` | нет | `50` | + + +#### 64. `ctx.create_story_album` + +- **MTProto RPC:** `stories.createAlbum` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.createAlbum`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.createAlbum`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.create_story_album(*, peer, title, stories) +``` + +**Порядок positional slots:** `peer, title, stories`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `title` | `string` | да | — | +| `stories` | `Vector` | да | — | + + +#### 65. `ctx.edit_story_album` + +- **MTProto RPC:** `stories.updateAlbum` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.updateAlbum`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.updateAlbum`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.edit_story_album(*, peer, album_id, title=None, delete_stories=None, add_stories=None, order=None) +``` + +**Порядок positional slots:** `peer, album_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `album_id` | `int` | да | — | +| `title` | `flags.0?string` | нет | поле пропускается | +| `delete_stories` | `flags.1?Vector` | нет | поле пропускается | +| `add_stories` | `flags.2?Vector` | нет | поле пропускается | +| `order` | `flags.3?Vector` | нет | поле пропускается | + + +#### 66. `ctx.reorder_story_albums` + +- **MTProto RPC:** `stories.reorderAlbums` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.reorderAlbums`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.reorderAlbums`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.reorder_story_albums(*, peer, order) +``` + +**Порядок positional slots:** `peer, order`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `order` | `Vector` | да | — | + + +#### 67. `ctx.remove_story_album` + +- **MTProto RPC:** `stories.deleteAlbum` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.deleteAlbum`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.deleteAlbum`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_story_album(*, peer, album_id) +``` + +**Порядок positional slots:** `peer, album_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `album_id` | `int` | да | — | + + +#### 68. `ctx.story_albums` + +- **MTProto RPC:** `stories.getAlbums` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.getAlbums`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.getAlbums`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.story_albums(*, peer, hash=0) +``` + +**Порядок positional slots:** `peer, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `hash` | `long` | нет | `0` | + + +#### 69. `ctx.story_album_items` + +- **MTProto RPC:** `stories.getAlbumStories` +- **Namespace:** `stories` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stories.getAlbumStories`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stories.getAlbumStories`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.story_album_items(*, peer, album_id, offset=0, limit=50) +``` + +**Порядок positional slots:** `peer, album_id, offset, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | да | — | +| `album_id` | `int` | да | — | +| `offset` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | + + +#### 70. `ctx.stickers_for_emoji` + +- **MTProto RPC:** `messages.getStickers` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.stickers_for_emoji(*, emoticon, hash=0) +``` + +**Порядок positional slots:** `emoticon, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `emoticon` | `string` | да | — | +| `hash` | `long` | нет | `0` | + + +#### 71. `ctx.installed_sticker_sets` + +- **MTProto RPC:** `messages.getAllStickers` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getAllStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getAllStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.installed_sticker_sets(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `long` | нет | `0` | + + +#### 72. `ctx.sticker_set` + +- **MTProto RPC:** `messages.getStickerSet` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getStickerSet`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getStickerSet`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.sticker_set(*, stickerset, hash=0) +``` + +**Порядок positional slots:** `stickerset, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `stickerset` | `InputStickerSet` | да | — | +| `hash` | `int` | нет | `0` | + + +#### 73. `ctx.install_sticker_set` + +- **MTProto RPC:** `messages.installStickerSet` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.installStickerSet`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.installStickerSet`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.install_sticker_set(*, stickerset, archived=False) +``` + +**Порядок positional slots:** `stickerset, archived`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `stickerset` | `InputStickerSet` | да | — | +| `archived` | `Bool` | нет | `False` | + + +#### 74. `ctx.uninstall_sticker_set` + +- **MTProto RPC:** `messages.uninstallStickerSet` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.uninstallStickerSet`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.uninstallStickerSet`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.uninstall_sticker_set(*, stickerset) +``` + +**Порядок positional slots:** `stickerset`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `stickerset` | `InputStickerSet` | да | — | + + +#### 75. `ctx.reorder_sticker_sets` + +- **MTProto RPC:** `messages.reorderStickerSets` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.reorderStickerSets`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.reorderStickerSets`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.reorder_sticker_sets(*, masks=None, emojis=None, order) +``` + +**Порядок positional slots:** `order`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `masks` | `flags.0?true` | нет | поле пропускается | +| `emojis` | `flags.1?true` | нет | поле пропускается | +| `order` | `Vector` | да | — | + + +#### 76. `ctx.saved_gifs` + +- **MTProto RPC:** `messages.getSavedGifs` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getSavedGifs`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getSavedGifs`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.saved_gifs(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `long` | нет | `0` | + + +#### 77. `ctx.set_gif_saved` + +- **MTProto RPC:** `messages.saveGif` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.saveGif`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.saveGif`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_gif_saved(*, id, unsave) +``` + +**Порядок positional slots:** `id, unsave`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `InputDocument` | да | — | +| `unsave` | `Bool` | да | — | + + +#### 78. `ctx.featured_sticker_sets` + +- **MTProto RPC:** `messages.getFeaturedStickers` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getFeaturedStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getFeaturedStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.featured_sticker_sets(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `long` | нет | `0` | + + +#### 79. `ctx.mark_featured_stickers_seen` + +- **MTProto RPC:** `messages.readFeaturedStickers` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.readFeaturedStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.readFeaturedStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.mark_featured_stickers_seen(*, id) +``` + +**Порядок positional slots:** `id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `Vector` | да | — | + + +#### 80. `ctx.recent_stickers` + +- **MTProto RPC:** `messages.getRecentStickers` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getRecentStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getRecentStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.recent_stickers(*, attached=None, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `attached` | `flags.0?true` | нет | поле пропускается | +| `hash` | `long` | нет | `0` | + + +#### 81. `ctx.set_sticker_recent` + +- **MTProto RPC:** `messages.saveRecentSticker` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.saveRecentSticker`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.saveRecentSticker`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_sticker_recent(*, attached=None, id, unsave) +``` + +**Порядок positional slots:** `id, unsave`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `attached` | `flags.0?true` | нет | поле пропускается | +| `id` | `InputDocument` | да | — | +| `unsave` | `Bool` | да | — | + + +#### 82. `ctx.clear_recent_stickers` + +- **MTProto RPC:** `messages.clearRecentStickers` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.clearRecentStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.clearRecentStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.clear_recent_stickers(*, attached=None) +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `attached` | `flags.0?true` | нет | поле пропускается | + + +#### 83. `ctx.archived_sticker_sets` + +- **MTProto RPC:** `messages.getArchivedStickers` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getArchivedStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getArchivedStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.archived_sticker_sets(*, masks=None, emojis=None, offset_id=0, limit=50) +``` + +**Порядок positional slots:** `offset_id, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `masks` | `flags.0?true` | нет | поле пропускается | +| `emojis` | `flags.1?true` | нет | поле пропускается | +| `offset_id` | `long` | нет | `0` | +| `limit` | `int` | нет | `50` | + + +#### 84. `ctx.installed_masks` + +- **MTProto RPC:** `messages.getMaskStickers` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getMaskStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getMaskStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.installed_masks(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `long` | нет | `0` | + + +#### 85. `ctx.media_sticker_sets` + +- **MTProto RPC:** `messages.getAttachedStickers` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getAttachedStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getAttachedStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.media_sticker_sets(*, media) +``` + +**Порядок positional slots:** `media`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `media` | `InputStickeredMedia` | да | — | + + +#### 86. `ctx.favorite_stickers` + +- **MTProto RPC:** `messages.getFavedStickers` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getFavedStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getFavedStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.favorite_stickers(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `long` | нет | `0` | + + +#### 87. `ctx.set_sticker_favorite` + +- **MTProto RPC:** `messages.faveSticker` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.faveSticker`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.faveSticker`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_sticker_favorite(*, id, unfave) +``` + +**Порядок positional slots:** `id, unfave`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `InputDocument` | да | — | +| `unfave` | `Bool` | да | — | + + +#### 88. `ctx.search_sticker_sets` + +- **MTProto RPC:** `messages.searchStickerSets` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.searchStickerSets`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.searchStickerSets`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.search_sticker_sets(*, exclude_featured=None, q, hash=0) +``` + +**Порядок positional slots:** `q, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `exclude_featured` | `flags.0?true` | нет | поле пропускается | +| `q` | `string` | да | — | +| `hash` | `long` | нет | `0` | + + +#### 89. `ctx.bulk_sticker_set_action` + +- **MTProto RPC:** `messages.toggleStickerSets` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.toggleStickerSets`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.toggleStickerSets`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.bulk_sticker_set_action(*, uninstall=None, archive=None, unarchive=None, stickersets) +``` + +**Порядок positional slots:** `stickersets`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `uninstall` | `flags.0?true` | нет | поле пропускается | +| `archive` | `flags.1?true` | нет | поле пропускается | +| `unarchive` | `flags.2?true` | нет | поле пропускается | +| `stickersets` | `Vector` | да | — | + + +#### 90. `ctx.older_featured_sticker_sets` + +- **MTProto RPC:** `messages.getOldFeaturedStickers` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getOldFeaturedStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getOldFeaturedStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.older_featured_sticker_sets(*, offset=0, limit=50, hash=0) +``` + +**Порядок positional slots:** `offset, limit, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `offset` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | +| `hash` | `long` | нет | `0` | + + +#### 91. `ctx.custom_emoji_documents` + +- **MTProto RPC:** `messages.getCustomEmojiDocuments` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getCustomEmojiDocuments`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getCustomEmojiDocuments`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.custom_emoji_documents(*, document_id) +``` + +**Порядок positional slots:** `document_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `document_id` | `Vector` | да | — | + + +#### 92. `ctx.installed_emoji_sets` + +- **MTProto RPC:** `messages.getEmojiStickers` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getEmojiStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getEmojiStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.installed_emoji_sets(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `long` | нет | `0` | + + +#### 93. `ctx.featured_emoji_sets` + +- **MTProto RPC:** `messages.getFeaturedEmojiStickers` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getFeaturedEmojiStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getFeaturedEmojiStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.featured_emoji_sets(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `long` | нет | `0` | + + +#### 94. `ctx.search_custom_emoji` + +- **MTProto RPC:** `messages.searchCustomEmoji` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.searchCustomEmoji`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.searchCustomEmoji`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.search_custom_emoji(*, emoticon, hash=0) +``` + +**Порядок positional slots:** `emoticon, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `emoticon` | `string` | да | — | +| `hash` | `long` | нет | `0` | + + +#### 95. `ctx.search_emoji_sets` + +- **MTProto RPC:** `messages.searchEmojiStickerSets` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.searchEmojiStickerSets`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.searchEmojiStickerSets`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.search_emoji_sets(*, exclude_featured=None, q, hash=0) +``` + +**Порядок positional slots:** `q, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `exclude_featured` | `flags.0?true` | нет | поле пропускается | +| `q` | `string` | да | — | +| `hash` | `long` | нет | `0` | + + +#### 96. `ctx.owned_sticker_sets` + +- **MTProto RPC:** `messages.getMyStickers` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getMyStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getMyStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.owned_sticker_sets(*, offset_id=0, limit=50) +``` + +**Порядок positional slots:** `offset_id, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `offset_id` | `long` | нет | `0` | +| `limit` | `int` | нет | `50` | + + +#### 97. `ctx.search_stickers` + +- **MTProto RPC:** `messages.searchStickers` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.searchStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.searchStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.search_stickers(*, emojis=None, q, emoticon, lang_code, offset=0, limit=50, hash=0) +``` + +**Порядок positional slots:** `q, emoticon, lang_code, offset, limit, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `emojis` | `flags.0?true` | нет | поле пропускается | +| `q` | `string` | да | — | +| `emoticon` | `string` | да | — | +| `lang_code` | `Vector` | да | — | +| `offset` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | +| `hash` | `long` | нет | `0` | + + +#### 98. `ctx.create_sticker_set` + +- **MTProto RPC:** `stickers.createStickerSet` +- **Namespace:** `stickers` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stickers.createStickerSet`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stickers.createStickerSet`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.create_sticker_set(*, masks=None, emojis=None, text_color=None, user_id, title, short_name, thumb=None, stickers, software=None) +``` + +**Порядок positional slots:** `user_id, title, short_name, stickers`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `masks` | `flags.0?true` | нет | поле пропускается | +| `emojis` | `flags.5?true` | нет | поле пропускается | +| `text_color` | `flags.6?true` | нет | поле пропускается | +| `user_id` | `InputUser` | да | — | +| `title` | `string` | да | — | +| `short_name` | `string` | да | — | +| `thumb` | `flags.2?InputDocument` | нет | поле пропускается | +| `stickers` | `Vector` | да | — | +| `software` | `flags.3?string` | нет | поле пропускается | + + +#### 99. `ctx.remove_sticker` + +- **MTProto RPC:** `stickers.removeStickerFromSet` +- **Namespace:** `stickers` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stickers.removeStickerFromSet`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stickers.removeStickerFromSet`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_sticker(*, sticker) +``` + +**Порядок positional slots:** `sticker`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `sticker` | `InputDocument` | да | — | + + +#### 100. `ctx.move_sticker` + +- **MTProto RPC:** `stickers.changeStickerPosition` +- **Namespace:** `stickers` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stickers.changeStickerPosition`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stickers.changeStickerPosition`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.move_sticker(*, sticker, position) +``` + +**Порядок positional slots:** `sticker, position`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `sticker` | `InputDocument` | да | — | +| `position` | `int` | да | — | + + +#### 101. `ctx.add_sticker` + +- **MTProto RPC:** `stickers.addStickerToSet` +- **Namespace:** `stickers` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stickers.addStickerToSet`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stickers.addStickerToSet`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.add_sticker(*, stickerset, sticker) +``` + +**Порядок positional slots:** `stickerset, sticker`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `stickerset` | `InputStickerSet` | да | — | +| `sticker` | `InputStickerSetItem` | да | — | + + +#### 102. `ctx.set_sticker_set_thumbnail` + +- **MTProto RPC:** `stickers.setStickerSetThumb` +- **Namespace:** `stickers` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stickers.setStickerSetThumb`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stickers.setStickerSetThumb`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_sticker_set_thumbnail(*, stickerset, thumb=None, thumb_document_id=None) +``` + +**Порядок positional slots:** `stickerset`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `stickerset` | `InputStickerSet` | да | — | +| `thumb` | `flags.0?InputDocument` | нет | поле пропускается | +| `thumb_document_id` | `flags.1?long` | нет | поле пропускается | + + +#### 103. `ctx.check_sticker_set_name` + +- **MTProto RPC:** `stickers.checkShortName` +- **Namespace:** `stickers` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stickers.checkShortName`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stickers.checkShortName`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.check_sticker_set_name(*, short_name) +``` + +**Порядок positional slots:** `short_name`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `short_name` | `string` | да | — | + + +#### 104. `ctx.suggest_sticker_set_name` + +- **MTProto RPC:** `stickers.suggestShortName` +- **Namespace:** `stickers` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stickers.suggestShortName`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stickers.suggestShortName`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.suggest_sticker_set_name(*, title) +``` + +**Порядок positional slots:** `title`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `title` | `string` | да | — | + + +#### 105. `ctx.edit_sticker_metadata` + +- **MTProto RPC:** `stickers.changeSticker` +- **Namespace:** `stickers` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stickers.changeSticker`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stickers.changeSticker`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.edit_sticker_metadata(*, sticker, emoji=None, mask_coords=None, keywords=None) +``` + +**Порядок positional slots:** `sticker`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `sticker` | `InputDocument` | да | — | +| `emoji` | `flags.0?string` | нет | поле пропускается | +| `mask_coords` | `flags.1?MaskCoords` | нет | поле пропускается | +| `keywords` | `flags.2?string` | нет | поле пропускается | + + +#### 106. `ctx.rename_sticker_set` + +- **MTProto RPC:** `stickers.renameStickerSet` +- **Namespace:** `stickers` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stickers.renameStickerSet`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stickers.renameStickerSet`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.rename_sticker_set(*, stickerset, title) +``` + +**Порядок positional slots:** `stickerset, title`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `stickerset` | `InputStickerSet` | да | — | +| `title` | `string` | да | — | + + +#### 107. `ctx.remove_sticker_set` + +- **MTProto RPC:** `stickers.deleteStickerSet` +- **Namespace:** `stickers` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stickers.deleteStickerSet`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stickers.deleteStickerSet`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_sticker_set(*, stickerset) +``` + +**Порядок positional slots:** `stickerset`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `stickerset` | `InputStickerSet` | да | — | + + +#### 108. `ctx.replace_sticker` + +- **MTProto RPC:** `stickers.replaceSticker` +- **Namespace:** `stickers` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stickers.replaceSticker`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stickers.replaceSticker`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.replace_sticker(*, sticker, new_sticker) +``` + +**Порядок positional slots:** `sticker, new_sticker`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `sticker` | `InputDocument` | да | — | +| `new_sticker` | `InputStickerSetItem` | да | — | + + +#### 109. `ctx.contact_ids` + +- **MTProto RPC:** `contacts.getContactIDs` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.getContactIDs`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.getContactIDs`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.contact_ids(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `long` | нет | `0` | + + +#### 110. `ctx.contact_statuses` + +- **MTProto RPC:** `contacts.getStatuses` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.getStatuses`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.getStatuses`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.contact_statuses() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 111. `ctx.contacts_list` + +- **MTProto RPC:** `contacts.getContacts` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.getContacts`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.getContacts`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.contacts_list(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `long` | нет | `0` | + + +#### 112. `ctx.import_contacts` + +- **MTProto RPC:** `contacts.importContacts` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.importContacts`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.importContacts`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.import_contacts(*, contacts) +``` + +**Порядок positional slots:** `contacts`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `contacts` | `Vector` | да | — | + + +#### 113. `ctx.remove_contacts` + +- **MTProto RPC:** `contacts.deleteContacts` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.deleteContacts`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.deleteContacts`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_contacts(*, id) +``` + +**Порядок positional slots:** `id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `Vector` | да | — | + + +#### 114. `ctx.remove_contacts_by_phone` + +- **MTProto RPC:** `contacts.deleteByPhones` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.deleteByPhones`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.deleteByPhones`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_contacts_by_phone(*, phones) +``` + +**Порядок positional slots:** `phones`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `phones` | `Vector` | да | — | + + +#### 115. `ctx.block_peer` + +- **MTProto RPC:** `contacts.block` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.block`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.block`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.block_peer(*, my_stories_from=None, id) +``` + +**Порядок positional slots:** `id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `my_stories_from` | `flags.0?true` | нет | поле пропускается | +| `id` | `InputPeer` | да | — | + + +#### 116. `ctx.unblock_peer` + +- **MTProto RPC:** `contacts.unblock` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.unblock`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.unblock`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.unblock_peer(*, my_stories_from=None, id) +``` + +**Порядок positional slots:** `id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `my_stories_from` | `flags.0?true` | нет | поле пропускается | +| `id` | `InputPeer` | да | — | + + +#### 117. `ctx.blocked_peers` + +- **MTProto RPC:** `contacts.getBlocked` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.getBlocked`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.getBlocked`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.blocked_peers(*, my_stories_from=None, offset=0, limit=50) +``` + +**Порядок positional slots:** `offset, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `my_stories_from` | `flags.0?true` | нет | поле пропускается | +| `offset` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | + + +#### 118. `ctx.search_public_peers` + +- **MTProto RPC:** `contacts.search` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.search`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.search`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.search_public_peers(*, broadcasts=None, bots=None, q, limit=50) +``` + +**Порядок positional slots:** `q, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `broadcasts` | `flags.0?true` | нет | поле пропускается | +| `bots` | `flags.1?true` | нет | поле пропускается | +| `q` | `string` | да | — | +| `limit` | `int` | нет | `50` | + + +#### 119. `ctx.frequent_peers` + +- **MTProto RPC:** `contacts.getTopPeers` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.getTopPeers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.getTopPeers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.frequent_peers(*, correspondents=None, bots_pm=None, bots_inline=None, phone_calls=None, forward_users=None, forward_chats=None, groups=None, channels=None, bots_app=None, bots_guestchat=None, offset=0, limit=50, hash=0) +``` + +**Порядок positional slots:** `offset, limit, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `correspondents` | `flags.0?true` | нет | поле пропускается | +| `bots_pm` | `flags.1?true` | нет | поле пропускается | +| `bots_inline` | `flags.2?true` | нет | поле пропускается | +| `phone_calls` | `flags.3?true` | нет | поле пропускается | +| `forward_users` | `flags.4?true` | нет | поле пропускается | +| `forward_chats` | `flags.5?true` | нет | поле пропускается | +| `groups` | `flags.10?true` | нет | поле пропускается | +| `channels` | `flags.15?true` | нет | поле пропускается | +| `bots_app` | `flags.16?true` | нет | поле пропускается | +| `bots_guestchat` | `flags.17?true` | нет | поле пропускается | +| `offset` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | +| `hash` | `long` | нет | `0` | + + +#### 120. `ctx.reset_peer_rating` + +- **MTProto RPC:** `contacts.resetTopPeerRating` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.resetTopPeerRating`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.resetTopPeerRating`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.reset_peer_rating(*, category, peer) +``` + +**Порядок positional slots:** `category, peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `category` | `TopPeerCategory` | да | — | +| `peer` | `InputPeer` | да | — | + + +#### 121. `ctx.clear_imported_contacts` + +- **MTProto RPC:** `contacts.resetSaved` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.resetSaved`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.resetSaved`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.clear_imported_contacts() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 122. `ctx.imported_contacts` + +- **MTProto RPC:** `contacts.getSaved` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.getSaved`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.getSaved`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.imported_contacts() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 123. `ctx.set_frequent_peers_enabled` + +- **MTProto RPC:** `contacts.toggleTopPeers` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.toggleTopPeers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.toggleTopPeers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_frequent_peers_enabled(*, enabled) +``` + +**Порядок positional slots:** `enabled`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `enabled` | `Bool` | да | — | + + +#### 124. `ctx.add_contact` + +- **MTProto RPC:** `contacts.addContact` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.addContact`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.addContact`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.add_contact(*, add_phone_privacy_exception=None, id, first_name, last_name, phone, note=None) +``` + +**Порядок positional slots:** `id, first_name, last_name, phone`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `add_phone_privacy_exception` | `flags.0?true` | нет | поле пропускается | +| `id` | `InputUser` | да | — | +| `first_name` | `string` | да | — | +| `last_name` | `string` | да | — | +| `phone` | `string` | да | — | +| `note` | `flags.1?TextWithEntities` | нет | поле пропускается | + + +#### 125. `ctx.accept_contact` + +- **MTProto RPC:** `contacts.acceptContact` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.acceptContact`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.acceptContact`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.accept_contact(*, id) +``` + +**Порядок positional slots:** `id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `InputUser` | да | — | + + +#### 126. `ctx.set_close_friends` + +- **MTProto RPC:** `contacts.editCloseFriends` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.editCloseFriends`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.editCloseFriends`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_close_friends(*, id) +``` + +**Порядок positional slots:** `id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `Vector` | да | — | + + +#### 127. `ctx.replace_blocklist` + +- **MTProto RPC:** `contacts.setBlocked` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.setBlocked`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.setBlocked`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.replace_blocklist(*, my_stories_from=None, id, limit=50) +``` + +**Порядок positional slots:** `id, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `my_stories_from` | `flags.0?true` | нет | поле пропускается | +| `id` | `Vector` | да | — | +| `limit` | `int` | нет | `50` | + + +#### 128. `ctx.contact_birthdays` + +- **MTProto RPC:** `contacts.getBirthdays` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.getBirthdays`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.getBirthdays`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.contact_birthdays() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 129. `ctx.edit_contact_note` + +- **MTProto RPC:** `contacts.updateContactNote` +- **Namespace:** `contacts` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `contacts.updateContactNote`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `contacts.updateContactNote`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.edit_contact_note(*, id, note) +``` + +**Порядок positional slots:** `id, note`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `InputUser` | да | — | +| `note` | `TextWithEntities` | да | — | + + +#### 130. `ctx.dialogs` + +- **MTProto RPC:** `messages.getDialogs` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getDialogs`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getDialogs`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.dialogs(*, exclude_pinned=None, folder_id=None, offset_date=0, offset_id=0, offset_peer={'_': 'inputPeerEmpty'}, limit=50, hash=0) +``` + +**Порядок positional slots:** `offset_date, offset_id, offset_peer, limit, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `exclude_pinned` | `flags.0?true` | нет | поле пропускается | +| `folder_id` | `flags.1?int` | нет | поле пропускается | +| `offset_date` | `int` | нет | `0` | +| `offset_id` | `int` | нет | `0` | +| `offset_peer` | `InputPeer` | нет | `{'_': 'inputPeerEmpty'}` | +| `limit` | `int` | нет | `50` | +| `hash` | `long` | нет | `0` | + + +#### 131. `ctx.chat_history` + +- **MTProto RPC:** `messages.getHistory` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getHistory`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getHistory`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.chat_history(*, peer=CURRENT_PEER, offset_id=0, offset_date=0, add_offset=0, limit=50, max_id=0, min_id=0, hash=0) +``` + +**Порядок positional slots:** `peer, offset_id, offset_date, add_offset, limit, max_id, min_id, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `offset_id` | `int` | нет | `0` | +| `offset_date` | `int` | нет | `0` | +| `add_offset` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | +| `max_id` | `int` | нет | `0` | +| `min_id` | `int` | нет | `0` | +| `hash` | `long` | нет | `0` | + + +#### 132. `ctx.search_chat_messages` + +- **MTProto RPC:** `messages.search` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.search`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.search`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.search_chat_messages(*, peer=CURRENT_PEER, q, from_id=None, saved_peer_id=None, saved_reaction=None, top_msg_id=None, filter={'_': 'inputMessagesFilterEmpty'}, min_date=0, max_date=0, offset_id=0, add_offset=0, limit=50, max_id=0, min_id=0, hash=0) +``` + +**Порядок positional slots:** `peer, q, filter, min_date, max_date, offset_id, add_offset, limit, max_id, min_id, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `q` | `string` | да | — | +| `from_id` | `flags.0?InputPeer` | нет | поле пропускается | +| `saved_peer_id` | `flags.2?InputPeer` | нет | поле пропускается | +| `saved_reaction` | `flags.3?Vector` | нет | поле пропускается | +| `top_msg_id` | `flags.1?int` | нет | поле пропускается | +| `filter` | `MessagesFilter` | нет | `{'_': 'inputMessagesFilterEmpty'}` | +| `min_date` | `int` | нет | `0` | +| `max_date` | `int` | нет | `0` | +| `offset_id` | `int` | нет | `0` | +| `add_offset` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | +| `max_id` | `int` | нет | `0` | +| `min_id` | `int` | нет | `0` | +| `hash` | `long` | нет | `0` | + + +#### 133. `ctx.mark_chat_read` + +- **MTProto RPC:** `messages.readHistory` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.readHistory`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.readHistory`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.mark_chat_read(*, peer=CURRENT_PEER, max_id) +``` + +**Порядок positional slots:** `peer, max_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `max_id` | `int` | да | — | + + +#### 134. `ctx.clear_chat_history` + +- **MTProto RPC:** `messages.deleteHistory` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.deleteHistory`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.deleteHistory`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.clear_chat_history(*, just_clear=None, revoke=None, peer=CURRENT_PEER, max_id, min_date=None, max_date=None) +``` + +**Порядок positional slots:** `peer, max_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `just_clear` | `flags.0?true` | нет | поле пропускается | +| `revoke` | `flags.1?true` | нет | поле пропускается | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `max_id` | `int` | да | — | +| `min_date` | `flags.2?int` | нет | поле пропускается | +| `max_date` | `flags.3?int` | нет | поле пропускается | + + +#### 135. `ctx.peer_settings` + +- **MTProto RPC:** `messages.getPeerSettings` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getPeerSettings`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getPeerSettings`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.peer_settings(*, peer=CURRENT_PEER) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | + + +#### 136. `ctx.basic_groups` + +- **MTProto RPC:** `messages.getChats` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getChats`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getChats`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.basic_groups(*, id) +``` + +**Порядок positional slots:** `id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `Vector` | да | — | + + +#### 137. `ctx.basic_group_details` + +- **MTProto RPC:** `messages.getFullChat` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getFullChat`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getFullChat`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.basic_group_details(*, chat_id) +``` + +**Порядок positional slots:** `chat_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chat_id` | `long` | да | — | + + +#### 138. `ctx.search_all_messages` + +- **MTProto RPC:** `messages.searchGlobal` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.searchGlobal`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.searchGlobal`, converts contextual parameters and returns the host-processed RPC response body. +- **Политика:** **BLOCKED** в проверенном CapabilityHost. Присутствует в каталоге, но не разрешён; raw `mt` запрет не снимает. + +**Справочная сигнатура (keywords):** + +```text +ctx.search_all_messages(*, broadcasts_only=None, groups_only=None, users_only=None, folder_id=None, community=None, q, filter={'_': 'inputMessagesFilterEmpty'}, min_date=0, max_date=0, offset_rate=0, offset_peer={'_': 'inputPeerEmpty'}, offset_id=0, limit=50) +``` + +**Порядок positional slots:** `q, filter, min_date, max_date, offset_rate, offset_peer, offset_id, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `broadcasts_only` | `flags.1?true` | нет | поле пропускается | +| `groups_only` | `flags.2?true` | нет | поле пропускается | +| `users_only` | `flags.3?true` | нет | поле пропускается | +| `folder_id` | `flags.0?int` | нет | поле пропускается | +| `community` | `flags.4?InputChannel` | нет | поле пропускается | +| `q` | `string` | да | — | +| `filter` | `MessagesFilter` | нет | `{'_': 'inputMessagesFilterEmpty'}` | +| `min_date` | `int` | нет | `0` | +| `max_date` | `int` | нет | `0` | +| `offset_rate` | `int` | нет | `0` | +| `offset_peer` | `InputPeer` | нет | `{'_': 'inputPeerEmpty'}` | +| `offset_id` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | + + +#### 139. `ctx.message_editability` + +- **MTProto RPC:** `messages.getMessageEditData` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getMessageEditData`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getMessageEditData`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.message_editability(*, peer=CURRENT_PEER, id=CURRENT_MESSAGE) +``` + +**Порядок positional slots:** `peer, id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `id` | `int` | нет | `CURRENT_MESSAGE` | + + +#### 140. `ctx.peer_dialogs` + +- **MTProto RPC:** `messages.getPeerDialogs` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getPeerDialogs`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getPeerDialogs`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.peer_dialogs(*, peers) +``` + +**Порядок positional slots:** `peers`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peers` | `Vector` | да | — | + + +#### 141. `ctx.all_drafts` + +- **MTProto RPC:** `messages.getAllDrafts` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getAllDrafts`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getAllDrafts`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.all_drafts() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 142. `ctx.mutual_groups` + +- **MTProto RPC:** `messages.getCommonChats` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getCommonChats`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getCommonChats`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.mutual_groups(*, user_id, max_id=0, limit=50) +``` + +**Порядок positional slots:** `user_id, max_id, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `user_id` | `InputUser` | да | — | +| `max_id` | `long` | нет | `0` | +| `limit` | `int` | нет | `50` | + + +#### 143. `ctx.set_dialog_pinned` + +- **MTProto RPC:** `messages.toggleDialogPin` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.toggleDialogPin`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.toggleDialogPin`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_dialog_pinned(*, pinned=None, peer) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `pinned` | `flags.0?true` | нет | поле пропускается | +| `peer` | `InputDialogPeer` | да | — | + + +#### 144. `ctx.reorder_dialog_pins` + +- **MTProto RPC:** `messages.reorderPinnedDialogs` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.reorderPinnedDialogs`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.reorderPinnedDialogs`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.reorder_dialog_pins(*, force=None, folder_id, order) +``` + +**Порядок positional slots:** `folder_id, order`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `force` | `flags.0?true` | нет | поле пропускается | +| `folder_id` | `int` | да | — | +| `order` | `Vector` | да | — | + + +#### 145. `ctx.pinned_dialogs` + +- **MTProto RPC:** `messages.getPinnedDialogs` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getPinnedDialogs`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getPinnedDialogs`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.pinned_dialogs(*, folder_id) +``` + +**Порядок positional slots:** `folder_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `folder_id` | `int` | да | — | + + +#### 146. `ctx.unread_mentions` + +- **MTProto RPC:** `messages.getUnreadMentions` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getUnreadMentions`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getUnreadMentions`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.unread_mentions(*, peer=CURRENT_PEER, top_msg_id=None, offset_id=0, add_offset=0, limit=50, max_id=0, min_id=0) +``` + +**Порядок positional slots:** `peer, offset_id, add_offset, limit, max_id, min_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `top_msg_id` | `flags.0?int` | нет | поле пропускается | +| `offset_id` | `int` | нет | `0` | +| `add_offset` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | +| `max_id` | `int` | нет | `0` | +| `min_id` | `int` | нет | `0` | + + +#### 147. `ctx.mark_mentions_read` + +- **MTProto RPC:** `messages.readMentions` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.readMentions`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.readMentions`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.mark_mentions_read(*, peer=CURRENT_PEER, top_msg_id=None) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `top_msg_id` | `flags.0?int` | нет | поле пропускается | + + +#### 148. `ctx.recent_live_locations` + +- **MTProto RPC:** `messages.getRecentLocations` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getRecentLocations`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getRecentLocations`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.recent_live_locations(*, peer=CURRENT_PEER, limit=50, hash=0) +``` + +**Порядок positional slots:** `peer, limit, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `limit` | `int` | нет | `50` | +| `hash` | `long` | нет | `0` | + + +#### 149. `ctx.set_dialog_unread` + +- **MTProto RPC:** `messages.markDialogUnread` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.markDialogUnread`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.markDialogUnread`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_dialog_unread(*, unread=None, parent_peer=None, peer) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `unread` | `flags.0?true` | нет | поле пропускается | +| `parent_peer` | `flags.1?InputPeer` | нет | поле пропускается | +| `peer` | `InputDialogPeer` | да | — | + + +#### 150. `ctx.unread_dialog_marks` + +- **MTProto RPC:** `messages.getDialogUnreadMarks` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getDialogUnreadMarks`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getDialogUnreadMarks`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.unread_dialog_marks(*, parent_peer=None) +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `parent_peer` | `flags.0?InputPeer` | нет | поле пропускается | + + +#### 151. `ctx.clear_all_drafts` + +- **MTProto RPC:** `messages.clearAllDrafts` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.clearAllDrafts`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.clearAllDrafts`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.clear_all_drafts() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 152. `ctx.chat_online_count` + +- **MTProto RPC:** `messages.getOnlines` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getOnlines`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getOnlines`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.chat_online_count(*, peer=CURRENT_PEER) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | + + +#### 153. `ctx.message_type_counts` + +- **MTProto RPC:** `messages.getSearchCounters` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getSearchCounters`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getSearchCounters`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.message_type_counts(*, peer=CURRENT_PEER, saved_peer_id=None, top_msg_id=None, filters) +``` + +**Порядок positional slots:** `peer, filters`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `saved_peer_id` | `flags.2?InputPeer` | нет | поле пропускается | +| `top_msg_id` | `flags.0?int` | нет | поле пропускается | +| `filters` | `Vector` | да | — | + + +#### 154. `ctx.dismiss_peer_settings_bar` + +- **MTProto RPC:** `messages.hidePeerSettingsBar` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.hidePeerSettingsBar`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.hidePeerSettingsBar`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.dismiss_peer_settings_bar(*, peer=CURRENT_PEER) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | + + +#### 155. `ctx.mark_discussion_read` + +- **MTProto RPC:** `messages.readDiscussion` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.readDiscussion`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.readDiscussion`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.mark_discussion_read(*, peer=CURRENT_PEER, msg_id=CURRENT_MESSAGE, read_max_id) +``` + +**Порядок positional slots:** `peer, msg_id, read_max_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `msg_id` | `int` | нет | `CURRENT_MESSAGE` | +| `read_max_id` | `int` | да | — | + + +#### 156. `ctx.unpin_all_chat_messages` + +- **MTProto RPC:** `messages.unpinAllMessages` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.unpinAllMessages`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.unpinAllMessages`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.unpin_all_chat_messages(*, peer=CURRENT_PEER, top_msg_id=None, saved_peer_id=None) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `top_msg_id` | `flags.0?int` | нет | поле пропускается | +| `saved_peer_id` | `flags.1?InputPeer` | нет | поле пропускается | + + +#### 157. `ctx.message_readers` + +- **MTProto RPC:** `messages.getMessageReadParticipants` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getMessageReadParticipants`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getMessageReadParticipants`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.message_readers(*, peer=CURRENT_PEER, msg_id=CURRENT_MESSAGE) +``` + +**Порядок positional slots:** `peer, msg_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `msg_id` | `int` | нет | `CURRENT_MESSAGE` | + + +#### 158. `ctx.message_search_calendar` + +- **MTProto RPC:** `messages.getSearchResultsCalendar` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getSearchResultsCalendar`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getSearchResultsCalendar`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.message_search_calendar(*, peer=CURRENT_PEER, saved_peer_id=None, filter={'_': 'inputMessagesFilterEmpty'}, offset_id=0, offset_date=0) +``` + +**Порядок positional slots:** `peer, filter, offset_id, offset_date`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `saved_peer_id` | `flags.2?InputPeer` | нет | поле пропускается | +| `filter` | `MessagesFilter` | нет | `{'_': 'inputMessagesFilterEmpty'}` | +| `offset_id` | `int` | нет | `0` | +| `offset_date` | `int` | нет | `0` | + + +#### 159. `ctx.message_search_positions` + +- **MTProto RPC:** `messages.getSearchResultsPositions` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getSearchResultsPositions`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getSearchResultsPositions`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.message_search_positions(*, peer=CURRENT_PEER, saved_peer_id=None, filter={'_': 'inputMessagesFilterEmpty'}, offset_id=0, limit=50) +``` + +**Порядок positional slots:** `peer, filter, offset_id, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `saved_peer_id` | `flags.2?InputPeer` | нет | поле пропускается | +| `filter` | `MessagesFilter` | нет | `{'_': 'inputMessagesFilterEmpty'}` | +| `offset_id` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | + + +#### 160. `ctx.set_default_send_as` + +- **MTProto RPC:** `messages.saveDefaultSendAs` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.saveDefaultSendAs`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.saveDefaultSendAs`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_default_send_as(*, peer=CURRENT_PEER, send_as) +``` + +**Порядок positional slots:** `peer, send_as`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `send_as` | `InputPeer` | да | — | + + +#### 161. `ctx.sent_media_search` + +- **MTProto RPC:** `messages.searchSentMedia` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.searchSentMedia`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.searchSentMedia`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.sent_media_search(*, q, filter={'_': 'inputMessagesFilterEmpty'}, limit=50) +``` + +**Порядок positional slots:** `q, filter, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `q` | `string` | да | — | +| `filter` | `MessagesFilter` | нет | `{'_': 'inputMessagesFilterEmpty'}` | +| `limit` | `int` | нет | `50` | + + +#### 162. `ctx.outgoing_read_date` + +- **MTProto RPC:** `messages.getOutboxReadDate` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getOutboxReadDate`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getOutboxReadDate`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.outgoing_read_date(*, peer=CURRENT_PEER, msg_id=CURRENT_MESSAGE) +``` + +**Порядок positional slots:** `peer, msg_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `msg_id` | `int` | нет | `CURRENT_MESSAGE` | + + +#### 163. `ctx.channel_message_author` + +- **MTProto RPC:** `channels.getMessageAuthor` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.getMessageAuthor`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.getMessageAuthor`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.channel_message_author(*, channel=CURRENT_PEER, id) +``` + +**Порядок positional slots:** `channel, id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `id` | `int` | да | — | + + +#### 164. `ctx.move_dialogs_to_archive` + +- **MTProto RPC:** `folders.editPeerFolders` +- **Namespace:** `folders` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `folders.editPeerFolders`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `folders.editPeerFolders`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.move_dialogs_to_archive(*, folder_peers) +``` + +**Порядок positional slots:** `folder_peers`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `folder_peers` | `Vector` | да | — | + + +#### 165. `ctx.chat_folders` + +- **MTProto RPC:** `messages.getDialogFilters` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getDialogFilters`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getDialogFilters`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.chat_folders() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 166. `ctx.suggested_chat_folders` + +- **MTProto RPC:** `messages.getSuggestedDialogFilters` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getSuggestedDialogFilters`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getSuggestedDialogFilters`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.suggested_chat_folders() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 167. `ctx.save_chat_folder` + +- **MTProto RPC:** `messages.updateDialogFilter` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.updateDialogFilter`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.updateDialogFilter`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.save_chat_folder(*, id, filter=None) +``` + +**Порядок positional slots:** `id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `int` | да | — | +| `filter` | `flags.0?DialogFilter` | нет | поле пропускается | + + +#### 168. `ctx.reorder_chat_folders` + +- **MTProto RPC:** `messages.updateDialogFiltersOrder` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.updateDialogFiltersOrder`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.updateDialogFiltersOrder`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.reorder_chat_folders(*, order) +``` + +**Порядок positional slots:** `order`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `order` | `Vector` | да | — | + + +#### 169. `ctx.set_folder_tags_visible` + +- **MTProto RPC:** `messages.toggleDialogFilterTags` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.toggleDialogFilterTags`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.toggleDialogFilterTags`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_folder_tags_visible(*, enabled) +``` + +**Порядок positional slots:** `enabled`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `enabled` | `Bool` | да | — | + + +#### 170. `ctx.share_chat_folder` + +- **MTProto RPC:** `chatlists.exportChatlistInvite` +- **Namespace:** `chatlists` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `chatlists.exportChatlistInvite`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `chatlists.exportChatlistInvite`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.share_chat_folder(*, chatlist, title, peers) +``` + +**Порядок positional slots:** `chatlist, title, peers`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chatlist` | `InputChatlist` | да | — | +| `title` | `string` | да | — | +| `peers` | `Vector` | да | — | + + +#### 171. `ctx.remove_folder_invite` + +- **MTProto RPC:** `chatlists.deleteExportedInvite` +- **Namespace:** `chatlists` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `chatlists.deleteExportedInvite`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `chatlists.deleteExportedInvite`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_folder_invite(*, chatlist, slug) +``` + +**Порядок positional slots:** `chatlist, slug`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chatlist` | `InputChatlist` | да | — | +| `slug` | `string` | да | — | + + +#### 172. `ctx.edit_folder_invite` + +- **MTProto RPC:** `chatlists.editExportedInvite` +- **Namespace:** `chatlists` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `chatlists.editExportedInvite`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `chatlists.editExportedInvite`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.edit_folder_invite(*, chatlist, slug, title=None, peers=None) +``` + +**Порядок positional slots:** `chatlist, slug`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chatlist` | `InputChatlist` | да | — | +| `slug` | `string` | да | — | +| `title` | `flags.1?string` | нет | поле пропускается | +| `peers` | `flags.2?Vector` | нет | поле пропускается | + + +#### 173. `ctx.folder_invites` + +- **MTProto RPC:** `chatlists.getExportedInvites` +- **Namespace:** `chatlists` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `chatlists.getExportedInvites`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `chatlists.getExportedInvites`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.folder_invites(*, chatlist) +``` + +**Порядок positional slots:** `chatlist`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chatlist` | `InputChatlist` | да | — | + + +#### 174. `ctx.inspect_folder_invite` + +- **MTProto RPC:** `chatlists.checkChatlistInvite` +- **Namespace:** `chatlists` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `chatlists.checkChatlistInvite`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `chatlists.checkChatlistInvite`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.inspect_folder_invite(*, slug) +``` + +**Порядок positional slots:** `slug`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `slug` | `string` | да | — | + + +#### 175. `ctx.join_folder_invite` + +- **MTProto RPC:** `chatlists.joinChatlistInvite` +- **Namespace:** `chatlists` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `chatlists.joinChatlistInvite`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `chatlists.joinChatlistInvite`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.join_folder_invite(*, slug, peers) +``` + +**Порядок positional slots:** `slug, peers`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `slug` | `string` | да | — | +| `peers` | `Vector` | да | — | + + +#### 176. `ctx.folder_updates` + +- **MTProto RPC:** `chatlists.getChatlistUpdates` +- **Namespace:** `chatlists` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `chatlists.getChatlistUpdates`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `chatlists.getChatlistUpdates`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.folder_updates(*, chatlist) +``` + +**Порядок positional slots:** `chatlist`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chatlist` | `InputChatlist` | да | — | + + +#### 177. `ctx.accept_folder_updates` + +- **MTProto RPC:** `chatlists.joinChatlistUpdates` +- **Namespace:** `chatlists` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `chatlists.joinChatlistUpdates`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `chatlists.joinChatlistUpdates`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.accept_folder_updates(*, chatlist, peers) +``` + +**Порядок positional slots:** `chatlist, peers`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chatlist` | `InputChatlist` | да | — | +| `peers` | `Vector` | да | — | + + +#### 178. `ctx.dismiss_folder_updates` + +- **MTProto RPC:** `chatlists.hideChatlistUpdates` +- **Namespace:** `chatlists` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `chatlists.hideChatlistUpdates`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `chatlists.hideChatlistUpdates`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.dismiss_folder_updates(*, chatlist) +``` + +**Порядок positional slots:** `chatlist`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chatlist` | `InputChatlist` | да | — | + + +#### 179. `ctx.folder_leave_suggestions` + +- **MTProto RPC:** `chatlists.getLeaveChatlistSuggestions` +- **Namespace:** `chatlists` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `chatlists.getLeaveChatlistSuggestions`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `chatlists.getLeaveChatlistSuggestions`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.folder_leave_suggestions(*, chatlist) +``` + +**Порядок positional slots:** `chatlist`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chatlist` | `InputChatlist` | да | — | + + +#### 180. `ctx.leave_shared_folder` + +- **MTProto RPC:** `chatlists.leaveChatlist` +- **Namespace:** `chatlists` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `chatlists.leaveChatlist`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `chatlists.leaveChatlist`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.leave_shared_folder(*, chatlist, peers) +``` + +**Порядок positional slots:** `chatlist, peers`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chatlist` | `InputChatlist` | да | — | +| `peers` | `Vector` | да | — | + + +#### 181. `ctx.edit_profile` + +- **MTProto RPC:** `account.updateProfile` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.updateProfile`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.updateProfile`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.edit_profile(*, first_name=None, last_name=None, about=None) +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `first_name` | `flags.0?string` | нет | поле пропускается | +| `last_name` | `flags.1?string` | нет | поле пропускается | +| `about` | `flags.2?string` | нет | поле пропускается | + + +#### 182. `ctx.set_online_status` + +- **MTProto RPC:** `account.updateStatus` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.updateStatus`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.updateStatus`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_online_status(*, offline) +``` + +**Порядок positional slots:** `offline`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `offline` | `Bool` | да | — | + + +#### 183. `ctx.check_profile_username` + +- **MTProto RPC:** `account.checkUsername` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.checkUsername`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.checkUsername`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.check_profile_username(*, username) +``` + +**Порядок positional slots:** `username`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `username` | `string` | да | — | + + +#### 184. `ctx.set_profile_username` + +- **MTProto RPC:** `account.updateUsername` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.updateUsername`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.updateUsername`, converts contextual parameters and returns the host-processed RPC response body. +- **Политика:** **BLOCKED** в проверенном CapabilityHost. Присутствует в каталоге, но не разрешён; raw `mt` запрет не снимает. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_profile_username(*, username) +``` + +**Порядок positional slots:** `username`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `username` | `string` | да | — | + + +#### 185. `ctx.privacy_rules` + +- **MTProto RPC:** `account.getPrivacy` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.getPrivacy`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.getPrivacy`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.privacy_rules(*, key) +``` + +**Порядок positional slots:** `key`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `key` | `InputPrivacyKey` | да | — | + + +#### 186. `ctx.account_inactivity_ttl` + +- **MTProto RPC:** `account.getAccountTTL` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.getAccountTTL`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.getAccountTTL`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.account_inactivity_ttl() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 187. `ctx.set_emoji_status` + +- **MTProto RPC:** `account.updateEmojiStatus` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.updateEmojiStatus`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.updateEmojiStatus`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_emoji_status(*, emoji_status) +``` + +**Порядок positional slots:** `emoji_status`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `emoji_status` | `EmojiStatus` | да | — | + + +#### 188. `ctx.suggested_emoji_statuses` + +- **MTProto RPC:** `account.getDefaultEmojiStatuses` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.getDefaultEmojiStatuses`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.getDefaultEmojiStatuses`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.suggested_emoji_statuses(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `long` | нет | `0` | + + +#### 189. `ctx.recent_emoji_statuses` + +- **MTProto RPC:** `account.getRecentEmojiStatuses` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.getRecentEmojiStatuses`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.getRecentEmojiStatuses`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.recent_emoji_statuses(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `long` | нет | `0` | + + +#### 190. `ctx.clear_recent_emoji_statuses` + +- **MTProto RPC:** `account.clearRecentEmojiStatuses` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.clearRecentEmojiStatuses`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.clearRecentEmojiStatuses`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.clear_recent_emoji_statuses() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 191. `ctx.reorder_profile_usernames` + +- **MTProto RPC:** `account.reorderUsernames` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.reorderUsernames`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.reorderUsernames`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.reorder_profile_usernames(*, order) +``` + +**Порядок positional slots:** `order`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `order` | `Vector` | да | — | + + +#### 192. `ctx.set_profile_username_active` + +- **MTProto RPC:** `account.toggleUsername` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.toggleUsername`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.toggleUsername`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_profile_username_active(*, username, active) +``` + +**Порядок positional slots:** `username, active`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `username` | `string` | да | — | +| `active` | `Bool` | да | — | + + +#### 193. `ctx.profile_photo_emojis` + +- **MTProto RPC:** `account.getDefaultProfilePhotoEmojis` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.getDefaultProfilePhotoEmojis`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.getDefaultProfilePhotoEmojis`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.profile_photo_emojis(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `long` | нет | `0` | + + +#### 194. `ctx.set_profile_color` + +- **MTProto RPC:** `account.updateColor` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.updateColor`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.updateColor`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_profile_color(*, for_profile=None, color=None) +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `for_profile` | `flags.1?true` | нет | поле пропускается | +| `color` | `flags.2?PeerColor` | нет | поле пропускается | + + +#### 195. `ctx.set_birthday` + +- **MTProto RPC:** `account.updateBirthday` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.updateBirthday`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.updateBirthday`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_birthday(*, birthday=None) +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `birthday` | `flags.0?Birthday` | нет | поле пропускается | + + +#### 196. `ctx.set_personal_channel` + +- **MTProto RPC:** `account.updatePersonalChannel` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.updatePersonalChannel`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.updatePersonalChannel`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_personal_channel(*, channel) +``` + +**Порядок positional slots:** `channel`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | да | — | + + +#### 197. `ctx.set_profile_tab` + +- **MTProto RPC:** `account.setMainProfileTab` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.setMainProfileTab`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.setMainProfileTab`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_profile_tab(*, tab) +``` + +**Порядок positional slots:** `tab`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `tab` | `ProfileTab` | да | — | + + +#### 198. `ctx.set_music_saved` + +- **MTProto RPC:** `account.saveMusic` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.saveMusic`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.saveMusic`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_music_saved(*, unsave=None, id, after_id=None) +``` + +**Порядок positional slots:** `id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `unsave` | `flags.0?true` | нет | поле пропускается | +| `id` | `InputDocument` | да | — | +| `after_id` | `flags.1?InputDocument` | нет | поле пропускается | + + +#### 199. `ctx.saved_music_ids` + +- **MTProto RPC:** `account.getSavedMusicIds` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.getSavedMusicIds`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.getSavedMusicIds`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.saved_music_ids(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `long` | нет | `0` | + + +#### 200. `ctx.user_details` + +- **MTProto RPC:** `users.getFullUser` +- **Namespace:** `users` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `users.getFullUser`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `users.getFullUser`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.user_details(*, id) +``` + +**Порядок positional slots:** `id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `InputUser` | да | — | + + +#### 201. `ctx.contact_requirements` + +- **MTProto RPC:** `users.getRequirementsToContact` +- **Namespace:** `users` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `users.getRequirementsToContact`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `users.getRequirementsToContact`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.contact_requirements(*, id) +``` + +**Порядок positional slots:** `id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `Vector` | да | — | + + +#### 202. `ctx.user_music` + +- **MTProto RPC:** `users.getSavedMusic` +- **Namespace:** `users` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `users.getSavedMusic`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `users.getSavedMusic`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.user_music(*, id, offset=0, limit=50, hash=0) +``` + +**Порядок positional slots:** `id, offset, limit, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `InputUser` | да | — | +| `offset` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | +| `hash` | `long` | нет | `0` | + + +#### 203. `ctx.user_music_by_documents` + +- **MTProto RPC:** `users.getSavedMusicByID` +- **Namespace:** `users` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `users.getSavedMusicByID`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `users.getSavedMusicByID`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.user_music_by_documents(*, id, documents) +``` + +**Порядок positional slots:** `id, documents`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `InputUser` | да | — | +| `documents` | `Vector` | да | — | + + +#### 204. `ctx.suggest_contact_birthday` + +- **MTProto RPC:** `users.suggestBirthday` +- **Namespace:** `users` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `users.suggestBirthday`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `users.suggestBirthday`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.suggest_contact_birthday(*, id, birthday) +``` + +**Порядок positional slots:** `id, birthday`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `InputUser` | да | — | +| `birthday` | `Birthday` | да | — | + + +#### 205. `ctx.select_profile_photo` + +- **MTProto RPC:** `photos.updateProfilePhoto` +- **Namespace:** `photos` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `photos.updateProfilePhoto`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `photos.updateProfilePhoto`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.select_profile_photo(*, fallback=None, bot=None, id) +``` + +**Порядок positional slots:** `id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `fallback` | `flags.0?true` | нет | поле пропускается | +| `bot` | `flags.1?InputUser` | нет | поле пропускается | +| `id` | `InputPhoto` | да | — | + + +#### 206. `ctx.upload_profile_photo` + +- **MTProto RPC:** `photos.uploadProfilePhoto` +- **Namespace:** `photos` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `photos.uploadProfilePhoto`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `photos.uploadProfilePhoto`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.upload_profile_photo(*, fallback=None, bot=None, file=None, video=None, video_start_ts=None, video_emoji_markup=None) +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `fallback` | `flags.3?true` | нет | поле пропускается | +| `bot` | `flags.5?InputUser` | нет | поле пропускается | +| `file` | `flags.0?InputFile` | нет | поле пропускается | +| `video` | `flags.1?InputFile` | нет | поле пропускается | +| `video_start_ts` | `flags.2?double` | нет | поле пропускается | +| `video_emoji_markup` | `flags.4?VideoSize` | нет | поле пропускается | + + +#### 207. `ctx.remove_profile_photos` + +- **MTProto RPC:** `photos.deletePhotos` +- **Namespace:** `photos` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `photos.deletePhotos`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `photos.deletePhotos`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_profile_photos(*, id) +``` + +**Порядок positional slots:** `id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `Vector` | да | — | + + +#### 208. `ctx.profile_photos` + +- **MTProto RPC:** `photos.getUserPhotos` +- **Namespace:** `photos` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `photos.getUserPhotos`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `photos.getUserPhotos`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.profile_photos(*, user_id, offset=0, max_id=0, limit=50) +``` + +**Порядок positional slots:** `user_id, offset, max_id, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `user_id` | `InputUser` | да | — | +| `offset` | `int` | нет | `0` | +| `max_id` | `long` | нет | `0` | +| `limit` | `int` | нет | `50` | + + +#### 209. `ctx.set_contact_photo` + +- **MTProto RPC:** `photos.uploadContactProfilePhoto` +- **Namespace:** `photos` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `photos.uploadContactProfilePhoto`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `photos.uploadContactProfilePhoto`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_contact_photo(*, suggest=None, save=None, user_id, file=None, video=None, video_start_ts=None, video_emoji_markup=None) +``` + +**Порядок positional slots:** `user_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `suggest` | `flags.3?true` | нет | поле пропускается | +| `save` | `flags.4?true` | нет | поле пропускается | +| `user_id` | `InputUser` | да | — | +| `file` | `flags.0?InputFile` | нет | поле пропускается | +| `video` | `flags.1?InputFile` | нет | поле пропускается | +| `video_start_ts` | `flags.2?double` | нет | поле пропускается | +| `video_emoji_markup` | `flags.5?VideoSize` | нет | поле пропускается | + + +#### 210. `ctx.notification_settings` + +- **MTProto RPC:** `account.getNotifySettings` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.getNotifySettings`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.getNotifySettings`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.notification_settings(*, peer) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputNotifyPeer` | да | — | + + +#### 211. `ctx.set_notification_settings` + +- **MTProto RPC:** `account.updateNotifySettings` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.updateNotifySettings`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.updateNotifySettings`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_notification_settings(*, peer, settings) +``` + +**Порядок positional slots:** `peer, settings`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputNotifyPeer` | да | — | +| `settings` | `InputPeerNotifySettings` | да | — | + + +#### 212. `ctx.reset_notification_settings` + +- **MTProto RPC:** `account.resetNotifySettings` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.resetNotifySettings`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.resetNotifySettings`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.reset_notification_settings() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 213. `ctx.contact_signup_notifications` + +- **MTProto RPC:** `account.getContactSignUpNotification` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.getContactSignUpNotification`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.getContactSignUpNotification`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.contact_signup_notifications() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 214. `ctx.set_contact_signup_notifications` + +- **MTProto RPC:** `account.setContactSignUpNotification` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.setContactSignUpNotification`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.setContactSignUpNotification`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_contact_signup_notifications(*, silent) +``` + +**Порядок positional slots:** `silent`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `silent` | `Bool` | да | — | + + +#### 215. `ctx.notification_exceptions` + +- **MTProto RPC:** `account.getNotifyExceptions` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.getNotifyExceptions`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.getNotifyExceptions`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.notification_exceptions(*, compare_sound=None, compare_stories=None, peer=None) +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `compare_sound` | `flags.1?true` | нет | поле пропускается | +| `compare_stories` | `flags.2?true` | нет | поле пропускается | +| `peer` | `flags.0?InputNotifyPeer` | нет | поле пропускается | + + +#### 216. `ctx.reaction_notification_settings` + +- **MTProto RPC:** `account.getReactionsNotifySettings` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.getReactionsNotifySettings`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.getReactionsNotifySettings`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.reaction_notification_settings() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 217. `ctx.set_reaction_notification_settings` + +- **MTProto RPC:** `account.setReactionsNotifySettings` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.setReactionsNotifySettings`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.setReactionsNotifySettings`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_reaction_notification_settings(*, settings) +``` + +**Порядок positional slots:** `settings`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `settings` | `ReactionsNotifySettings` | да | — | + + +#### 218. `ctx.saved_notification_sounds` + +- **MTProto RPC:** `account.getSavedRingtones` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.getSavedRingtones`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.getSavedRingtones`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.saved_notification_sounds(*, hash=0) +``` + +**Порядок positional slots:** `hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `hash` | `long` | нет | `0` | + + +#### 219. `ctx.set_notification_sound_saved` + +- **MTProto RPC:** `account.saveRingtone` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.saveRingtone`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.saveRingtone`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_notification_sound_saved(*, id, unsave) +``` + +**Порядок positional slots:** `id, unsave`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `id` | `InputDocument` | да | — | +| `unsave` | `Bool` | да | — | + + +#### 220. `ctx.upload_notification_sound` + +- **MTProto RPC:** `account.uploadRingtone` +- **Namespace:** `account` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `account.uploadRingtone`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `account.uploadRingtone`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.upload_notification_sound(*, file, file_name, mime_type) +``` + +**Порядок positional slots:** `file, file_name, mime_type`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `file` | `InputFile` | да | — | +| `file_name` | `string` | да | — | +| `mime_type` | `string` | да | — | + + +#### 221. `ctx.rename_basic_group` + +- **MTProto RPC:** `messages.editChatTitle` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.editChatTitle`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.editChatTitle`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.rename_basic_group(*, chat_id, title) +``` + +**Порядок positional slots:** `chat_id, title`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chat_id` | `long` | да | — | +| `title` | `string` | да | — | + + +#### 222. `ctx.set_basic_group_photo` + +- **MTProto RPC:** `messages.editChatPhoto` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.editChatPhoto`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.editChatPhoto`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_basic_group_photo(*, chat_id, photo) +``` + +**Порядок positional slots:** `chat_id, photo`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chat_id` | `long` | да | — | +| `photo` | `InputChatPhoto` | да | — | + + +#### 223. `ctx.add_basic_group_member` + +- **MTProto RPC:** `messages.addChatUser` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.addChatUser`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.addChatUser`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.add_basic_group_member(*, chat_id, user_id, fwd_limit=0) +``` + +**Порядок positional slots:** `chat_id, user_id, fwd_limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chat_id` | `long` | да | — | +| `user_id` | `InputUser` | да | — | +| `fwd_limit` | `int` | нет | `0` | + + +#### 224. `ctx.remove_basic_group_member` + +- **MTProto RPC:** `messages.deleteChatUser` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.deleteChatUser`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.deleteChatUser`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_basic_group_member(*, revoke_history=None, chat_id, user_id) +``` + +**Порядок positional slots:** `chat_id, user_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `revoke_history` | `flags.0?true` | нет | поле пропускается | +| `chat_id` | `long` | да | — | +| `user_id` | `InputUser` | да | — | + + +#### 225. `ctx.create_basic_group` + +- **MTProto RPC:** `messages.createChat` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.createChat`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.createChat`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.create_basic_group(*, users, title, ttl_period=None) +``` + +**Порядок positional slots:** `users, title`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `users` | `Vector` | да | — | +| `title` | `string` | да | — | +| `ttl_period` | `flags.0?int` | нет | поле пропускается | + + +#### 226. `ctx.set_basic_group_admin` + +- **MTProto RPC:** `messages.editChatAdmin` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.editChatAdmin`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.editChatAdmin`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_basic_group_admin(*, chat_id, user_id, is_admin) +``` + +**Порядок positional slots:** `chat_id, user_id, is_admin`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chat_id` | `long` | да | — | +| `user_id` | `InputUser` | да | — | +| `is_admin` | `Bool` | да | — | + + +#### 227. `ctx.upgrade_basic_group` + +- **MTProto RPC:** `messages.migrateChat` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.migrateChat`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.migrateChat`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.upgrade_basic_group(*, chat_id) +``` + +**Порядок positional slots:** `chat_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chat_id` | `long` | да | — | + + +#### 228. `ctx.edit_chat_description` + +- **MTProto RPC:** `messages.editChatAbout` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.editChatAbout`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.editChatAbout`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.edit_chat_description(*, peer=CURRENT_PEER, about) +``` + +**Порядок positional slots:** `peer, about`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `about` | `string` | да | — | + + +#### 229. `ctx.set_default_member_restrictions` + +- **MTProto RPC:** `messages.editChatDefaultBannedRights` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.editChatDefaultBannedRights`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.editChatDefaultBannedRights`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_default_member_restrictions(*, peer=CURRENT_PEER, banned_rights) +``` + +**Порядок positional slots:** `peer, banned_rights`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `banned_rights` | `ChatBannedRights` | да | — | + + +#### 230. `ctx.remove_basic_group` + +- **MTProto RPC:** `messages.deleteChat` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.deleteChat`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.deleteChat`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_basic_group(*, chat_id) +``` + +**Порядок positional slots:** `chat_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `chat_id` | `long` | да | — | + + +#### 231. `ctx.set_chat_auto_delete` + +- **MTProto RPC:** `messages.setHistoryTTL` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.setHistoryTTL`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.setHistoryTTL`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_chat_auto_delete(*, peer=CURRENT_PEER, period) +``` + +**Порядок positional slots:** `peer, period`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `period` | `int` | да | — | + + +#### 232. `ctx.set_content_protection` + +- **MTProto RPC:** `messages.toggleNoForwards` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.toggleNoForwards`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.toggleNoForwards`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_content_protection(*, peer=CURRENT_PEER, enabled, request_msg_id=None) +``` + +**Порядок positional slots:** `peer, enabled`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `enabled` | `Bool` | да | — | +| `request_msg_id` | `flags.0?int` | нет | поле пропускается | + + +#### 233. `ctx.mark_channel_read` + +- **MTProto RPC:** `channels.readHistory` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.readHistory`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.readHistory`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.mark_channel_read(*, channel=CURRENT_PEER, max_id) +``` + +**Порядок positional slots:** `channel, max_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `max_id` | `int` | да | — | + + +#### 234. `ctx.channel_members` + +- **MTProto RPC:** `channels.getParticipants` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.getParticipants`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.getParticipants`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.channel_members(*, channel=CURRENT_PEER, filter={'_': 'channelParticipantsRecent'}, offset=0, limit=50, hash) +``` + +**Порядок positional slots:** `channel, filter, offset, limit, hash`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `filter` | `ChannelParticipantsFilter` | нет | `{'_': 'channelParticipantsRecent'}` | +| `offset` | `int` | нет | `0` | +| `limit` | `int` | нет | `50` | +| `hash` | `long` | да | — | + + +#### 235. `ctx.channel_member` + +- **MTProto RPC:** `channels.getParticipant` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.getParticipant`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.getParticipant`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.channel_member(*, channel=CURRENT_PEER, participant) +``` + +**Порядок positional slots:** `channel, participant`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `participant` | `InputPeer` | да | — | + + +#### 236. `ctx.channel_details` + +- **MTProto RPC:** `channels.getFullChannel` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.getFullChannel`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.getFullChannel`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.channel_details(*, channel=CURRENT_PEER) +``` + +**Порядок positional slots:** `channel`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | + + +#### 237. `ctx.create_channel` + +- **MTProto RPC:** `channels.createChannel` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.createChannel`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.createChannel`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.create_channel(*, broadcast=None, megagroup=None, for_import=None, forum=None, title, about, geo_point=None, address=None, ttl_period=None) +``` + +**Порядок positional slots:** `title, about`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `broadcast` | `flags.0?true` | нет | поле пропускается | +| `megagroup` | `flags.1?true` | нет | поле пропускается | +| `for_import` | `flags.3?true` | нет | поле пропускается | +| `forum` | `flags.5?true` | нет | поле пропускается | +| `title` | `string` | да | — | +| `about` | `string` | да | — | +| `geo_point` | `flags.2?InputGeoPoint` | нет | поле пропускается | +| `address` | `flags.2?string` | нет | поле пропускается | +| `ttl_period` | `flags.4?int` | нет | поле пропускается | + + +#### 238. `ctx.set_channel_admin` + +- **MTProto RPC:** `channels.editAdmin` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.editAdmin`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.editAdmin`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_channel_admin(*, channel=CURRENT_PEER, user_id, admin_rights, rank=None) +``` + +**Порядок positional slots:** `channel, user_id, admin_rights`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `user_id` | `InputUser` | да | — | +| `admin_rights` | `ChatAdminRights` | да | — | +| `rank` | `flags.0?string` | нет | поле пропускается | + + +#### 239. `ctx.rename_channel` + +- **MTProto RPC:** `channels.editTitle` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.editTitle`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.editTitle`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.rename_channel(*, channel=CURRENT_PEER, title) +``` + +**Порядок positional slots:** `channel, title`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `title` | `string` | да | — | + + +#### 240. `ctx.set_channel_photo` + +- **MTProto RPC:** `channels.editPhoto` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.editPhoto`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.editPhoto`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_channel_photo(*, channel=CURRENT_PEER, photo) +``` + +**Порядок positional slots:** `channel, photo`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `photo` | `InputChatPhoto` | да | — | + + +#### 241. `ctx.check_channel_username` + +- **MTProto RPC:** `channels.checkUsername` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.checkUsername`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.checkUsername`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.check_channel_username(*, channel=CURRENT_PEER, username) +``` + +**Порядок positional slots:** `channel, username`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `username` | `string` | да | — | + + +#### 242. `ctx.set_channel_username` + +- **MTProto RPC:** `channels.updateUsername` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.updateUsername`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.updateUsername`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_channel_username(*, channel=CURRENT_PEER, username) +``` + +**Порядок positional slots:** `channel, username`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `username` | `string` | да | — | + + +#### 243. `ctx.join_channel` + +- **MTProto RPC:** `channels.joinChannel` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.joinChannel`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.joinChannel`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.join_channel(*, channel=CURRENT_PEER) +``` + +**Порядок positional slots:** `channel`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | + + +#### 244. `ctx.leave_channel` + +- **MTProto RPC:** `channels.leaveChannel` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.leaveChannel`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.leaveChannel`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.leave_channel(*, channel=CURRENT_PEER) +``` + +**Порядок positional slots:** `channel`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | + + +#### 245. `ctx.invite_channel_members` + +- **MTProto RPC:** `channels.inviteToChannel` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.inviteToChannel`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.inviteToChannel`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.invite_channel_members(*, channel=CURRENT_PEER, users) +``` + +**Порядок positional slots:** `channel, users`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `users` | `Vector` | да | — | + + +#### 246. `ctx.remove_channel` + +- **MTProto RPC:** `channels.deleteChannel` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.deleteChannel`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.deleteChannel`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_channel(*, channel=CURRENT_PEER) +``` + +**Порядок positional slots:** `channel`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | + + +#### 247. `ctx.set_channel_signatures` + +- **MTProto RPC:** `channels.toggleSignatures` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.toggleSignatures`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.toggleSignatures`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_channel_signatures(*, signatures_enabled=None, profiles_enabled=None, channel=CURRENT_PEER) +``` + +**Порядок positional slots:** `channel`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `signatures_enabled` | `flags.0?true` | нет | поле пропускается | +| `profiles_enabled` | `flags.1?true` | нет | поле пропускается | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | + + +#### 248. `ctx.owned_public_channels` + +- **MTProto RPC:** `channels.getAdminedPublicChannels` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.getAdminedPublicChannels`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.getAdminedPublicChannels`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.owned_public_channels(*, by_location=None, check_limit=None, for_personal=None, for_community_peer=None) +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `by_location` | `flags.0?true` | нет | поле пропускается | +| `check_limit` | `flags.1?true` | нет | поле пропускается | +| `for_personal` | `flags.2?true` | нет | поле пропускается | +| `for_community_peer` | `flags.3?true` | нет | поле пропускается | + + +#### 249. `ctx.restrict_channel_member` + +- **MTProto RPC:** `channels.editBanned` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.editBanned`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.editBanned`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.restrict_channel_member(*, channel=CURRENT_PEER, participant, banned_rights) +``` + +**Порядок positional slots:** `channel, participant, banned_rights`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `participant` | `InputPeer` | да | — | +| `banned_rights` | `ChatBannedRights` | да | — | + + +#### 250. `ctx.channel_admin_log` + +- **MTProto RPC:** `channels.getAdminLog` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.getAdminLog`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.getAdminLog`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.channel_admin_log(*, channel=CURRENT_PEER, q='', events_filter=None, admins=None, max_id, min_id, limit=50) +``` + +**Порядок positional slots:** `channel, q, max_id, min_id, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `q` | `string` | нет | `''` | +| `events_filter` | `flags.0?ChannelAdminLogEventsFilter` | нет | поле пропускается | +| `admins` | `flags.1?Vector` | нет | поле пропускается | +| `max_id` | `long` | да | — | +| `min_id` | `long` | да | — | +| `limit` | `int` | нет | `50` | + + +#### 251. `ctx.set_group_sticker_set` + +- **MTProto RPC:** `channels.setStickers` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.setStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.setStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_group_sticker_set(*, channel=CURRENT_PEER, stickerset) +``` + +**Порядок positional slots:** `channel, stickerset`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `stickerset` | `InputStickerSet` | да | — | + + +#### 252. `ctx.mark_channel_media_read` + +- **MTProto RPC:** `channels.readMessageContents` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.readMessageContents`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.readMessageContents`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.mark_channel_media_read(*, channel=CURRENT_PEER, id) +``` + +**Порядок positional slots:** `channel, id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `id` | `Vector` | да | — | + + +#### 253. `ctx.clear_channel_history` + +- **MTProto RPC:** `channels.deleteHistory` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.deleteHistory`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.deleteHistory`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.clear_channel_history(*, for_everyone=None, channel=CURRENT_PEER, max_id) +``` + +**Порядок positional slots:** `channel, max_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `for_everyone` | `flags.0?true` | нет | поле пропускается | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `max_id` | `int` | да | — | + + +#### 254. `ctx.set_prehistory_hidden` + +- **MTProto RPC:** `channels.togglePreHistoryHidden` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.togglePreHistoryHidden`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.togglePreHistoryHidden`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_prehistory_hidden(*, channel=CURRENT_PEER, enabled) +``` + +**Порядок positional slots:** `channel, enabled`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `enabled` | `Bool` | да | — | + + +#### 255. `ctx.left_channels` + +- **MTProto RPC:** `channels.getLeftChannels` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.getLeftChannels`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.getLeftChannels`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.left_channels(*, offset=0) +``` + +**Порядок positional slots:** `offset`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `offset` | `int` | нет | `0` | + + +#### 256. `ctx.eligible_discussion_groups` + +- **MTProto RPC:** `channels.getGroupsForDiscussion` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.getGroupsForDiscussion`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.getGroupsForDiscussion`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.eligible_discussion_groups() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 257. `ctx.set_discussion_group` + +- **MTProto RPC:** `channels.setDiscussionGroup` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.setDiscussionGroup`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.setDiscussionGroup`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_discussion_group(*, broadcast, group) +``` + +**Порядок positional slots:** `broadcast, group`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `broadcast` | `InputChannel` | да | — | +| `group` | `InputChannel` | да | — | + + +#### 258. `ctx.set_group_location` + +- **MTProto RPC:** `channels.editLocation` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.editLocation`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.editLocation`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_group_location(*, channel=CURRENT_PEER, geo_point, address) +``` + +**Порядок positional slots:** `channel, geo_point, address`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `geo_point` | `InputGeoPoint` | да | — | +| `address` | `string` | да | — | + + +#### 259. `ctx.set_slow_mode` + +- **MTProto RPC:** `channels.toggleSlowMode` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.toggleSlowMode`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.toggleSlowMode`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_slow_mode(*, channel=CURRENT_PEER, seconds) +``` + +**Порядок positional slots:** `channel, seconds`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `seconds` | `int` | да | — | + + +#### 260. `ctx.inactive_channels` + +- **MTProto RPC:** `channels.getInactiveChannels` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.getInactiveChannels`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.getInactiveChannels`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.inactive_channels() +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| — | — | — | Аргументов нет | + + +#### 261. `ctx.send_as_identities` + +- **MTProto RPC:** `channels.getSendAs` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.getSendAs`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.getSendAs`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.send_as_identities(*, for_paid_reactions=None, for_live_stories=None, peer=CURRENT_PEER) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `for_paid_reactions` | `flags.0?true` | нет | поле пропускается | +| `for_live_stories` | `flags.1?true` | нет | поле пропускается | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | + + +#### 262. `ctx.remove_member_history` + +- **MTProto RPC:** `channels.deleteParticipantHistory` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.deleteParticipantHistory`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.deleteParticipantHistory`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_member_history(*, channel=CURRENT_PEER, participant) +``` + +**Порядок positional slots:** `channel, participant`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `participant` | `InputPeer` | да | — | + + +#### 263. `ctx.set_join_to_send` + +- **MTProto RPC:** `channels.toggleJoinToSend` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.toggleJoinToSend`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.toggleJoinToSend`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_join_to_send(*, channel=CURRENT_PEER, enabled) +``` + +**Порядок positional slots:** `channel, enabled`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `enabled` | `Bool` | да | — | + + +#### 264. `ctx.set_join_requests` + +- **MTProto RPC:** `channels.toggleJoinRequest` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.toggleJoinRequest`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.toggleJoinRequest`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_join_requests(*, apply_to_invites=None, channel=CURRENT_PEER, enabled, guard_bot=None) +``` + +**Порядок positional slots:** `channel, enabled`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `apply_to_invites` | `flags.1?true` | нет | поле пропускается | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `enabled` | `Bool` | да | — | +| `guard_bot` | `flags.0?InputUser` | нет | поле пропускается | + + +#### 265. `ctx.reorder_channel_usernames` + +- **MTProto RPC:** `channels.reorderUsernames` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.reorderUsernames`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.reorderUsernames`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.reorder_channel_usernames(*, channel=CURRENT_PEER, order) +``` + +**Порядок positional slots:** `channel, order`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `order` | `Vector` | да | — | + + +#### 266. `ctx.set_channel_username_active` + +- **MTProto RPC:** `channels.toggleUsername` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.toggleUsername`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.toggleUsername`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_channel_username_active(*, channel=CURRENT_PEER, username, active) +``` + +**Порядок positional slots:** `channel, username, active`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `username` | `string` | да | — | +| `active` | `Bool` | да | — | + + +#### 267. `ctx.deactivate_channel_usernames` + +- **MTProto RPC:** `channels.deactivateAllUsernames` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.deactivateAllUsernames`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.deactivateAllUsernames`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.deactivate_channel_usernames(*, channel=CURRENT_PEER) +``` + +**Порядок positional slots:** `channel`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | + + +#### 268. `ctx.set_antispam` + +- **MTProto RPC:** `channels.toggleAntiSpam` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.toggleAntiSpam`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.toggleAntiSpam`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_antispam(*, channel=CURRENT_PEER, enabled) +``` + +**Порядок positional slots:** `channel, enabled`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `enabled` | `Bool` | да | — | + + +#### 269. `ctx.set_members_hidden` + +- **MTProto RPC:** `channels.toggleParticipantsHidden` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.toggleParticipantsHidden`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.toggleParticipantsHidden`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_members_hidden(*, channel=CURRENT_PEER, enabled) +``` + +**Порядок positional slots:** `channel, enabled`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `enabled` | `Bool` | да | — | + + +#### 270. `ctx.set_channel_color` + +- **MTProto RPC:** `channels.updateColor` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.updateColor`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.updateColor`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_channel_color(*, for_profile=None, channel=CURRENT_PEER, color=None, background_emoji_id=None) +``` + +**Порядок positional slots:** `channel`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `for_profile` | `flags.1?true` | нет | поле пропускается | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `color` | `flags.2?int` | нет | поле пропускается | +| `background_emoji_id` | `flags.0?long` | нет | поле пропускается | + + +#### 271. `ctx.related_channels` + +- **MTProto RPC:** `channels.getChannelRecommendations` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.getChannelRecommendations`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.getChannelRecommendations`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.related_channels(*, channel=None) +``` + +**Порядок positional slots:** нет, только keyword-поля при наличии. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `flags.0?InputChannel` | нет | поле пропускается | + + +#### 272. `ctx.set_channel_emoji_status` + +- **MTProto RPC:** `channels.updateEmojiStatus` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.updateEmojiStatus`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.updateEmojiStatus`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_channel_emoji_status(*, channel=CURRENT_PEER, emoji_status) +``` + +**Порядок positional slots:** `channel, emoji_status`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `emoji_status` | `EmojiStatus` | да | — | + + +#### 273. `ctx.set_group_emoji_set` + +- **MTProto RPC:** `channels.setEmojiStickers` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.setEmojiStickers`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.setEmojiStickers`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_group_emoji_set(*, channel=CURRENT_PEER, stickerset) +``` + +**Порядок positional slots:** `channel, stickerset`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `stickerset` | `InputStickerSet` | да | — | + + +#### 274. `ctx.set_channel_auto_translation` + +- **MTProto RPC:** `channels.toggleAutotranslation` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.toggleAutotranslation`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.toggleAutotranslation`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_channel_auto_translation(*, channel=CURRENT_PEER, enabled) +``` + +**Порядок positional slots:** `channel, enabled`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `enabled` | `Bool` | да | — | + + +#### 275. `ctx.set_channel_profile_tab` + +- **MTProto RPC:** `channels.setMainProfileTab` +- **Namespace:** `channels` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `channels.setMainProfileTab`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `channels.setMainProfileTab`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.set_channel_profile_tab(*, channel=CURRENT_PEER, tab) +``` + +**Порядок positional slots:** `channel, tab`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `tab` | `ProfileTab` | да | — | + + +#### 276. `ctx.edit_member_rank` + +- **MTProto RPC:** `messages.editChatParticipantRank` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.editChatParticipantRank`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.editChatParticipantRank`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.edit_member_rank(*, peer=CURRENT_PEER, participant, rank) +``` + +**Порядок positional slots:** `peer, participant, rank`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `participant` | `InputPeer` | да | — | +| `rank` | `string` | да | — | + + +#### 277. `ctx.create_chat_invite` + +- **MTProto RPC:** `messages.exportChatInvite` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.exportChatInvite`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.exportChatInvite`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.create_chat_invite(*, legacy_revoke_permanent=None, request_needed=None, peer=CURRENT_PEER, expire_date=None, usage_limit=None, title=None) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `legacy_revoke_permanent` | `flags.2?true` | нет | поле пропускается | +| `request_needed` | `flags.3?true` | нет | поле пропускается | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `expire_date` | `flags.0?int` | нет | поле пропускается | +| `usage_limit` | `flags.1?int` | нет | поле пропускается | +| `title` | `flags.4?string` | нет | поле пропускается | +| `subscription_pricing` | `flags.5?StarsSubscriptionPricing` | нельзя передавать | запрещён helper-политикой | + + +#### 278. `ctx.chat_invites` + +- **MTProto RPC:** `messages.getExportedChatInvites` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getExportedChatInvites`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getExportedChatInvites`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.chat_invites(*, revoked=None, peer=CURRENT_PEER, admin_id, offset_date=None, offset_link=None, limit=50) +``` + +**Порядок positional slots:** `peer, admin_id, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `revoked` | `flags.3?true` | нет | поле пропускается | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `admin_id` | `InputUser` | да | — | +| `offset_date` | `flags.2?int` | нет | поле пропускается | +| `offset_link` | `flags.2?string` | нет | поле пропускается | +| `limit` | `int` | нет | `50` | + + +#### 279. `ctx.chat_invite_details` + +- **MTProto RPC:** `messages.getExportedChatInvite` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getExportedChatInvite`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getExportedChatInvite`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.chat_invite_details(*, peer=CURRENT_PEER, link) +``` + +**Порядок positional slots:** `peer, link`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `link` | `string` | да | — | + + +#### 280. `ctx.edit_chat_invite` + +- **MTProto RPC:** `messages.editExportedChatInvite` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.editExportedChatInvite`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.editExportedChatInvite`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.edit_chat_invite(*, revoked=None, peer=CURRENT_PEER, link, expire_date=None, usage_limit=None, request_needed=None, title=None) +``` + +**Порядок positional slots:** `peer, link`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `revoked` | `flags.2?true` | нет | поле пропускается | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `link` | `string` | да | — | +| `expire_date` | `flags.0?int` | нет | поле пропускается | +| `usage_limit` | `flags.1?int` | нет | поле пропускается | +| `request_needed` | `flags.3?Bool` | нет | поле пропускается | +| `title` | `flags.4?string` | нет | поле пропускается | + + +#### 281. `ctx.purge_revoked_chat_invites` + +- **MTProto RPC:** `messages.deleteRevokedExportedChatInvites` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.deleteRevokedExportedChatInvites`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.deleteRevokedExportedChatInvites`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.purge_revoked_chat_invites(*, peer=CURRENT_PEER, admin_id) +``` + +**Порядок positional slots:** `peer, admin_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `admin_id` | `InputUser` | да | — | + + +#### 282. `ctx.remove_chat_invite` + +- **MTProto RPC:** `messages.deleteExportedChatInvite` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.deleteExportedChatInvite`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.deleteExportedChatInvite`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.remove_chat_invite(*, peer=CURRENT_PEER, link) +``` + +**Порядок positional slots:** `peer, link`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `link` | `string` | да | — | + + +#### 283. `ctx.invite_admins` + +- **MTProto RPC:** `messages.getAdminsWithInvites` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getAdminsWithInvites`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getAdminsWithInvites`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.invite_admins(*, peer=CURRENT_PEER) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | + + +#### 284. `ctx.invite_joiners` + +- **MTProto RPC:** `messages.getChatInviteImporters` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.getChatInviteImporters`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.getChatInviteImporters`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.invite_joiners(*, requested=None, subscription_expired=None, peer=CURRENT_PEER, link=None, q=None, offset_date=0, offset_user={'_': 'inputUserEmpty'}, limit=50) +``` + +**Порядок positional slots:** `peer, offset_date, offset_user, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `requested` | `flags.0?true` | нет | поле пропускается | +| `subscription_expired` | `flags.3?true` | нет | поле пропускается | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `link` | `flags.1?string` | нет | поле пропускается | +| `q` | `flags.2?string` | нет | поле пропускается | +| `offset_date` | `int` | нет | `0` | +| `offset_user` | `InputUser` | нет | `{'_': 'inputUserEmpty'}` | +| `limit` | `int` | нет | `50` | + + +#### 285. `ctx.resolve_join_request` + +- **MTProto RPC:** `messages.hideChatJoinRequest` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.hideChatJoinRequest`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.hideChatJoinRequest`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.resolve_join_request(*, approved=None, peer=CURRENT_PEER, user_id) +``` + +**Порядок positional slots:** `peer, user_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `approved` | `flags.0?true` | нет | поле пропускается | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `user_id` | `InputUser` | да | — | + + +#### 286. `ctx.resolve_all_join_requests` + +- **MTProto RPC:** `messages.hideAllChatJoinRequests` +- **Namespace:** `messages` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `messages.hideAllChatJoinRequests`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `messages.hideAllChatJoinRequests`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.resolve_all_join_requests(*, approved=None, peer=CURRENT_PEER, link=None) +``` + +**Порядок positional slots:** `peer`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `approved` | `flags.0?true` | нет | поле пропускается | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `link` | `flags.1?string` | нет | поле пропускается | + + +#### 287. `ctx.channel_statistics` + +- **MTProto RPC:** `stats.getBroadcastStats` +- **Namespace:** `stats` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stats.getBroadcastStats`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stats.getBroadcastStats`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.channel_statistics(*, dark=None, channel=CURRENT_PEER) +``` + +**Порядок positional slots:** `channel`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `dark` | `flags.0?true` | нет | поле пропускается | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | + + +#### 288. `ctx.supergroup_statistics` + +- **MTProto RPC:** `stats.getMegagroupStats` +- **Namespace:** `stats` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stats.getMegagroupStats`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stats.getMegagroupStats`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.supergroup_statistics(*, dark=None, channel=CURRENT_PEER) +``` + +**Порядок positional slots:** `channel`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `dark` | `flags.0?true` | нет | поле пропускается | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | + + +#### 289. `ctx.message_statistics` + +- **MTProto RPC:** `stats.getMessageStats` +- **Namespace:** `stats` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stats.getMessageStats`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stats.getMessageStats`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.message_statistics(*, dark=None, channel=CURRENT_PEER, msg_id) +``` + +**Порядок positional slots:** `channel, msg_id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `dark` | `flags.0?true` | нет | поле пропускается | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `msg_id` | `int` | да | — | + + +#### 290. `ctx.message_public_forwards` + +- **MTProto RPC:** `stats.getMessagePublicForwards` +- **Namespace:** `stats` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stats.getMessagePublicForwards`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stats.getMessagePublicForwards`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.message_public_forwards(*, channel=CURRENT_PEER, msg_id, offset='', limit=50) +``` + +**Порядок positional slots:** `channel, msg_id, offset, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `channel` | `InputChannel` | нет | `CURRENT_PEER` | +| `msg_id` | `int` | да | — | +| `offset` | `string` | нет | `''` | +| `limit` | `int` | нет | `50` | + + +#### 291. `ctx.story_statistics` + +- **MTProto RPC:** `stats.getStoryStats` +- **Namespace:** `stats` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stats.getStoryStats`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stats.getStoryStats`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.story_statistics(*, dark=None, peer=CURRENT_PEER, id=CURRENT_MESSAGE) +``` + +**Порядок positional slots:** `peer, id`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `dark` | `flags.0?true` | нет | поле пропускается | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `id` | `int` | нет | `CURRENT_MESSAGE` | + + +#### 292. `ctx.story_public_forwards` + +- **MTProto RPC:** `stats.getStoryPublicForwards` +- **Namespace:** `stats` +- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом. +- **Описание (RU):** Вызывает `stats.getStoryPublicForwards`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа. +- **Description (EN):** Calls `stats.getStoryPublicForwards`, converts contextual parameters and returns the host-processed RPC response body. +- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше. + +**Справочная сигнатура (keywords):** + +```text +ctx.story_public_forwards(*, peer=CURRENT_PEER, id=CURRENT_MESSAGE, offset='', limit=50) +``` + +**Порядок positional slots:** `peer, id, offset, limit`. + +| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус | +| --- | --- | --- | --- | +| `peer` | `InputPeer` | нет | `CURRENT_PEER` | +| `id` | `int` | нет | `CURRENT_MESSAGE` | +| `offset` | `string` | нет | `''` | +| `limit` | `int` | нет | `50` | + + +## Приложение D. Самостоятельный проверочный скрипт + +Код ниже полностью включён в этот SKILL.md. **Для работы скилла сохранять скрипт +не требуется.** Только для сверки API по конкретным исходникам можно скопировать +этот блок во временный `inspect_api.py` и запустить: + +```text +python inspect_api.py --section catalog +python inspect_api.py --section tools +python inspect_api.py --section helpers +python inspect_api.py --section catalog --format markdown --output catalog.md +``` + +Это не установка и не запуск Hotaru: скрипт читает AST четырёх исходных файлов, +вычисляет SHA-256 и печатает JSON либо Markdown. Без `--output` файлы не записывает. +Он не импортирует ядро, не ставит пакеты, не подключается к Telegram и не выполняет +код проверяемых модулей. Запускай Python без `-O`, если используешь проверки assert +из других примеров документа. Сгенерированные карточки — документация, а не доказательство +успешного live RPC. Не сохраняй secrets в аргументах или выходном файле. + +```python +from __future__ import annotations + +"""Render source-derived Hotaru inventory as Markdown method cards.""" + + +from typing import Any + + +def cell(value: str) -> str: + return value.replace("|", "|").replace("\n", " ") + + +def default_repr(value: Any) -> str: + placeholders = {"$peer": "CURRENT_PEER", "$message": "CURRENT_MESSAGE", "$random": "RANDOM_ID"} + return placeholders.get(value, repr(value)) if isinstance(value, str) else repr(value) + + +def call_signature(record: dict[str, Any]) -> str: + parameters = [] + for name in record["field_types"]: + if name in record["forbidden"]: + continue + if name in record["defaults"]: + parameters.append(name + "=" + default_repr(record["defaults"][name])) + elif name not in record["positional_order"]: + parameters.append(name + "=None") + else: + parameters.append(name) + return ( + "ctx." + record["name"] + "(" + ("*, " if parameters else "") + ", ".join(parameters) + ")" + ) + + +def render_catalog(inventory: dict[str, Any]) -> str: + records = inventory["catalog"] + lines = [ + "# Hotaru: полные карточки контекстных методов", + "", + f"{len(records)} карточки, сформированные из AST исходников Hotaru; без импорта ядра и Telegram RPC.", + "Базовый снимок скилла: `8cab560e2b9dbc009aab4670c8a78a9a790e2d1a`, 2026-11-09.", + "При регенерации по другой версии актуальность определяют SHA-256 ниже, а не эта отметка.", + "", + "## Как читать карточки", + "", + "- Это справочные сигнатуры в стиле Python, не исполняемые вызовы: `*` означает", + " рекомендуемые keyword-аргументы; реальные positional slots указаны отдельно.", + "- Все операции асинхронные: в handler используй `await ctx.(...)`.", + "- `CURRENT_PEER`, `CURRENT_MESSAGE`, `RANDOM_ID` обозначают defaults ядра,", + " а не имена, которые нужно объявлять в модуле. Обычно соответствующий keyword пропускают.", + "- TL `flags.N?T` — optional поле; `Vector` — последовательность; типы сохраняют", + " запись исходной TL-схемы и не являются готовыми Python-аннотациями.", + "- «Обязательный» означает: вызывающий обязан передать значение, поскольку ядро", + " не подставляет default. Наличие обязательного TL-поля не исключает default ядра.", + "- Optional `None` в справочной сигнатуре означает пропуск поля, не обязательную", + " отправку None в Telegram. Keyword со статусом «запрещён» передавать нельзя.", + "- **Результат: `Any`, зависит от RPC.** CTX_CATALOG не хранит тип результата,", + " а host распаковывает/фильтрует response. Непроверенные returns сайта не копируются.", + " Для конкретного результата сверяй TL result schema используемого GoyGram и host adapter.", + "- «Без raw mt» не отменяет ACL Telegram, denylist, Premium, media/assets, net,", + " state и другие ограничения всей операции. Подробности: [контракт текущего SKILL.md](#context-contract).", + "", + "## Контроль источников", + "", + "| Файл | SHA-256 содержимого |", + "| --- | --- |", + ] + for path, digest in inventory["source_sha256"].items(): + lines.append(f"| `{path}` | `{digest}` |") + lines += ["", "## Навигация по namespace", ""] + namespaces = dict.fromkeys(record["rpc"].split(".", 1)[0] for record in records) + for namespace in namespaces: + subset = [record for record in records if record["rpc"].startswith(namespace + ".")] + links = ", ".join(f"[{record['name']}](#ctx-{record['name']})" for record in subset) + lines.append(f"- **{namespace} ({len(subset)}):** {links}") + lines += ["", "## Карточки методов", ""] + for number, record in enumerate(records, 1): + name = record["name"] + rpc = record["rpc"] + namespace = rpc.split(".", 1)[0] + lines += [ + f'', + f"### {number}. `ctx.{name}`", + "", + f"- **MTProto RPC:** `{rpc}`", + f"- **Namespace:** `{namespace}`", + "- **Результат:** `Any` — форма зависит от RPC и распаковки host; точный тип не подтверждён этим каталогом.", + "- **Описание (RU):** Вызывает `" + rpc + "`, преобразует контекстные параметры и возвращает обработанное ядром тело ответа.", + "- **Description (EN):** Calls `" + rpc + "`, converts contextual parameters and returns the host-processed RPC response body.", + ] + if record["policy_blocked"]: + lines.append("- **Политика:** **BLOCKED** в проверенном CapabilityHost. Присутствует в каталоге, но не разрешён; raw `mt` запрет не снимает.") + else: + lines.append("- **Capabilities:** контекстный маршрут не требует raw `mt`; дополнительные права/ограничения см. выше.") + positional = ", ".join(record["positional_order"]) + lines += [ + "", + "**Справочная сигнатура (keywords):**", + "", + "```text", + call_signature(record), + "```", + "", + "**Порядок positional slots:** " + (f"`{positional}`." if positional else "нет, только keyword-поля при наличии."), + "", + "| Параметр | TL-тип | Обязательный для вызова | Default ядра / статус |", + "| --- | --- | --- | --- |", + ] + for parameter, kind in record["field_types"].items(): + if parameter in record["forbidden"]: + required, default = "нельзя передавать", "запрещён helper-политикой" + elif parameter in record["defaults"]: + required, default = "нет", "`" + default_repr(record["defaults"][parameter]) + "`" + elif parameter in record["positional_order"]: + required, default = "да", "—" + else: + required, default = "нет", "поле пропускается" + lines.append(f"| `{parameter}` | `{cell(kind)}` | {required} | {cell(default)} |") + if not record["field_types"]: + lines.append("| — | — | — | Аргументов нет |") + lines.append("") + return "\n".join(lines).rstrip() + +"""Read-only inventory of Hotaru API from source AST; never imports Hotaru.""" + + +import argparse +import ast +import copy +import hashlib +import json +import sys +from pathlib import Path + + +def source_tree(root: Path, relative: str) -> tuple[str, ast.Module]: + source = (root / relative).read_text(encoding="utf-8") + return source, ast.parse(source, filename=relative) + + +def assignment(tree: ast.Module, name: str) -> ast.expr: + for node in tree.body: + if isinstance(node, ast.AnnAssign) and isinstance(node.target, ast.Name): + if node.target.id == name and node.value is not None: + return node.value + if isinstance(node, ast.Assign): + if any(isinstance(target, ast.Name) and target.id == name for target in node.targets): + return node.value + raise ValueError(f"No top-level assignment for {name}") + + +def signature(node: ast.FunctionDef | ast.AsyncFunctionDef, drop_self: bool = False) -> str: + args = copy.deepcopy(node.args) + if drop_self: + positional = args.posonlyargs if args.posonlyargs else args.args + if not positional or positional[0].arg != "self": + raise ValueError("Expected self as the first method argument") + positional.pop(0) + result = f"{node.name}({ast.unparse(args)})" + if node.returns is not None: + result += " -> " + ast.unparse(node.returns) + return result + + +def main() -> None: + parser = argparse.ArgumentParser(description=__doc__) + parser.add_argument("root", type=Path) + parser.add_argument("--section", choices=("catalog", "tools", "helpers", "all"), default="all") + parser.add_argument("--format", choices=("json", "markdown"), default="json") + parser.add_argument("--output", type=Path, help="Explicit destination for a generated reference") + options = parser.parse_args() + if options.format == "markdown" and options.section != "catalog": + parser.error("Markdown cards require --section catalog") + root = options.root.resolve() + paths = ("relay/context.py", "relay/toolkit.py", "relay/sandbox.py", "relay/caps.py") + sources = {path: source_tree(root, path) for path in paths} + output: dict[str, object] = { + "source_sha256": { + path: hashlib.sha256(source.encode("utf-8")).hexdigest() + for path, (source, _) in sources.items() + } + } + if options.section in ("catalog", "all"): + catalog = ast.literal_eval(assignment(sources["relay/context.py"][1], "CTX_CATALOG")) + caps = sources["relay/caps.py"][1] + blocked = set(ast.literal_eval(assignment(caps, "MT_BLOCKED").args[0])) + prefixes = ("auth.", "phone.", *ast.literal_eval(assignment(caps, "MT_BLOCKED_PREFIXES"))) + output["catalog_count"] = len(catalog) + output["catalog"] = [ + { + "name": name, + "rpc": rpc, + "positional_order": required, + "field_types": fields, + "defaults": defaults, + "forbidden": forbidden, + "policy_blocked": rpc.lower() in blocked or rpc.lower().startswith(prefixes), + } + for name, (rpc, required, fields, defaults, forbidden) in catalog.items() + ] + if options.section in ("tools", "all"): + tree = sources["relay/toolkit.py"][1] + functions = {node.name: node for node in tree.body if isinstance(node, (ast.FunctionDef, ast.AsyncFunctionDef))} + exports = assignment(tree, "TOOLKIT_FUNCS") + if not isinstance(exports, ast.Dict): + raise ValueError("TOOLKIT_FUNCS is not a literal dictionary") + records = [] + for key, value in zip(exports.keys, exports.values): + if not isinstance(value, ast.Name): + raise ValueError("Non-name TOOLKIT_FUNCS entry; inspect manually") + function = functions[value.id] + records.append({"name": ast.literal_eval(key), "signature": signature(function), "async": isinstance(function, ast.AsyncFunctionDef), "line": function.lineno}) + output["tools_count"] = len(records) + output["tools"] = records + if options.section in ("helpers", "all"): + worker = ast.parse(ast.literal_eval(assignment(sources["relay/sandbox.py"][1], "WORKER_SOURCE"))) + records = [] + for label, tree in (("shared", sources["relay/context.py"][1]), ("worker", worker)): + for node in tree.body: + if isinstance(node, ast.ClassDef) and node.name in {"MessageOperations", "ContextOperations", "SandboxContext", "_HtmlHelper", "_StateProxy", "_AssetsProxy", "_UiProxy", "_ScreensProxy"}: + for function in node.body: + if isinstance(function, (ast.FunctionDef, ast.AsyncFunctionDef)) and not function.name.startswith("_"): + positional = function.args.posonlyargs + function.args.args + records.append({"origin": label, "class": node.name, "signature": signature(function, bool(positional and positional[0].arg == "self")), "async": isinstance(function, ast.AsyncFunctionDef), "decorators": [ast.unparse(item) for item in function.decorator_list]}) + output["helpers"] = records + if hasattr(sys.stdout, "reconfigure"): + sys.stdout.reconfigure(encoding="utf-8") + if options.format == "markdown": + rendered = render_catalog(output) + else: + rendered = json.dumps(output, ensure_ascii=False, indent=2) + if options.output is not None: + options.output.write_text(rendered + "\n", encoding="utf-8") + else: + print(rendered) + + +if __name__ == "__main__": + main() +``` diff --git a/src/App.jsx b/src/App.jsx index c421dff..9af35c2 100644 --- a/src/App.jsx +++ b/src/App.jsx @@ -1,26 +1,110 @@ -import React, { useState } from 'react'; +import React, { useState, useEffect } from 'react'; import { Navbar } from './components/Navbar'; import { Hero } from './components/Hero'; -import { Architecture } from './components/Architecture'; -import { ModulePlayground } from './components/ModulePlayground'; -import { Documentation } from './components/Documentation'; -import { AgentSkillSection } from './components/AgentSkillSection'; import { Footer } from './components/Footer'; -import { CONTENT } from './data/content'; +import { FumadocsView } from './components/FumadocsView'; +import { CONTENT } from './data/content.jsx'; export function App() { const [lang, setLang] = useState('en'); + const [view, setView] = useState(() => (window.location.hash.startsWith('#docs') ? 'docs' : 'home')); + const [docsInitialTab, setDocsInitialTab] = useState(() => + window.location.hash.includes('catalog') ? 'catalog' : 'chapters' + ); const currentContent = CONTENT[lang] || CONTENT.en; + useEffect(() => { + document.documentElement.lang = lang; + }, [lang]); + + useEffect(() => { + const selector = [ + '.btn', + '.link', + '.link-arrow', + '.tab', + '.doc-seg__btn', + '.doc-chip', + '.doc-ghost', + '.doc-select', + '.doc-nav__item', + '.doc-pager__item', + '.doc-palette__item', + '.doc-code', + '.doc-toolbar__hint', + '.doc-search__clear', + ].join(', '); + const ignite = (event) => { + const el = event.target.closest(selector); + if (!el) return; + const token = (el.pressToken || 0) + 1; + el.pressToken = token; + el.removeAttribute('data-lit'); + void el.offsetWidth; + el.setAttribute('data-lit', ''); + const clear = () => { + if (el.pressToken !== token) return; + el.removeEventListener('animationend', onEnd); + el.removeAttribute('data-lit'); + }; + const onEnd = (animEvent) => { + if (animEvent.target !== el || animEvent.animationName !== 'press-light') return; + clear(); + }; + el.addEventListener('animationend', onEnd); + window.setTimeout(clear, 2000); + }; + const onKey = (event) => { + if (event.key !== 'Enter' && event.key !== ' ') return; + ignite(event); + }; + document.addEventListener('pointerdown', ignite); + document.addEventListener('keydown', onKey); + return () => { + document.removeEventListener('pointerdown', ignite); + document.removeEventListener('keydown', onKey); + }; + }, []); + + useEffect(() => { + if (window.location.hash.startsWith('#docs')) { + window.history.replaceState(null, '', window.location.pathname + window.location.search); + } + }, []); + + const openDocs = (target) => { + setDocsInitialTab(target === 'catalog' ? 'catalog' : 'chapters'); + setView('docs'); + window.scrollTo({ top: 0, behavior: 'smooth' }); + }; + + const backHome = () => { + setView('home'); + window.scrollTo({ top: 0, behavior: 'smooth' }); + }; + + if (view === 'docs') { + return ( + + ); + } + return ( -
- -
- - - - - +
+ +
+
diff --git a/src/base.css b/src/base.css new file mode 100644 index 0000000..a930f1c --- /dev/null +++ b/src/base.css @@ -0,0 +1,23 @@ +*, *::before, *::after { box-sizing: border-box; } +html, body { overflow-x: clip; } +html { scrollbar-color: var(--color-muted) var(--color-paper); scroll-padding-top: var(--space-3xl); } +body { margin: 0; background: radial-gradient(1400px 800px at 50% -12%, oklch(100% 0 0 / 0.05), transparent 62%), var(--color-paper); color: var(--color-ink); font-family: var(--font-body); font-size: var(--text-md); line-height: 1.55; -webkit-font-smoothing: antialiased; caret-color: var(--color-accent); text-shadow: var(--halo-faint); } +::selection { background: color-mix(in oklab, var(--color-accent) 22%, transparent); color: var(--color-ink); } +:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; } +a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.16em; } +h1, h2, h3 { margin: 0; font-family: var(--font-display); font-weight: var(--display-weight, 700); font-synthesis: none; letter-spacing: var(--tracking-display); line-height: 1.05; overflow-wrap: break-word; min-width: 0; text-wrap: balance; text-shadow: var(--halo-title); } +h1 { max-width: 20ch; font-size: var(--text-display); } h2 { max-width: 30ch; font-size: var(--text-section); } h3 { max-width: 40ch; font-size: var(--text-title); line-height: 1.2; } +.lead { font-size: var(--text-lead); line-height: 1.45; max-width: 52ch; } +p { margin: 0; text-wrap: pretty; } +p:not([class]) { max-width: 65ch; } +img, video { max-width: 100%; height: auto; display: block; } +svg { display: block; } +[hidden] { display: none !important; } +button, input, select, textarea { font: inherit; } +.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: var(--gutter); box-sizing: border-box; } +.num, .figure, td.num { font-variant-numeric: tabular-nums; } +.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; } +[data-slot] { position: relative; overflow: hidden; background: linear-gradient(160deg, var(--color-paper-2, var(--color-paper)), var(--color-paper-3, var(--color-paper))); } +[data-slot] > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: 1; } +[data-slot]:has(> img) > :not(img):not([data-keep]) { display: none !important; } +@media (prefers-reduced-motion: reduce) { *:not(.keep-motion), *:not(.keep-motion)::before, *:not(.keep-motion)::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; } } diff --git a/src/components/AgentSkillSection.jsx b/src/components/AgentSkillSection.jsx deleted file mode 100644 index fd7da12..0000000 --- a/src/components/AgentSkillSection.jsx +++ /dev/null @@ -1,60 +0,0 @@ -import React from 'react'; -import { Download, CheckCircle2, Bot, ArrowRight, FileText } from 'lucide-react'; - -export function AgentSkillSection({ content }) { - const t = content.skill; - - return ( -
-
-
- -
-
- - {t.badge} -
- -

- {t.title} -

- -

- {t.subtitle} -

- -
- {t.features.map((feat, idx) => ( -
- - {feat} -
- ))} -
- - -
-
-
- ); -} diff --git a/src/components/Architecture.jsx b/src/components/Architecture.jsx deleted file mode 100644 index ec909fb..0000000 --- a/src/components/Architecture.jsx +++ /dev/null @@ -1,61 +0,0 @@ -import React from 'react'; -import { Box, Lock, Shield, Cpu, Activity, LayoutGrid } from 'lucide-react'; - -const ICONS = { - namespaces: Box, - capabilities: Shield, - vault: Lock, - goygram: Cpu, - singularity: LayoutGrid, - shield: Activity, -}; - -export function Architecture({ content }) { - const t = content.architecture; - - return ( -
-
-

- {t.sectionTitle} -

-

- {t.sectionSubtitle} -

-
- -
- {t.cards.map((c) => { - const Icon = ICONS[c.id] || Shield; - return ( -
-
-
-
- -
- - {c.tag} - -
-

- {c.title} -

-

- {c.description} -

-
-
- ISOLATION LAYER - ENFORCED -
-
- ); - })} -
-
- ); -} diff --git a/src/components/CopyBlock.jsx b/src/components/CopyBlock.jsx new file mode 100644 index 0000000..38a753f --- /dev/null +++ b/src/components/CopyBlock.jsx @@ -0,0 +1,73 @@ +import React from 'react'; +import { Check, Copy, TriangleAlert } from 'lucide-react'; +import { useCopy } from '../lib/useCopy.jsx'; +import { codeText } from '../lib/codeText.jsx'; + +export function CopyState({ state, copyLabel, copiedLabel, failedLabel, className = '' }) { + const copied = state === 'copied'; + const failed = state === 'failed'; + const text = copied ? copiedLabel : failed ? failedLabel : copyLabel; + + return ( + + {copied ? ( + + ); +} + +export function CopyBlock({ code, label, copyLabel, copiedLabel, failedLabel, className = '', stacked = false }) { + const [state, copy] = useCopy(); + + const codeButton = ( + + ); + + const stateMark = ( + + ); + + if (stacked) { + return ( +
+
+ {label ?

{label}

: } + {stateMark} +
+ {codeButton} +
+ ); + } + + return ( +
+ {label ?

{label}

: null} +
+ {codeButton} + {stateMark} +
+
+ ); +} diff --git a/src/components/Documentation.jsx b/src/components/Documentation.jsx index 1288413..858377f 100644 --- a/src/components/Documentation.jsx +++ b/src/components/Documentation.jsx @@ -1,288 +1,93 @@ -import React, { useState, useMemo } from 'react'; -import { Search, Book, ChevronRight, Hash, Layers, ListFilter, Copy, Check, Terminal } from 'lucide-react'; - -function CodeBlock({ code, lang = 'python' }) { - const [copied, setCopied] = useState(false); - - const handleCopy = () => { - navigator.clipboard.writeText(code); - setCopied(true); - setTimeout(() => setCopied(false), 2000); - }; - - return ( -
-
-
- - - {lang} - -
- -
-
-        {code}
-      
-
- ); -} - -function FormattedContent({ rawContent }) { - const elements = useMemo(() => { - if (!rawContent) return null; - const parts = []; - const codeBlockRegex = /```([a-zA-Z0-9_]*)\n([\s\S]*?)```/g; - let lastIndex = 0; - let match; - - while ((match = codeBlockRegex.exec(rawContent)) !== null) { - if (match.index > lastIndex) { - parts.push({ - type: 'text', - content: rawContent.slice(lastIndex, match.index), - }); - } - parts.push({ - type: 'code', - lang: match[1] || 'python', - content: match[2].trimEnd(), - }); - lastIndex = match.index + match[0].length; - } - - if (lastIndex < rawContent.length) { - parts.push({ - type: 'text', - content: rawContent.slice(lastIndex), - }); - } - - return parts; - }, [rawContent]); - - return ( -
- {elements?.map((part, index) => { - if (part.type === 'code') { - return ; - } - - const paragraphs = part.content.split('\n\n'); - return ( -
- {paragraphs.map((p, pIdx) => { - const trimmed = p.trim(); - if (!trimmed) return null; - - if (trimmed.startsWith('### ')) { - return ( -

- - {trimmed.replace('### ', '')} -

- ); - } - - if (trimmed.startsWith('## ')) { - return ( -

- {trimmed.replace('## ', '')} -

- ); - } - - return ( -
- {trimmed} -
- ); - })} -
- ); - })} -
- ); +import React, { useMemo } from 'react'; +import { BookOpen, Terminal } from 'lucide-react'; +import { SectionHeader } from './SectionHeader'; +import { Reveal } from './Reveal.jsx'; +import { CopyState } from './CopyBlock.jsx'; +import { useCopy } from '../lib/useCopy.jsx'; +import { codeText } from '../lib/codeText.jsx'; + +const FACTS = [ + [{ en: 'License', ru: 'Лицензия' }, 'AGPLv3'], + [{ en: 'Python', ru: 'Python' }, '3.13'], + [{ en: 'Modules', ru: 'Модулей' }, '15'], +]; + +function firstCodeBlock(sections) { + const quickstart = sections?.[0]?.content || ''; + const match = /```python\n([\s\S]*?)```/.exec(quickstart); + return match ? match[1].trimEnd() : ''; } -export function Documentation({ content }) { - const [activeSection, setActiveSection] = useState(0); - const [searchQuery, setSearchQuery] = useState(''); - const [mobileSelectOpen, setMobileSelectOpen] = useState(false); +export function Documentation({ content, lang = 'en', onOpenDocs }) { const t = content.docs; - - const filteredSections = useMemo(() => { - if (!searchQuery.trim()) return t.sections; - const q = searchQuery.toLowerCase(); - return t.sections.filter( - (s) => - s.title.toLowerCase().includes(q) || - s.summary.toLowerCase().includes(q) || - s.content.toLowerCase().includes(q) - ); - }, [t.sections, searchQuery]); - - const currentSection = - filteredSections[activeSection] || filteredSections[0] || t.sections[0]; - - const handleSelectSection = (idx) => { - setActiveSection(idx); - setMobileSelectOpen(false); - }; + const labels = content.modules; + const sample = useMemo(() => firstCodeBlock(t.sections), [t.sections]); + const [state, copy] = useCopy(); return ( -
-
-
- - TECHNICAL MANUAL -
-

- Hotaru Developer Manual -

-

- Comprehensive technical reference for Linux namespace sandboxing, capability security gates, and the ModuleContext API. -

- -
- - { - setSearchQuery(e.target.value); - setActiveSection(0); - }} - placeholder={t.searchPlaceholder} - className="w-full pl-10 pr-4 py-2.5 sm:py-3 rounded-xl bg-[#0c0d14] border border-white/15 text-xs sm:text-sm text-white placeholder-white/35 focus:outline-none focus:border-white/50 transition-all font-mono" - /> -
-
- -
-
- +
+
+ + + + +
+ +
    + {t.cards?.map((card, index) => ( +
  1. + {String(index + 1).padStart(2, '0')} + {card.title} +
  2. + ))} +
- {mobileSelectOpen && ( -
- {filteredSections.map((sec, idx) => ( - +
+ {FACTS.map(([k, v]) => ( +
+
{k[lang] || k.en}
+
{v}
+
))} -
- )} -
+ -
- {filteredSections.map((sec, idx) => { - const shortLabel = sec.title.split('.')[0]; - return ( - - ); - })} -
-
- -
-
-
- {t.tocTitle} ({filteredSections.length}) -
-
- {filteredSections.map((sec, idx) => ( + +
+ + + +
+
+ hello_world.hmod + + python + + +
- ))} -
-
- -
- {currentSection ? ( -
-
- - {currentSection.id} -
-

- {currentSection.title} -

-

- {currentSection.summary} -

- -
- ) : ( -
- No matching sections found for "{searchQuery}". -
- )} + +
diff --git a/src/components/Footer.jsx b/src/components/Footer.jsx index 226bf43..d61b2db 100644 --- a/src/components/Footer.jsx +++ b/src/components/Footer.jsx @@ -1,53 +1,36 @@ import React from 'react'; -import { Shield, Send, Heart } from 'lucide-react'; +import { Send } from 'lucide-react'; import { GithubIcon } from './GithubIcon'; export function Footer({ content }) { const t = content.footer; return ( -
-
-
-
- -
- HOTARU - v1.0.0 -
- -

- {t.copyright} -

+ diff --git a/src/components/FumadocsView.jsx b/src/components/FumadocsView.jsx new file mode 100644 index 0000000..c05d0d0 --- /dev/null +++ b/src/components/FumadocsView.jsx @@ -0,0 +1,810 @@ +import React, { useState, useMemo, useEffect, useId, useRef, useCallback } from 'react'; +import { + Search, + ChevronDown, + Check, + TriangleAlert, + ArrowLeft, + Download, + BookOpen, + Boxes, + Hash, + X, + CornerDownLeft, +} from 'lucide-react'; +import { LangSwitch } from './Navbar'; +import { CATALOG_METHODS } from '../data/catalog.jsx'; +import { codeText } from '../lib/codeText.jsx'; +import { useCopy } from '../lib/useCopy.jsx'; + +function DocState({ state, copiedLabel, failedLabel }) { + return ( + + {state === 'copied' ? ( + <> + + ); +} + +function CodeBlock({ code, lang = 'python', copyLabel, copiedLabel, failedLabel }) { + const [state, copy] = useCopy(); + const hintId = useId(); + + return ( +
+
+
{lang}
+ +
+
 copy(code)}
+        onKeyDown={(event) => {
+          if (event.key !== 'Enter' && event.key !== ' ') return;
+          event.preventDefault();
+          copy(code);
+        }}
+      >
+        {codeText(code)}
+      
+ {copyLabel} +
+ ); +} + +function MethodCard({ method, lang }) { + const description = lang === 'ru' ? method.desc_ru : method.desc_en; + + return ( +
+

+ + {method.name} +

+ +

{method.rpc}

+ +

{description}

+ + {method.params && method.params.length > 0 && ( +
+
+ + + + + + + + + + {method.params.map((p) => ( + + + + + + + ))} + +
{lang === 'ru' ? 'Параметр' : 'Parameter'}{lang === 'ru' ? 'Тип' : 'Type'}{lang === 'ru' ? 'Обязателен' : 'Required'}{lang === 'ru' ? 'По умолчанию' : 'Default'}
{p.name}{p.type} + {p.required ? (lang === 'ru' ? 'да' : 'yes') : (lang === 'ru' ? 'нет' : 'no')} + {p.default || '-'}
+ + )} + + ); +} + +function Inline({ text }) { + const parts = text.split(/(`[^`]+`|\*\*[^*]+\*\*)/g); + return parts.map((chunk, i) => { + if (chunk.startsWith('`') && chunk.endsWith('`') && chunk.length > 2) { + return {chunk.slice(1, -1)}; + } + if (chunk.startsWith('**') && chunk.endsWith('**') && chunk.length > 4) { + return {chunk.slice(2, -2)}; + } + return chunk; + }); +} + +function Figure({ src, alt }) { + const mark = src.endsWith('-mark.png'); + return ( +
+ {alt +
+ ); +} + +function FormattedContent({ rawContent, copyLabel, copiedLabel, failedLabel }) { + const elements = useMemo(() => { + if (!rawContent) return null; + const parts = []; + const codeBlockRegex = /```([a-zA-Z0-9_]*)\n([\s\S]*?)```/g; + let lastIndex = 0; + let match; + + while ((match = codeBlockRegex.exec(rawContent)) !== null) { + if (match.index > lastIndex) { + parts.push({ type: 'text', content: rawContent.slice(lastIndex, match.index) }); + } + parts.push({ + type: 'code', + lang: match[1] || 'python', + content: match[2].trimEnd(), + }); + lastIndex = match.index + match[0].length; + } + + if (lastIndex < rawContent.length) { + parts.push({ type: 'text', content: rawContent.slice(lastIndex) }); + } + + return parts; + }, [rawContent]); + + return ( +
+ {elements?.map((part, index) => { + if (part.type === 'code') { + return ( + + ); + } + + const blocks = part.content.split(/\n{2,}/); + return ( + + {blocks.map((raw, bIdx) => { + const trimmed = raw.trim(); + if (!trimmed) return null; + + if (trimmed.startsWith('### ')) { + return ( +

{trimmed.replace('### ', '')}

+ ); + } + + const figure = trimmed.match(/^!\[([^\]]*)\]\(([^)\s]+)\)$/); + if (figure) { + return ( +
+ ); + } + + if (trimmed.startsWith('## ')) { + return ( +

{trimmed.replace('## ', '')}

+ ); + } + + if (trimmed.startsWith('| ')) { + const rows = trimmed.split('\n').filter((line) => line.trim().length > 0); + const cells = rows.map((line) => + line + .replace(/^\|/, '') + .replace(/\|$/, '') + .split('|') + .map((cell) => cell.trim()) + ); + const body = cells.filter( + (row) => !row.every((cell) => /^:?-{2,}:?$/.test(cell)) + ); + if (body.length === 0) return null; + const [head, ...rest] = body; + return ( +
+ + + + {head.map((cell, cIdx) => ( + + ))} + + + + {rest.map((row, rIdx) => ( + + {row.map((cell, cIdx) => ( + + ))} + + ))} + +
+
+ ); + } + + if (trimmed.startsWith('- ')) { + const items = trimmed.split('\n').map((line) => line.replace(/^-\s*/, '')); + return ( +
    + {items.map((item, iIdx) => ( +
  • + ))} +
+ ); + } + + return ( +

+ +

+ ); + })} + + ); + })} +
+ ); +} + +export function FumadocsView({ content, lang, setLang, onBackToHome, initialTab = 'chapters' }) { + const [activeTab, setActiveTab] = useState(initialTab); + const [activeSection, setActiveSection] = useState(0); + const [chapterDropdownOpen, setChapterDropdownOpen] = useState(false); + const [searchQuery, setSearchQuery] = useState(''); + const [selectedNamespace, setSelectedNamespace] = useState('all'); + const [searchOpen, setSearchOpen] = useState(false); + const searchRef = useRef(null); + + const t = content.docs; + + const L = lang === 'ru' + ? { + home: 'На главную', + guide: 'Руководство', + methods: 'Методы', + chapters: 'Главы', + namespaces: 'Пространства имён', + filter: 'Фильтр по разделам и методам', + current: 'Текущий раздел', + pick: 'Выберите раздел', + catalogTitle: 'Каталог контекстных методов', + catalogLead: 'Описания приведены по официальному справочнику методов Telegram.', + showing: (n, total) => `Показано ${n} из ${total}`, + prev: 'Назад', + next: 'Дальше', + empty: 'Ничего не найдено. Измените запрос.', + copyCode: 'Скопировать код', + copyMethod: 'Скопировать сигнатуру метода', + copied: 'Скопировано', + failed: 'Не удалось скопировать', + search: 'Поиск', + searchHint: 'Нажмите / для поиска', + noResults: 'Совпадений нет', + closeSearch: 'Закрыть поиск', + } + : { + home: 'Home', + guide: 'Guide', + methods: 'Methods', + chapters: 'Chapters', + namespaces: 'Namespaces', + filter: 'Filter docs and methods', + current: 'Current chapter', + pick: 'Select chapter', + catalogTitle: 'Contextual method catalog', + catalogLead: 'Descriptions follow the official Telegram method reference.', + showing: (n, total) => `Showing ${n} of ${total}`, + prev: 'Previous', + next: 'Next', + empty: 'Nothing matches. Change the query.', + copyCode: 'Copy code', + copyMethod: 'Copy method signature', + copied: 'Copied', + failed: 'Copy failed', + search: 'Search', + searchHint: 'Press / to search', + noResults: 'No matches', + closeSearch: 'Close search', + }; + + const namespaces = useMemo(() => { + const set = new Set(CATALOG_METHODS.map((m) => m.namespace)); + return ['all', ...Array.from(set).sort()]; + }, []); + + const filteredCatalog = useMemo(() => { + let list = CATALOG_METHODS; + if (selectedNamespace !== 'all') { + list = list.filter((m) => m.namespace === selectedNamespace); + } + if (searchQuery.trim()) { + const q = searchQuery.toLowerCase(); + list = list.filter( + (m) => + m.name.toLowerCase().includes(q) || + m.rpc.toLowerCase().includes(q) || + m.signature.toLowerCase().includes(q) || + (lang === 'ru' ? m.desc_ru : m.desc_en).toLowerCase().includes(q) + ); + } + return list; + }, [selectedNamespace, searchQuery, lang]); + + const filteredSections = useMemo(() => { + if (!searchQuery.trim()) return t.sections; + const q = searchQuery.toLowerCase(); + return t.sections.filter( + (s) => + s.title.toLowerCase().includes(q) || + s.summary.toLowerCase().includes(q) || + s.content.toLowerCase().includes(q) + ); + }, [t.sections, searchQuery]); + + const currentSection = + filteredSections[activeSection] || filteredSections[0] || t.sections[0]; + + const searchResults = useMemo(() => { + const q = searchQuery.trim().toLowerCase(); + if (!q) { + return t.sections.map((s) => ({ + kind: 'chapter', + id: s.id, + title: s.title, + summary: s.summary, + })); + } + const chapters = t.sections + .filter((s) => + s.title.toLowerCase().includes(q) || s.summary.toLowerCase().includes(q) + ) + .slice(0, 4) + .map((s) => ({ kind: 'chapter', id: s.id, title: s.title, summary: s.summary })); + const methods = CATALOG_METHODS.filter( + (m) => + m.name.toLowerCase().includes(q) || + m.rpc.toLowerCase().includes(q) || + (lang === 'ru' ? m.desc_ru : m.desc_en).toLowerCase().includes(q) + ) + .slice(0, 12) + .map((m) => ({ kind: 'method', id: m.name, title: m.name, summary: m.rpc })); + return [...chapters, ...methods]; + }, [searchQuery, t.sections, lang]); + + const openSearch = useCallback(() => { + setSearchOpen(true); + window.requestAnimationFrame(() => searchRef.current?.focus()); + }, []); + + const closeSearch = useCallback(() => { + setSearchOpen(false); + setSearchQuery(''); + }, []); + + useEffect(() => { + const onKey = (event) => { + const target = event.target; + const typing = + target instanceof HTMLElement && + (target.tagName === 'INPUT' || target.tagName === 'TEXTAREA' || target.isContentEditable); + if (event.key === '/' && !typing) { + event.preventDefault(); + openSearch(); + return; + } + if (event.key === 'Escape' && searchOpen) { + closeSearch(); + } + }; + document.addEventListener('keydown', onKey); + return () => document.removeEventListener('keydown', onKey); + }, [searchOpen, openSearch, closeSearch]); + + useEffect(() => { + if (activeTab === 'catalog') { + setActiveSection(0); + } + }, [activeTab]); + + const jumpToMethod = (name) => { + setActiveTab('catalog'); + setSelectedNamespace('all'); + setSearchQuery(''); + closeSearch(); + window.requestAnimationFrame(() => { + const node = document.getElementById(`method-${name}`); + if (node) node.scrollIntoView({ behavior: 'smooth', block: 'center' }); + }); + }; + + const jumpToChapter = (id) => { + setActiveTab('chapters'); + setSearchQuery(''); + closeSearch(); + const index = t.sections.findIndex((s) => s.id === id); + if (index >= 0) setActiveSection(index); + window.scrollTo({ top: 0, behavior: 'smooth' }); + }; + + const shortTitle = (title) => title.split(':')[0]; + + const searchField = (id, autoFocus) => ( +
+
+ ); + + const tabSwitch = ( +
+ + +
+ ); + + return ( +
+
+
+
+ +
+ +
+ Hotaru +
+ +
+ {tabSwitch} + + + +
+
+
+ +
+
+
{searchField('docs-search')}
+ +
+
+ + {searchOpen && ( +
+
e.stopPropagation()} + > +
+
+
+ {searchResults.length === 0 ? ( +

{L.noResults}

+ ) : ( +
    + {searchQuery.trim() ? null : ( + + )} + {searchResults.map((item) => ( +
  • + +
  • + ))} +
+ )} +
+
+
+ )} + +
+ + +
+
+
{tabSwitch}
+ + {activeTab === 'chapters' && ( +
+

+ {L.current} {activeSection + 1} / {filteredSections.length} +

+ + + {chapterDropdownOpen && ( + <> +
setChapterDropdownOpen(false)} /> +
    + {filteredSections.map((sec, idx) => ( +
  1. + +
  2. + ))} +
+ + )} +
+ )} +
+ + {activeTab === 'chapters' ? ( + currentSection ? ( +
+

+ {String(activeSection + 1).padStart(2, '0')} +

+

{currentSection.title}

+

{currentSection.summary}

+ +
+ + + + +
+ ) : ( +

{L.empty}

+ ) + ) : ( +
+

+ {String(CATALOG_METHODS.length).padStart(3, '0')} +

+

{L.catalogTitle}

+

{L.catalogLead}

+ +
+ +
+
+

+ {L.showing(filteredCatalog.length, CATALOG_METHODS.length)} +

+
+ {namespaces.map((ns) => ( + + ))} +
+
+ + {filteredCatalog.length > 0 ? ( +
+ {filteredCatalog.map((method) => ( +
+ +
+ ))} +
+ ) : ( +

{L.empty}

+ )} +
+
+ )} +
+
+ + +
+ ); +} diff --git a/src/components/GithubIcon.jsx b/src/components/GithubIcon.jsx index 9a2c4fc..e633828 100644 --- a/src/components/GithubIcon.jsx +++ b/src/components/GithubIcon.jsx @@ -2,7 +2,7 @@ import React from 'react'; export function GithubIcon({ className = "w-4 h-4" }) { return ( - + diff --git a/src/components/Hero.jsx b/src/components/Hero.jsx index 8df0814..af8b00c 100644 --- a/src/components/Hero.jsx +++ b/src/components/Hero.jsx @@ -1,114 +1,35 @@ -import React, { useState } from 'react'; -import { Copy, Check, Terminal, ArrowRight, Sparkles, BookOpen, ShieldCheck } from 'lucide-react'; +import React, { useRef } from 'react'; +import { BookOpen, Download } from 'lucide-react'; import { QuasarScene } from './QuasarScene'; -export function Hero({ content }) { - const [copied, setCopied] = useState(false); +export function Hero({ content, lang, onOpenDocs }) { const t = content.hero; - const installCmd = "curl -fsSL https://raw.githubusercontent.com/HotaruProject/Hotaru/main/install.sh | bash"; - - const copyInstall = () => { - navigator.clipboard.writeText(installCmd); - setCopied(true); - setTimeout(() => setCopied(false), 2200); - }; - - const scrollTo = (id) => { - const el = document.getElementById(id); - if (el) el.scrollIntoView({ behavior: 'smooth' }); - }; + const copyRef = useRef(null); return ( -
-
- +
+
+
+
-
- -
-
- - {t.badge} -
+
+
+

{t.title}

-

- {t.title} -

- -

- {t.subtitle} -

- -
-
- - {t.installTitle} -
+

{t.subtitle}

-
-
- $ - - {installCmd} - -
- - + +
- -
- - - - - {t.ctaSkill} - -
- -
- {t.metrics.map((m, idx) => ( -
- {m.label} - {m.value} -
- ))} -
); diff --git a/src/components/Jail.jsx b/src/components/Jail.jsx new file mode 100644 index 0000000..7d99c0a --- /dev/null +++ b/src/components/Jail.jsx @@ -0,0 +1,94 @@ +import React, { useState } from 'react'; +import { SectionHeader } from './SectionHeader'; +import { Reveal } from './Reveal.jsx'; + +export function Jail({ content }) { + const t = content.jail; + const d = t.diagram; + const [active, setActive] = useState('kernel'); + + const pick = (event, id) => { + setActive(id); + if (event) event.currentTarget.focus(); + }; + + return ( +
+
+ + + + +
+ +
+
+ + +
+
+ +

+ {d.details[active]} +

+

{t.gates}

+
+
+
+
+ ); +} diff --git a/src/components/ModulePlayground.jsx b/src/components/ModulePlayground.jsx deleted file mode 100644 index 94b9afa..0000000 --- a/src/components/ModulePlayground.jsx +++ /dev/null @@ -1,87 +0,0 @@ -import React, { useState } from 'react'; -import { Copy, Check, FileCode } from 'lucide-react'; - -export function ModulePlayground({ content }) { - const [activeTab, setActiveTab] = useState(0); - const [copied, setCopied] = useState(false); - const t = content.modules; - - const currentTab = t.tabs[activeTab]; - - const handleCopy = () => { - navigator.clipboard.writeText(currentTab.code); - setCopied(true); - setTimeout(() => setCopied(false), 2000); - }; - - return ( -
-
-
-
- - EXTENSIONS -
-

- {t.sectionTitle} -

-

- {t.sectionSubtitle} -

-
- -
- {t.tabs.map((tab, idx) => ( - - ))} -
-
- -
-
-
-
-
-
-
-
- {currentTab.id}.hmod -
- - -
- -
-
-            {currentTab.code}
-          
-
-
-
- ); -} diff --git a/src/components/Modules.jsx b/src/components/Modules.jsx new file mode 100644 index 0000000..b485af9 --- /dev/null +++ b/src/components/Modules.jsx @@ -0,0 +1,77 @@ +import React, { useMemo } from 'react'; +import { SectionHeader } from './SectionHeader'; +import { Reveal } from './Reveal.jsx'; +import { RevealGroup } from './RevealGroup.jsx'; +import { CopyState } from './CopyBlock.jsx'; +import { useCopy } from '../lib/useCopy.jsx'; +import { MODULES, manifestOf } from '../data/modules.jsx'; +import { codeText } from '../lib/codeText.jsx'; + +function ManifestPanel({ id, manifest, labels }) { + const [state, copy] = useCopy(); + + return ( +
+
+ {id}.hmod + +
+ +
+ ); +} + +export function Modules({ content, lang, moduleId, onPickModule }) { + const t = content.modules; + const active = useMemo(() => MODULES.find((m) => m.id === moduleId) || MODULES[0], [moduleId]); + const manifest = useMemo(() => manifestOf(active), [active]); + + return ( +
+
+ + + + + + {MODULES.map((m, index) => { + const selected = m.id === active.id; + return ( + + ); + })} + + + + + +
+
+ ); +} diff --git a/src/components/Navbar.jsx b/src/components/Navbar.jsx index 1e88868..d9aac7e 100644 --- a/src/components/Navbar.jsx +++ b/src/components/Navbar.jsx @@ -1,148 +1,167 @@ -import React, { useState } from 'react'; -import { Shield, BookOpen, Terminal, Sparkles, Menu, X, Globe, Download } from 'lucide-react'; +import React, { useEffect, useRef, useState } from 'react'; +import { BookOpen, Menu, X, Download } from 'lucide-react'; import { GithubIcon } from './GithubIcon'; -export function Navbar({ lang, setLang, content }) { +export function LangSwitch({ lang, setLang }) { + return ( +
+ + +
+ ); +} + +export function Navbar({ lang, setLang, content, onOpenDocs }) { const [mobileOpen, setMobileOpen] = useState(false); + const [mobileClosing, setMobileClosing] = useState(false); + const headRef = useRef(null); + const progressRef = useRef(null); + const menuOpen = useRef(false); + const closeTimer = useRef(0); const t = content.nav; - const scrollTo = (id) => { - setMobileOpen(false); - const element = document.getElementById(id); - if (element) { - element.scrollIntoView({ behavior: 'smooth' }); - } + const openMenu = () => { + window.clearTimeout(closeTimer.current); + setMobileClosing(false); + setMobileOpen(true); }; - return ( - + ); } diff --git a/src/components/QuasarScene.jsx b/src/components/QuasarScene.jsx index 94157ea..a67a109 100644 --- a/src/components/QuasarScene.jsx +++ b/src/components/QuasarScene.jsx @@ -1,9 +1,11 @@ -import React, { useEffect, useRef, useState, useCallback } from 'react'; -import { RotateCcw, Play, Pause, Hand } from 'lucide-react'; +import React, { useCallback, useEffect, useRef } from 'react'; +import { RotateCcw } from 'lucide-react'; const VERT_SRC = ` attribute vec2 aPos; +varying vec2 vUv; void main() { + vUv = aPos * 0.5 + 0.5; gl_Position = vec4(aPos, 0.0, 1.0); } `; @@ -17,9 +19,13 @@ precision mediump float; uniform vec2 uRes; uniform float uTime; -uniform float uYaw; -uniform float uPitch; -uniform float uDist; +uniform vec3 uCamPos; +uniform vec3 uCamRight; +uniform vec3 uCamUp; +uniform vec3 uCamFwd; +uniform vec2 uCenter; +uniform float uScale; +uniform float uSteps; float hash13(vec3 p3) { p3 = fract(p3 * 0.1031); @@ -63,6 +69,7 @@ float fbm2(vec2 p) { vec3 backgroundStars(vec3 dir) { vec3 col = vec3(0.0003, 0.0004, 0.0008); + vec3 pStar = dir * 200.0; vec3 iStar = floor(pStar); vec3 fStar = fract(pStar) - 0.5; @@ -73,10 +80,11 @@ vec3 backgroundStars(vec3 dir) { float size = 0.045 + 0.055 * fract(rnd * 137.1); float glow = exp(-dist * dist / (size * size * 0.20)); float twinkle = 0.75 + 0.25 * sin(uTime * 2.5 + rnd * 60.0); - vec3 starCol = mix(vec3(0.95, 0.98, 1.0), vec3(0.75, 0.90, 1.0), fract(rnd * 43.1)); - if (fract(rnd * 89.2) > 0.85) starCol = vec3(1.0, 0.92, 0.82); + vec3 starCol = mix(vec3(1.0), vec3(0.68, 0.68, 0.68), fract(rnd * 43.1)); + if (fract(rnd * 89.2) > 0.85) starCol = vec3(0.86); col += starCol * glow * twinkle * 2.2; } + return col; } @@ -102,12 +110,13 @@ vec4 sampleDisk(vec3 hit, vec3 rayDir) { vec3 diskVelocity = normalize(vec3(-hit.z, 0.0, hit.x)); float doppler = dot(diskVelocity, -rayDir); - float dopplerFactor = pow(clamp(1.0 + 0.62 * doppler, 0.15, 2.7), 3.5); + float dop = clamp(1.0 + 0.62 * doppler, 0.15, 2.7); + float dopplerFactor = dop * dop * dop * sqrt(dop); - vec3 colHot = vec3(1.35, 1.40, 1.48); - vec3 colMid = vec3(0.96, 0.98, 1.05); - vec3 colWarm = vec3(0.85, 0.82, 0.78); - vec3 colOuter = vec3(0.55, 0.35, 0.18); + vec3 colHot = vec3(1.42); + vec3 colMid = vec3(0.99); + vec3 colWarm = vec3(0.78); + vec3 colOuter = vec3(0.34); vec3 col = mix(colOuter, colWarm, smoothstep(0.0, 0.35, density)); col = mix(col, colMid, smoothstep(0.3, 0.7, density)); @@ -115,21 +124,17 @@ vec4 sampleDisk(vec3 hit, vec3 rayDir) { float innerGlow = smoothstep(innerR + 0.95, innerR, rad); col += colHot * innerGlow * innerGlow * 2.4; + col *= dopplerFactor * 1.95; float alpha = smoothstep(0.015, 0.32, density); return vec4(col, alpha); } vec3 traceScene(vec2 uv) { - vec3 lookAt = vec3(0.0, 0.0, 0.0); - vec3 camPos = lookAt + uDist * vec3( - cos(uPitch) * sin(uYaw), - sin(uPitch), - -cos(uPitch) * cos(uYaw) - ); - vec3 fwd = normalize(lookAt - camPos); - vec3 right = normalize(cross(fwd, vec3(0.0, 1.0, 0.0))); - vec3 up = cross(right, fwd); + vec3 camPos = uCamPos; + vec3 fwd = uCamFwd; + vec3 right = uCamRight; + vec3 up = uCamUp; float fov = 0.85; vec3 dir = normalize(fwd + uv.x * fov * right + uv.y * fov * up); @@ -143,15 +148,15 @@ vec3 traceScene(vec2 uv) { bool captured = false; float minR = 1000.0; int diskCrossings = 0; - - for (int i = 0; i < 220; i++) { + for (int i = 0; i < 300; i++) { + if (float(i) >= uSteps) break; vec3 prevPos = pos; float r = length(pos); minR = min(minR, r); - float dt = clamp(r * 0.052, 0.007, 0.98); + float dt = clamp(r * 0.042, 0.005, 0.85); float r2safe = max(dot(pos, pos), 0.55); - vec3 acc = -1.65 * h2 * pos / pow(r2safe, 2.5); + vec3 acc = -1.65 * h2 * pos / (r2safe * r2safe * sqrt(r2safe)); dir = normalize(dir + acc * dt); pos += dir * dt; @@ -173,7 +178,7 @@ vec3 traceScene(vec2 uv) { diskCrossings++; } - if (r > 36.0) { + if (r > 40.0) { break; } } @@ -182,26 +187,42 @@ vec3 traceScene(vec2 uv) { if (!captured) { col += backgroundStars(normalize(dir)) * (1.0 - diskAccum.a); float ringGlow = exp(-abs(minR - photonR) * 22.0); - col += vec3(1.35, 1.40, 1.48) * ringGlow * 2.9; + col += vec3(1.0) * ringGlow * 2.9; float ringHalo = exp(-abs(minR - photonR) * 4.2); - col += vec3(0.96, 0.98, 1.05) * ringHalo * 0.45; + col += vec3(0.95) * ringHalo * 0.5; + float halo = exp(-abs(minR - photonR) * 0.85); + col += vec3(0.7) * halo * 0.34; } + float dScreen = length(uv); + float bloom = exp(-max(0.0, dScreen - 0.58) * 3.1); + col += vec3(0.62) * bloom * 0.17; + return col; } void main() { float minDim = min(uRes.x, uRes.y); - vec2 uv = (gl_FragCoord.xy - 0.5 * uRes) / minDim; + vec2 uv = (gl_FragCoord.xy - uCenter * uRes) / minDim * uScale; vec3 col = traceScene(uv); col = col / (1.0 + col); col = pow(col, vec3(0.86)); - float vig = 1.0 - 0.20 * smoothstep(0.4, 1.4, length(uv)); + vec2 vigUv = (gl_FragCoord.xy - 0.5 * uRes) / minDim; + float vig = 1.0 - 0.22 * smoothstep(0.35, 1.5, length(vigUv)); col *= vig; gl_FragColor = vec4(col, 1.0); } `; +const BLIT_SRC = ` +precision mediump float; +varying vec2 vUv; +uniform sampler2D uTex; +void main() { + gl_FragColor = vec4(texture2D(uTex, vUv).rgb, 1.0); +} +`; + function compileShader(gl, type, src) { const sh = gl.createShader(type); gl.shaderSource(sh, src); @@ -220,6 +241,7 @@ function createProgram(gl, vsSrc, fsSrc) { const prog = gl.createProgram(); gl.attachShader(prog, vs); gl.attachShader(prog, fs); + gl.bindAttribLocation(prog, 0, 'aPos'); gl.linkProgram(prog); if (!gl.getProgramParameter(prog, gl.LINK_STATUS)) { const err = gl.getProgramInfoLog(prog); @@ -229,29 +251,197 @@ function createProgram(gl, vsSrc, fsSrc) { return prog; } -export function QuasarScene() { +function makeTarget(gl) { + const tex = gl.createTexture(); + gl.bindTexture(gl.TEXTURE_2D, tex); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MIN_FILTER, gl.LINEAR); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_MAG_FILTER, gl.LINEAR); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_S, gl.CLAMP_TO_EDGE); + gl.texParameteri(gl.TEXTURE_2D, gl.TEXTURE_WRAP_T, gl.CLAMP_TO_EDGE); + const fb = gl.createFramebuffer(); + const t = { tex, fb, w: 0, h: 0 }; + t.size = (w, h) => { + if (t.w === w && t.h === h) return; + t.w = w; + t.h = h; + gl.bindTexture(gl.TEXTURE_2D, tex); + gl.texImage2D(gl.TEXTURE_2D, 0, gl.RGBA, w, h, 0, gl.RGBA, gl.UNSIGNED_BYTE, null); + gl.bindFramebuffer(gl.FRAMEBUFFER, fb); + gl.framebufferTexture2D(gl.FRAMEBUFFER, gl.COLOR_ATTACHMENT0, gl.TEXTURE_2D, tex, 0); + }; + t.free = () => { + gl.deleteTexture(tex); + gl.deleteFramebuffer(fb); + }; + return t; +} + +const norm = (v) => { + const l = Math.hypot(v[0], v[1], v[2]) || 1; + return [v[0] / l, v[1] / l, v[2] / l]; +}; +const cross = (a, b) => [a[1] * b[2] - a[2] * b[1], a[2] * b[0] - a[0] * b[2], a[0] * b[1] - a[1] * b[0]]; +const dot = (a, b) => a[0] * b[0] + a[1] * b[1] + a[2] * b[2]; + +function rotate(v, k, ang) { + const c = Math.cos(ang); + const s = Math.sin(ang); + const kv = cross(k, v); + const d = dot(k, v) * (1 - c); + return [v[0] * c + kv[0] * s + k[0] * d, v[1] * c + kv[1] * s + k[1] * d, v[2] * c + kv[2] * s + k[2] * d]; +} +const DEFAULT_PITCH = 0.34; +const DEFAULT_DIST = 26.0; +const DIST_MIN = 15.0; +const DIST_MAX = 33.0; +const BRIGHT_LIFT = 16; + +const isWideScreen = () => + typeof window !== 'undefined' && window.innerWidth >= 768; + +function defaultFrame() { + const cp = Math.cos(DEFAULT_PITCH); + const back = [0.0, Math.sin(DEFAULT_PITCH), -cp]; + const right = norm(cross([0, 1, 0], back)); + const up = cross(back, right); + return { right, up, back }; +} + +const QUALITY = [0.8, 0.9, 1.0]; +const STEPS = [110, 190, 300]; +const COMPACT_HEIGHT = 560; +const FIT_SPAN = 0.674; +const TILT_BASE = 0.3986; +const TILT_GROW = 0.4111; +const PITCH_MIN = -0.62; +const PITCH_MAX = 0.62; +const SENS = 0.0036; +const FOLLOW_TAU = 0.075; +const VEL_TAU = 0.09; +const GLIDE = 2.0; +const MAX_RATE = 3.0; +const DRIFT = 0.055; +const DOLLY_MAX = 0.46; + +const LABELS = { + en: { hint: 'Drag to turn it any way, pinch or Ctrl and scroll to zoom', reset: 'Reset view' }, + ru: { hint: 'Тяните, чтобы повернуть в любую сторону, щипок или Ctrl и колесо для зума', reset: 'Сбросить вид' }, +}; + +export function QuasarScene({ lang = 'en', copyRef = null }) { + const labels = LABELS[lang] || LABELS.en; const canvasRef = useRef(null); - const [autoRotate, setAutoRotate] = useState(true); + const layoutRef = useRef({ ready: false, scale: 1, eyeY: 0, room: 1, compact: false, shiftX: 0 }); + const rectRef = useRef({ width: 0, height: 0, top: 0, left: 0 }); const stateRef = useRef({ - yaw: 0.0, - pitch: 0.18, - dist: 24.0, - autoRotate: true, + ...defaultFrame(), + dist: DEFAULT_DIST, isDragging: false, lastX: 0, lastY: 0, - yawVel: 0, - pitchVel: 0, + lastT: 0, + velX: 0, + velY: 0, + pendingX: 0, + pendingY: 0, + fit: 1, + spin: 0, + hole: { x: 0, y: 0, r: 0 }, }); - stateRef.current.autoRotate = autoRotate; + useEffect(() => { + const measure = () => { + const canvas = canvasRef.current; + if (!canvas) return; + const canvasRect = canvas.getBoundingClientRect(); + const canvasW = canvasRect.width; + const canvasH = canvasRect.height; + rectRef.current = { + width: canvasW, + height: canvasH, + top: canvasRect.top, + left: canvasRect.left, + }; + const phone = canvasW < 768; + const compact = window.innerHeight < COMPACT_HEIGHT; + if (!phone && !compact) { + layoutRef.current = { ready: false, scale: 1, eyeY: 0, room: 1, compact: false, shiftX: 0 }; + return; + } + const scrollY = window.scrollY; + const canvasDocTop = canvasRect.top + scrollY; + const navHead = document.querySelector('.nav-head'); + const pill = document.querySelector('.nav-pill'); + let plateBottom = 68; + if (navHead && pill) { + const headTop = parseFloat(getComputedStyle(navHead).top); + const pillH = pill.getBoundingClientRect().height; + plateBottom = (Number.isFinite(headTop) ? headTop : 0) + pillH; + } + const copy = copyRef ? copyRef.current : null; + const copyDocTop = copy + ? copy.getBoundingClientRect().top + scrollY + : canvasDocTop + canvasH * 0.44; + const band = Math.max(60, copyDocTop - plateBottom); + const gap = phone || compact ? 14 : 26; + const room = Math.max(46, band - gap * 2); + const minCss = Math.min(canvasW, canvasH); + const wanted = canvasW * (phone ? 0.82 : 0.80); + const byHeight = room / 0.76; + const apparent = Math.max(120, Math.min(wanted, byHeight)); + let scale = (FIT_SPAN * minCss) / apparent; + if (scale > 3.4) scale = 3.4; + const eyeMid = plateBottom + band / 2 + BRIGHT_LIFT; + layoutRef.current = { + ready: true, + scale, + room, + shiftX: 0, + eyeY: eyeMid - canvasDocTop, + compact, + }; + }; + measure(); + let wasWide = isWideScreen(); + const onResize = () => { + const wide = isWideScreen(); + if (wide !== wasWide) { + wasWide = wide; + Object.assign(stateRef.current, defaultFrame(), { + dist: DEFAULT_DIST, + velX: 0, + velY: 0, + pendingX: 0, + pendingY: 0, + spin: 0, + }); + } + measure(); + }; + window.addEventListener('resize', onResize); + window.addEventListener('orientationchange', measure); + const observer = typeof ResizeObserver !== 'undefined' ? new ResizeObserver(measure) : null; + if (observer) { + if (canvasRef.current) observer.observe(canvasRef.current); + if (copyRef && copyRef.current) observer.observe(copyRef.current); + } + return () => { + window.removeEventListener('resize', onResize); + window.removeEventListener('orientationchange', measure); + if (observer) observer.disconnect(); + }; + }, [copyRef]); const resetCamera = useCallback(() => { - stateRef.current.yaw = 0.0; - stateRef.current.pitch = 0.18; - stateRef.current.dist = 24.0; - stateRef.current.yawVel = 0; - stateRef.current.pitchVel = 0; + Object.assign(stateRef.current, defaultFrame(), { + dist: DEFAULT_DIST, + velX: 0, + velY: 0, + pendingX: 0, + pendingY: 0, + spin: 0, + }); + stateRef.current.wake?.(); }, []); useEffect(() => { @@ -260,15 +450,18 @@ export function QuasarScene() { let gl; try { - gl = canvas.getContext('webgl', { powerPreference: 'high-performance', alpha: false, depth: false, antialias: false }); + gl = canvas.getContext('webgl', { powerPreference: 'high-performance', alpha: false, depth: false, stencil: false, antialias: false, preserveDrawingBuffer: false }); } catch { return; } if (!gl) return; - let prog; + let progs; try { - prog = createProgram(gl, VERT_SRC, FRAG_SRC); + progs = { + scene: createProgram(gl, VERT_SRC, FRAG_SRC), + blit: createProgram(gl, VERT_SRC, BLIT_SRC), + }; } catch { return; } @@ -276,155 +469,379 @@ export function QuasarScene() { const posBuf = gl.createBuffer(); gl.bindBuffer(gl.ARRAY_BUFFER, posBuf); gl.bufferData(gl.ARRAY_BUFFER, new Float32Array([-1, -1, 1, -1, -1, 1, -1, 1, 1, -1, 1, 1]), gl.STATIC_DRAW); - - const aPos = gl.getAttribLocation(prog, 'aPos'); - const uRes = gl.getUniformLocation(prog, 'uRes'); - const uTime = gl.getUniformLocation(prog, 'uTime'); - const uYaw = gl.getUniformLocation(prog, 'uYaw'); - const uPitch = gl.getUniformLocation(prog, 'uPitch'); - const uDist = gl.getUniformLocation(prog, 'uDist'); + gl.enableVertexAttribArray(0); + gl.vertexAttribPointer(0, 2, gl.FLOAT, false, 0, 0); + + const loc = {}; + Object.entries(progs).forEach(([key, p]) => { + loc[key] = {}; + ['uRes', 'uTime', 'uCamPos', 'uCamRight', 'uCamUp', 'uCamFwd', 'uCenter', 'uScale', 'uSteps', 'uTex'].forEach((n) => { + loc[key][n] = gl.getUniformLocation(p, n); + }); + }); + const sceneT = makeTarget(gl); + + let quality = QUALITY.length - 1; + let frameSum = 0; + let frameCount = 0; + let lastDraw = 0; + let windowStart = performance.now(); + canvas.dataset.quality = String(QUALITY.length - 1); + let frames = 0; + canvas.dataset.frames = '0'; + const FRAME_MIN = 1000 / 61; + + const reduceMotion = window.matchMedia('(prefers-reduced-motion: reduce)'); + let visible = true; + let running = false; let animId; let t0 = performance.now(); + const pass = (prog, target, w, h) => { + gl.useProgram(prog); + gl.bindFramebuffer(gl.FRAMEBUFFER, target ? target.fb : null); + gl.viewport(0, 0, w, h); + }; + const bindTex = (unit, tex, uniform) => { + gl.activeTexture(gl.TEXTURE0 + unit); + gl.bindTexture(gl.TEXTURE_2D, tex); + gl.uniform1i(uniform, unit); + }; + const render = (now) => { - const dt = Math.min((now - t0) * 0.001, 0.1); + if (now - lastDraw < FRAME_MIN) { + animId = requestAnimationFrame(render); + return; + } + const rawDt = (now - t0) * 0.001; + const dt = Math.min(rawDt, 0.1); t0 = now; - - const rect = canvas.getBoundingClientRect(); - const isMobile = window.innerWidth < 768; - const dpr = Math.min(window.devicePixelRatio || 1, isMobile ? 1.0 : 1.35); - const width = Math.floor(rect.width * dpr); - const height = Math.floor(rect.height * dpr); - - if (canvas.width !== width || canvas.height !== height) { - canvas.width = width; - canvas.height = height; - gl.viewport(0, 0, width, height); + frames += 1; + canvas.dataset.frames = String(frames); + if (lastDraw) { + frameSum += now - lastDraw; + frameCount++; + if (frameCount >= 3 && now - windowStart > 600) { + const avg = frameSum / frameCount; + if (avg > 45 && quality > 0) { + quality = avg > 200 ? Math.max(0, quality - 2) + : avg > 90 ? Math.max(0, quality - 1) + : quality - 1; + } else if (avg < 26 && quality < QUALITY.length - 1) { + quality++; + } + frameSum = 0; + frameCount = 0; + windowStart = now; + canvas.dataset.quality = String(quality); + } + } + lastDraw = now; + + const rect = rectRef.current.width > 0 ? rectRef.current : canvas.getBoundingClientRect(); + const isMobile = rect.width < 768; + const dpr = Math.min(window.devicePixelRatio || 1, 3); + const outW = Math.max(1, Math.round(rect.width * dpr)); + const outH = Math.max(1, Math.round(rect.height * dpr)); + const sw = Math.max(1, Math.round(rect.width * dpr * QUALITY[quality])); + const sh = Math.max(1, Math.round(rect.height * dpr * QUALITY[quality])); + + if (canvas.width !== outW || canvas.height !== outH) { + canvas.width = outW; + canvas.height = outH; } + sceneT.size(sw, sh); const st = stateRef.current; - if (st.autoRotate && !st.isDragging) { - st.yaw += dt * 0.12; + const follow = 1 - Math.exp(-dt / FOLLOW_TAU); + const takeX = st.pendingX * follow; + const takeY = st.pendingY * follow; + st.pendingX -= takeX; + st.pendingY -= takeY; + if (import.meta.env.DEV) { + st.applied = (st.applied || 0) + takeX; + st.appliedGlide = (st.appliedGlide || 0) + (st.isDragging ? 0 : st.velX * dt); } - - if (!st.isDragging) { - st.yaw += st.yawVel * dt; - st.pitch += st.pitchVel * dt; - st.yawVel *= 0.92; - st.pitchVel *= 0.92; + if (st.isDragging) { + turn(takeX, takeY); + } else { + const damp = Math.exp(-GLIDE * dt); + st.velX *= damp; + st.velY *= damp; + const yawRate = st.velX + (reduceMotion.matches ? 0 : DRIFT); + turn(takeX + yawRate * dt, takeY + st.velY * dt); + } + const spinDt = Math.min(rawDt, 0.5); + st.spin = st.isDragging + ? Math.min(1, st.spin + spinDt * 1.15) + : Math.max(0, st.spin - spinDt * 0.55); + const dolly = 1 + DOLLY_MAX * st.spin; + + const pos = st.back.map((v) => v * st.dist * dolly); + const fwd = st.back.map((v) => -v); + + let center; + let scale; + const minCss = Math.min(rect.width, rect.height); + const layout = layoutRef.current; + if (isMobile || layout.compact) { + if (layout.ready) { + scale = layout.scale; + center = [0.5 - (layout.shiftX || 0), 1 - layout.eyeY / rect.height]; + } else { + center = [0.5, 0.7]; + scale = 1.0; + } + } else { + const cssW = rect.width; + let textRight = 760; + if (cssW >= 1440) textRight = (cssW - 1440) / 2 + 760; + else if (cssW < 1280) textRight = Math.min(760, cssW * 0.58); + const free = Math.max(cssW - textRight, 200); + scale = Math.max(0.6, Math.min(1.8, (0.52 * minCss) / free)); + center = [(textRight + free * 0.18) / cssW, 0.47]; } + if ((isMobile || layout.compact) && layout.ready) { + const pitch = Math.asin(Math.max(-1, Math.min(1, st.back[1]))); + const tilt = Math.abs(Math.sin(pitch)); + const need = ((TILT_BASE + TILT_GROW * tilt) * minCss) / layout.room; + const target = Math.max(1, need / layout.scale); + st.fit += (target - st.fit) * Math.min(1, dt * 8); + scale *= st.fit; + } else { + st.fit = 1; + } + scale *= st.dist / DEFAULT_DIST; + + const holeR = (0.37 * minCss) / scale; + st.hole = { x: center[0] * rect.width, y: (1 - center[1]) * rect.height, r: holeR }; + + const S = loc.scene; + pass(progs.scene, sceneT, sw, sh); + gl.uniform2f(S.uRes, sw, sh); + gl.uniform1f(S.uTime, (now * 0.001) % 3600); + gl.uniform3fv(S.uCamPos, pos); + gl.uniform3fv(S.uCamRight, st.right); + gl.uniform3fv(S.uCamUp, st.up); + gl.uniform3fv(S.uCamFwd, fwd); + gl.uniform2f(S.uCenter, center[0], center[1]); + gl.uniform1f(S.uScale, scale); + gl.uniform1f(S.uSteps, STEPS[quality]); + gl.drawArrays(gl.TRIANGLES, 0, 6); - st.pitch = Math.max(-0.65, Math.min(0.65, st.pitch)); + pass(progs.blit, null, outW, outH); + bindTex(0, sceneT.tex, loc.blit.uTex); + gl.drawArrays(gl.TRIANGLES, 0, 6); - gl.useProgram(prog); - gl.enableVertexAttribArray(aPos); - gl.bindBuffer(gl.ARRAY_BUFFER, posBuf); - gl.vertexAttribPointer(aPos, 2, gl.FLOAT, false, 0, 0); + const moving = st.isDragging + || Math.abs(st.velX) > 0.002 + || Math.abs(st.velY) > 0.002 + || Math.abs(st.pendingX) > 0.0001 + || Math.abs(st.pendingY) > 0.0001; + if (visible && (!reduceMotion.matches || moving)) { + animId = requestAnimationFrame(render); + } else { + running = false; + } + }; - gl.uniform2f(uRes, width, height); - gl.uniform1f(uTime, now * 0.001); - gl.uniform1f(uYaw, st.yaw); - gl.uniform1f(uPitch, st.pitch); - gl.uniform1f(uDist, st.dist); + const turn = (a, b) => { + const st = stateRef.current; + let { right, up, back } = st; + if (a) { + back = rotate(back, up, a); + right = rotate(right, up, a); + } + if (b) { + back = rotate(back, right, b); + up = rotate(up, right, b); + } + back = norm(back); + right = norm(cross(up, back)); + up = cross(back, right); + const pitch = Math.asin(Math.max(-1, Math.min(1, back[1]))); + if (pitch > PITCH_MAX || pitch < PITCH_MIN) { + const target = Math.max(PITCH_MIN, Math.min(PITCH_MAX, pitch)); + back = norm(rotate(back, right, target - pitch)); + right = norm(cross(up, back)); + up = cross(back, right); + st.velY = 0; + st.pendingY = 0; + } + Object.assign(st, { right, up, back }); + }; - gl.drawArrays(gl.TRIANGLES, 0, 6); + const start = () => { + if (running || !visible) return; + running = true; + t0 = performance.now(); + lastDraw = 0; animId = requestAnimationFrame(render); }; + stateRef.current.wake = start; + + const observer = new IntersectionObserver(([entry]) => { + visible = entry.isIntersecting; + if (visible) start(); + }); + observer.observe(canvas); + reduceMotion.addEventListener('change', start); + + const onVisibility = () => { + visible = !document.hidden; + if (visible) start(); + }; + document.addEventListener('visibilitychange', onVisibility); - animId = requestAnimationFrame(render); + const onContextLost = (e) => { + e.preventDefault(); + cancelAnimationFrame(animId); + running = false; + visible = false; + }; + canvas.addEventListener('webglcontextlost', onContextLost); + if (import.meta.env.DEV) window.__hotaru = stateRef.current; + start(); + + const dragTo = (x, y) => { + const st = stateRef.current; + const now = performance.now(); + const dx = x - st.lastX; + const dy = y - st.lastY; + const dt = Math.min(0.2, Math.max(0.005, (now - st.lastT) / 1000)); + st.lastX = x; + st.lastY = y; + st.lastT = now; + st.pendingX += -dx * SENS; + st.pendingY += dy * SENS; + const k = 1 - Math.exp(-dt / VEL_TAU); + st.velX += (-dx * SENS / dt - st.velX) * k; + st.velY += (dy * SENS / dt - st.velY) * k; + st.velX = Math.max(-MAX_RATE, Math.min(MAX_RATE, st.velX)); + st.velY = Math.max(-MAX_RATE, Math.min(MAX_RATE, st.velY)); + const effort = Math.min(0.14, (Math.abs(dx) + Math.abs(dy)) * SENS * 26); + st.spin = Math.min(1, st.spin + effort); + }; + const beginDrag = (x, y) => { + Object.assign(stateRef.current, { + isDragging: true, + lastX: x, + lastY: y, + lastT: performance.now(), + velX: 0, + velY: 0, + pendingX: 0, + pendingY: 0, + }); + start(); + }; + const endDrag = () => { + stateRef.current.isDragging = false; + }; + const zoomBy = (k) => { + stateRef.current.dist = Math.max(DIST_MIN, Math.min(DIST_MAX, stateRef.current.dist * k)); + start(); + }; const onPointerDown = (e) => { - if (e.pointerType === 'touch') { - stateRef.current.lastX = e.clientX; - stateRef.current.lastY = e.clientY; + if (e.pointerType === 'touch') return; + beginDrag(e.clientX, e.clientY); + }; + const onPointerMove = (e) => { + if (e.pointerType === 'touch' || !stateRef.current.isDragging) return; + dragTo(e.clientX, e.clientY); + }; + const onPointerUp = (e) => { + if (e.pointerType === 'touch') return; + endDrag(); + }; + + let pinch = 0; + const touchDist = (t) => Math.hypot(t[0].clientX - t[1].clientX, t[0].clientY - t[1].clientY); + const onTouchStart = (e) => { + const rect = canvas.getBoundingClientRect(); + if (e.touches.length === 2) { + e.preventDefault(); + pinch = touchDist(e.touches); + stateRef.current.isDragging = false; return; } - stateRef.current.isDragging = true; - stateRef.current.lastX = e.clientX; - stateRef.current.lastY = e.clientY; - stateRef.current.yawVel = 0; - stateRef.current.pitchVel = 0; + const t = e.touches[0]; + const { hole } = stateRef.current; + if (Math.hypot(t.clientX - rect.left - hole.x, t.clientY - rect.top - hole.y) > hole.r) return; + e.preventDefault(); + beginDrag(t.clientX, t.clientY); }; - - const onPointerMove = (e) => { - if (e.pointerType === 'touch') { - const dx = e.clientX - stateRef.current.lastX; - const dy = e.clientY - stateRef.current.lastY; - if (Math.abs(dx) > Math.abs(dy) + 4) { - stateRef.current.yaw -= dx * 0.005; - stateRef.current.lastX = e.clientX; - stateRef.current.lastY = e.clientY; - } + const onTouchMove = (e) => { + if (e.touches.length === 2 && pinch) { + e.preventDefault(); + const d = touchDist(e.touches); + zoomBy(pinch / d); + pinch = d; return; } if (!stateRef.current.isDragging) return; - const dx = e.clientX - stateRef.current.lastX; - const dy = e.clientY - stateRef.current.lastY; - stateRef.current.lastX = e.clientX; - stateRef.current.lastY = e.clientY; - - const sens = 0.005; - stateRef.current.yaw -= dx * sens; - stateRef.current.pitch += dy * sens; - stateRef.current.yawVel = -dx * sens * 30; - stateRef.current.pitchVel = dy * sens * 30; + e.preventDefault(); + dragTo(e.touches[0].clientX, e.touches[0].clientY); }; - - const onPointerUp = () => { - stateRef.current.isDragging = false; + const onTouchEnd = (e) => { + if (e.touches.length < 2) pinch = 0; + if (e.touches.length === 0) stateRef.current.isDragging = false; }; const onWheel = (e) => { - if (Math.abs(e.deltaY) > 0) { - stateRef.current.dist = Math.max(14.0, Math.min(38.0, stateRef.current.dist + e.deltaY * 0.015)); - } + if (!(e.ctrlKey || e.metaKey)) return; + e.preventDefault(); + if (e.deltaY) zoomBy(Math.exp(e.deltaY * 0.0015)); }; canvas.addEventListener('pointerdown', onPointerDown); window.addEventListener('pointermove', onPointerMove); window.addEventListener('pointerup', onPointerUp); - canvas.addEventListener('wheel', onWheel, { passive: true }); + window.addEventListener('blur', endDrag); + canvas.addEventListener('touchstart', onTouchStart, { passive: false }); + canvas.addEventListener('touchmove', onTouchMove, { passive: false }); + canvas.addEventListener('touchend', onTouchEnd); + canvas.addEventListener('touchcancel', onTouchEnd); + canvas.addEventListener('wheel', onWheel, { passive: false }); return () => { cancelAnimationFrame(animId); + observer.disconnect(); + reduceMotion.removeEventListener('change', start); + document.removeEventListener('visibilitychange', onVisibility); + canvas.removeEventListener('webglcontextlost', onContextLost); canvas.removeEventListener('pointerdown', onPointerDown); window.removeEventListener('pointermove', onPointerMove); window.removeEventListener('pointerup', onPointerUp); + window.removeEventListener('blur', endDrag); + canvas.removeEventListener('touchstart', onTouchStart); + canvas.removeEventListener('touchmove', onTouchMove); + canvas.removeEventListener('touchend', onTouchEnd); + canvas.removeEventListener('touchcancel', onTouchEnd); canvas.removeEventListener('wheel', onWheel); - if (posBuf) gl.deleteBuffer(posBuf); - if (prog) gl.deleteProgram(prog); + gl.deleteBuffer(posBuf); + sceneT.free(); + Object.values(progs).forEach((p) => gl.deleteProgram(p)); }; }, []); return ( -
+
+
+
+ {labels.hint} + +
+
+ ); } diff --git a/src/components/Reveal.jsx b/src/components/Reveal.jsx new file mode 100644 index 0000000..d6a3736 --- /dev/null +++ b/src/components/Reveal.jsx @@ -0,0 +1,58 @@ +import React, { useEffect, useRef, useState } from 'react'; + +export function Reveal({ as: Tag = 'div', className = '', delay = 0, children }) { + const ref = useRef(null); + const [shown, setShown] = useState(false); + + useEffect(() => { + const el = ref.current; + if (!el) return undefined; + if (typeof IntersectionObserver === 'undefined') { + setShown(true); + return undefined; + } + + let frame = 0; + const reveal = () => setShown(true); + const check = () => { + const rect = el.getBoundingClientRect(); + if (rect.top < window.innerHeight * 1.12 && rect.bottom > 0) reveal(); + }; + const onScroll = () => { + if (frame) return; + frame = window.requestAnimationFrame(() => { + frame = 0; + check(); + }); + }; + + const observer = new IntersectionObserver( + (entries) => { + entries.forEach((entry) => { + if (entry.isIntersecting) reveal(); + }); + }, + { threshold: 0.02, rootMargin: '0px 0px 12% 0px' } + ); + observer.observe(el); + window.addEventListener('scroll', onScroll, { passive: true }); + window.addEventListener('resize', onScroll); + const timer = window.setTimeout(check, 1200); + + return () => { + observer.disconnect(); + window.removeEventListener('scroll', onScroll); + window.removeEventListener('resize', onScroll); + window.clearTimeout(timer); + if (frame) window.cancelAnimationFrame(frame); + }; + }, []); + + const style = delay ? { transitionDelay: `${delay}ms` } : undefined; + + return ( + + {children} + + ); +} diff --git a/src/components/RevealGroup.jsx b/src/components/RevealGroup.jsx new file mode 100644 index 0000000..f0b9798 --- /dev/null +++ b/src/components/RevealGroup.jsx @@ -0,0 +1,71 @@ +import React, { useEffect, useRef, useState } from 'react'; + +export function RevealGroup({ as: Tag = 'div', className = '', delay = 0, children }) { + const ref = useRef(null); + const [shown, setShown] = useState(false); + + useEffect(() => { + const el = ref.current; + if (!el) return undefined; + if (typeof IntersectionObserver === 'undefined') { + setShown(true); + return undefined; + } + + let frame = 0; + let observer = null; + const reveal = () => { + setShown(true); + if (observer) observer.disconnect(); + window.removeEventListener('scroll', onScroll); + }; + const check = () => { + const rect = el.getBoundingClientRect(); + if (rect.top < window.innerHeight * 1.12 && rect.bottom > 0) reveal(); + }; + const onScroll = () => { + if (frame) return; + frame = window.requestAnimationFrame(() => { + frame = 0; + check(); + }); + }; + + observer = new IntersectionObserver( + (entries) => { + entries.forEach((entry) => { + if (entry.isIntersecting) reveal(); + }); + }, + { threshold: 0.02, rootMargin: '0px 0px 12% 0px' } + ); + observer.observe(el); + window.addEventListener('scroll', onScroll, { passive: true }); + window.addEventListener('resize', onScroll); + const timer = window.setTimeout(check, 1200); + + return () => { + if (observer) observer.disconnect(); + window.removeEventListener('scroll', onScroll); + window.removeEventListener('resize', onScroll); + window.clearTimeout(timer); + if (frame) window.cancelAnimationFrame(frame); + }; + }, []); + + const items = React.Children.map(children, (child) => { + if (!React.isValidElement(child)) return child; + const cls = child.props.className ? `${child.props.className} keep-motion` : 'keep-motion'; + return React.cloneElement(child, { className: cls }); + }); + + return ( + + {items} + + ); +} diff --git a/src/components/SectionHeader.jsx b/src/components/SectionHeader.jsx new file mode 100644 index 0000000..fa72858 --- /dev/null +++ b/src/components/SectionHeader.jsx @@ -0,0 +1,16 @@ +import React from 'react'; + +export function SectionHeader({ kicker, title, note, aside }) { + return ( +
+
+ {kicker ?

{kicker}

: null} +

{title}

+
+
+

{note}

+ {aside ?
{aside}
: null} +
+
+ ); +} diff --git a/src/components/Skill.jsx b/src/components/Skill.jsx new file mode 100644 index 0000000..5275b4b --- /dev/null +++ b/src/components/Skill.jsx @@ -0,0 +1,47 @@ +import React from 'react'; +import { Download } from 'lucide-react'; +import { SectionHeader } from './SectionHeader'; +import { Reveal } from './Reveal.jsx'; +import { CopyBlock } from './CopyBlock'; + +const SKILL_CMD = 'curl -fsSL https://hotaruproject.github.io/skill/SKILL.md -o HOTARU_AGENT_SKILL.md'; + +export function Skill({ content, copyLabels }) { + const t = content.skill; + + return ( +
+
+ + + + +
+ +
    + {t.points.map((point) => ( +
  • {point}
  • + ))} +
+ + + +
+ + + + +
+
+
+ ); +} diff --git a/src/data/catalog.jsx b/src/data/catalog.jsx new file mode 100644 index 0000000..f635704 --- /dev/null +++ b/src/data/catalog.jsx @@ -0,0 +1,7726 @@ +export const CATALOG_METHODS = [ + { + "name": "set_checklist_completed", + "rpc": "messages.toggleTodoCompleted", + "namespace": "messages", + "signature": "await ctx.set_checklist_completed(peer: InputPeer, msg_id: int, completed: Vector, incompleted: Vector)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "msg_id", + "type": "int", + "required": false, + "default": "$message" + }, + { + "name": "completed", + "type": "Vector", + "required": true, + "default": null + }, + { + "name": "incompleted", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Mark one or more items of a todo list as completed or not completed.", + "desc_ru": "Отметить один или несколько пунктов списка задач как выполненные или невыполненные." + }, + { + "name": "add_poll_answer", + "rpc": "messages.addPollAnswer", + "namespace": "messages", + "signature": "await ctx.add_poll_answer(peer: InputPeer, msg_id: int, answer: PollAnswer)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "msg_id", + "type": "int", + "required": false, + "default": "$message" + }, + { + "name": "answer", + "type": "PollAnswer", + "required": true, + "default": null + } + ], + "desc_en": "Add an answer option to an open-answer poll", + "desc_ru": "Добавить вариант ответа в открытый опрос." + }, + { + "name": "remove_poll_answer", + "rpc": "messages.deletePollAnswer", + "namespace": "messages", + "signature": "await ctx.remove_poll_answer(peer: InputPeer, msg_id: int, option: bytes)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "msg_id", + "type": "int", + "required": false, + "default": "$message" + }, + { + "name": "option", + "type": "bytes", + "required": true, + "default": null + } + ], + "desc_en": "Remove an answer option from an open-answer poll", + "desc_ru": "Удалить вариант ответа из открытого опроса." + }, + { + "name": "unread_poll_votes", + "rpc": "messages.getUnreadPollVotes", + "namespace": "messages", + "signature": "await ctx.unread_poll_votes(peer: InputPeer, offset_id: int, add_offset: int, limit: int, max_id: int, min_id: int)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "top_msg_id", + "type": "flags.0?int", + "required": false, + "default": null + }, + { + "name": "offset_id", + "type": "int", + "required": false, + "default": null + }, + { + "name": "add_offset", + "type": "int", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + }, + { + "name": "max_id", + "type": "int", + "required": false, + "default": null + }, + { + "name": "min_id", + "type": "int", + "required": false, + "default": null + } + ], + "desc_en": "Get messages containing polls with unread votes", + "desc_ru": "Получить сообщения с опросами, в которых есть непрочитанные голоса." + }, + { + "name": "mark_poll_votes_read", + "rpc": "messages.readPollVotes", + "namespace": "messages", + "signature": "await ctx.mark_poll_votes_read(peer: InputPeer)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "top_msg_id", + "type": "flags.0?int", + "required": false, + "default": null + } + ], + "desc_en": "Mark all unread poll votes in a chat as read", + "desc_ru": "Отметить все непрочитанные голоса в опросах чата как прочитанные." + }, + { + "name": "poll_statistics", + "rpc": "stats.getPollStats", + "namespace": "stats", + "signature": "await ctx.poll_statistics(peer: InputPeer, msg_id: int)", + "returns": "Any", + "params": [ + { + "name": "dark", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "msg_id", + "type": "int", + "required": false, + "default": "$message" + } + ], + "desc_en": "Get statistics for a poll sent in a message.", + "desc_ru": "Получить статистику опроса, отправленного в сообщении." + }, + { + "name": "scheduled_messages", + "rpc": "messages.getScheduledHistory", + "namespace": "messages", + "signature": "await ctx.scheduled_messages(peer: InputPeer, hash: long)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Get scheduled messages", + "desc_ru": "Получить отложенные сообщения." + }, + { + "name": "scheduled_by_ids", + "rpc": "messages.getScheduledMessages", + "namespace": "messages", + "signature": "await ctx.scheduled_by_ids(peer: InputPeer, id: Vector)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "id", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Get scheduled messages", + "desc_ru": "Получить отложенные сообщения по их идентификаторам." + }, + { + "name": "publish_scheduled", + "rpc": "messages.sendScheduledMessages", + "namespace": "messages", + "signature": "await ctx.publish_scheduled(peer: InputPeer, id: Vector)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "id", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Send scheduled messages right away", + "desc_ru": "Отправить отложенные сообщения немедленно." + }, + { + "name": "cancel_scheduled", + "rpc": "messages.deleteScheduledMessages", + "namespace": "messages", + "signature": "await ctx.cancel_scheduled(peer: InputPeer, id: Vector)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "id", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Delete scheduled messages", + "desc_ru": "Удалить отложенные сообщения." + }, + { + "name": "configure_chat_reactions", + "rpc": "messages.setChatAvailableReactions", + "namespace": "messages", + "signature": "await ctx.configure_chat_reactions(peer: InputPeer, available_reactions: ChatReactions)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "available_reactions", + "type": "ChatReactions", + "required": true, + "default": null + }, + { + "name": "reactions_limit", + "type": "flags.0?int", + "required": false, + "default": null + }, + { + "name": "paid_enabled", + "type": "flags.1?Bool", + "required": false, + "default": null + } + ], + "desc_en": "Change the set of message reactions that can be used in a certain group, supergroup or channel", + "desc_ru": "Изменить набор реакций на сообщения, доступных в группе, супергруппе или канале." + }, + { + "name": "available_reactions", + "rpc": "messages.getAvailableReactions", + "namespace": "messages", + "signature": "await ctx.available_reactions(hash: int)", + "returns": "Any", + "params": [ + { + "name": "hash", + "type": "int", + "required": false, + "default": null + } + ], + "desc_en": "Obtain available message reactions", + "desc_ru": "Получить доступные реакции на сообщения." + }, + { + "name": "set_default_reaction", + "rpc": "messages.setDefaultReaction", + "namespace": "messages", + "signature": "await ctx.set_default_reaction(reaction: Reaction)", + "returns": "Any", + "params": [ + { + "name": "reaction", + "type": "Reaction", + "required": true, + "default": null + } + ], + "desc_en": "Change default emoji reaction to use in the quick reaction menu: the value is synced across devices and can be fetched using help.getConfig, reactions_default field.", + "desc_ru": "Задать реакцию по умолчанию для быстрого меню реакций. Значение синхронизируется между устройствами и читается через help.getConfig, поле reactions_default." + }, + { + "name": "unread_reactions", + "rpc": "messages.getUnreadReactions", + "namespace": "messages", + "signature": "await ctx.unread_reactions(peer: InputPeer, offset_id: int, add_offset: int, limit: int, max_id: int, min_id: int)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "top_msg_id", + "type": "flags.0?int", + "required": false, + "default": null + }, + { + "name": "saved_peer_id", + "type": "flags.1?InputPeer", + "required": false, + "default": null + }, + { + "name": "offset_id", + "type": "int", + "required": false, + "default": null + }, + { + "name": "add_offset", + "type": "int", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + }, + { + "name": "max_id", + "type": "int", + "required": false, + "default": null + }, + { + "name": "min_id", + "type": "int", + "required": false, + "default": null + } + ], + "desc_en": "Get unread reactions to messages you sent", + "desc_ru": "Получить непрочитанные реакции на отправленные нами сообщения." + }, + { + "name": "mark_reactions_read", + "rpc": "messages.readReactions", + "namespace": "messages", + "signature": "await ctx.mark_reactions_read(peer: InputPeer)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "top_msg_id", + "type": "flags.0?int", + "required": false, + "default": null + }, + { + "name": "saved_peer_id", + "type": "flags.1?InputPeer", + "required": false, + "default": null + } + ], + "desc_en": "Mark message reactions as read", + "desc_ru": "Отметить реакции на сообщения как прочитанные." + }, + { + "name": "popular_reactions", + "rpc": "messages.getTopReactions", + "namespace": "messages", + "signature": "await ctx.popular_reactions(limit: int, hash: long)", + "returns": "Any", + "params": [ + { + "name": "limit", + "type": "int", + "required": false, + "default": null + }, + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Got popular message reactions", + "desc_ru": "Получить популярные реакции на сообщения." + }, + { + "name": "recent_reactions", + "rpc": "messages.getRecentReactions", + "namespace": "messages", + "signature": "await ctx.recent_reactions(limit: int, hash: long)", + "returns": "Any", + "params": [ + { + "name": "limit", + "type": "int", + "required": false, + "default": null + }, + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Get recently used message reactions", + "desc_ru": "Получить недавно использованные реакции на сообщения." + }, + { + "name": "clear_recent_reactions", + "rpc": "messages.clearRecentReactions", + "namespace": "messages", + "signature": "await ctx.clear_recent_reactions()", + "returns": "Any", + "params": [ + ], + "desc_en": "Clear recently used message reactions", + "desc_ru": "Очистить список недавно использованных реакций на сообщения." + }, + { + "name": "remove_member_reactions", + "rpc": "messages.deleteParticipantReactions", + "namespace": "messages", + "signature": "await ctx.remove_member_reactions(peer: InputPeer, participant: InputPeer)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "participant", + "type": "InputPeer", + "required": true, + "default": null + } + ], + "desc_en": "As an admin, remove all of a specific participant's reactions from every message in a group or channel.", + "desc_ru": "Снять все реакции конкретного участника со всех сообщений в группе или канале. Требуются права администратора." + }, + { + "name": "remove_member_message_reaction", + "rpc": "messages.deleteParticipantReaction", + "namespace": "messages", + "signature": "await ctx.remove_member_message_reaction(peer: InputPeer, msg_id: int, participant: InputPeer)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "msg_id", + "type": "int", + "required": false, + "default": "$message" + }, + { + "name": "participant", + "type": "InputPeer", + "required": true, + "default": null + } + ], + "desc_en": "As an admin, remove all of a specific participant's reactions from a single message.", + "desc_ru": "Снять все реакции конкретного участника с одного сообщения. Требуются права администратора." + }, + { + "name": "saved_dialogs", + "rpc": "messages.getSavedDialogs", + "namespace": "messages", + "signature": "await ctx.saved_dialogs(offset_date: int, offset_id: int, offset_peer: InputPeer, limit: int, hash: long)", + "returns": "Any", + "params": [ + { + "name": "exclude_pinned", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "parent_peer", + "type": "flags.1?InputPeer", + "required": false, + "default": null + }, + { + "name": "offset_date", + "type": "int", + "required": false, + "default": null + }, + { + "name": "offset_id", + "type": "int", + "required": false, + "default": null + }, + { + "name": "offset_peer", + "type": "InputPeer", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + }, + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Returns the current saved dialog list or monoforum topic list.", + "desc_ru": "Вернуть текущий список диалогов сохранённых сообщений или тем монфорума." + }, + { + "name": "saved_history", + "rpc": "messages.getSavedHistory", + "namespace": "messages", + "signature": "await ctx.saved_history(peer: InputPeer, offset_id: int, offset_date: int, add_offset: int, limit: int, max_id: int, min_id: int, hash: long)", + "returns": "Any", + "params": [ + { + "name": "parent_peer", + "type": "flags.0?InputPeer", + "required": false, + "default": null + }, + { + "name": "peer", + "type": "InputPeer", + "required": true, + "default": null + }, + { + "name": "offset_id", + "type": "int", + "required": false, + "default": null + }, + { + "name": "offset_date", + "type": "int", + "required": false, + "default": null + }, + { + "name": "add_offset", + "type": "int", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + }, + { + "name": "max_id", + "type": "int", + "required": false, + "default": null + }, + { + "name": "min_id", + "type": "int", + "required": false, + "default": null + }, + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Fetch saved messages forwarded from a specific peer, or fetch messages from a monoforum topic.", + "desc_ru": "Получить сохранённые сообщения, пересланные от конкретного собеседника, или сообщения из темы монфорума." + }, + { + "name": "clear_saved_history", + "rpc": "messages.deleteSavedHistory", + "namespace": "messages", + "signature": "await ctx.clear_saved_history(peer: InputPeer, max_id: int)", + "returns": "Any", + "params": [ + { + "name": "parent_peer", + "type": "flags.0?InputPeer", + "required": false, + "default": null + }, + { + "name": "peer", + "type": "InputPeer", + "required": true, + "default": null + }, + { + "name": "max_id", + "type": "int", + "required": true, + "default": null + }, + { + "name": "min_date", + "type": "flags.2?int", + "required": false, + "default": null + }, + { + "name": "max_date", + "type": "flags.3?int", + "required": false, + "default": null + } + ], + "desc_en": "Deletes messages from a monoforum topic, or deletes messages forwarded from a specific peer to saved messages.", + "desc_ru": "Удалить сообщения из темы монфорума или пересланные от конкретного собеседника в сохранённые сообщения." + }, + { + "name": "pinned_saved_dialogs", + "rpc": "messages.getPinnedSavedDialogs", + "namespace": "messages", + "signature": "await ctx.pinned_saved_dialogs()", + "returns": "Any", + "params": [ + ], + "desc_en": "Get pinned saved dialogs, see here for more info.", + "desc_ru": "Получить закреплённые диалоги сохранённых сообщений." + }, + { + "name": "set_saved_dialog_pinned", + "rpc": "messages.toggleSavedDialogPin", + "namespace": "messages", + "signature": "await ctx.set_saved_dialog_pinned(peer: InputDialogPeer)", + "returns": "Any", + "params": [ + { + "name": "pinned", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "peer", + "type": "InputDialogPeer", + "required": true, + "default": null + } + ], + "desc_en": "Pin or unpin a saved message dialog.", + "desc_ru": "Закрепить или открепить диалог сохранённых сообщений." + }, + { + "name": "reorder_saved_pins", + "rpc": "messages.reorderPinnedSavedDialogs", + "namespace": "messages", + "signature": "await ctx.reorder_saved_pins(order: Vector)", + "returns": "Any", + "params": [ + { + "name": "force", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "order", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Reorder pinned saved message dialogs.", + "desc_ru": "Изменить порядок закреплённых диалогов сохранённых сообщений." + }, + { + "name": "saved_reaction_tags", + "rpc": "messages.getSavedReactionTags", + "namespace": "messages", + "signature": "await ctx.saved_reaction_tags(hash: long)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "flags.0?InputPeer", + "required": false, + "default": null + }, + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Fetch the full list of saved message tags created by the user.", + "desc_ru": "Получить полный список созданных пользователем тегов сохранённых сообщений." + }, + { + "name": "rename_saved_tag", + "rpc": "messages.updateSavedReactionTag", + "namespace": "messages", + "signature": "await ctx.rename_saved_tag(reaction: Reaction)", + "returns": "Any", + "params": [ + { + "name": "reaction", + "type": "Reaction", + "required": true, + "default": null + }, + { + "name": "title", + "type": "flags.0?string", + "required": false, + "default": null + } + ], + "desc_en": "Update the description of a saved message tag.", + "desc_ru": "Изменить описание тега сохранённых сообщений." + }, + { + "name": "suggested_saved_tags", + "rpc": "messages.getDefaultTagReactions", + "namespace": "messages", + "signature": "await ctx.suggested_saved_tags(hash: long)", + "returns": "Any", + "params": [ + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Fetch a default recommended list of saved message tag reactions.", + "desc_ru": "Получить рекомендуемый список тегов для сохранённых сообщений." + }, + { + "name": "saved_dialogs_by_peers", + "rpc": "messages.getSavedDialogsByID", + "namespace": "messages", + "signature": "await ctx.saved_dialogs_by_peers(ids: Vector)", + "returns": "Any", + "params": [ + { + "name": "parent_peer", + "type": "flags.1?InputPeer", + "required": false, + "default": null + }, + { + "name": "ids", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Obtain information about specific saved message dialogs or monoforum topics.", + "desc_ru": "Получить сведения о конкретных диалогах сохранённых сообщений или темах монфорума." + }, + { + "name": "mark_saved_history_read", + "rpc": "messages.readSavedHistory", + "namespace": "messages", + "signature": "await ctx.mark_saved_history_read(parent_peer: InputPeer, peer: InputPeer, max_id: int)", + "returns": "Any", + "params": [ + { + "name": "parent_peer", + "type": "InputPeer", + "required": true, + "default": null + }, + { + "name": "peer", + "type": "InputPeer", + "required": true, + "default": null + }, + { + "name": "max_id", + "type": "int", + "required": true, + "default": null + } + ], + "desc_en": "Mark messages as read in a monoforum topic.", + "desc_ru": "Отметить сообщения в теме монфорума как прочитанные." + }, + { + "name": "forum_topics", + "rpc": "messages.getForumTopics", + "namespace": "messages", + "signature": "await ctx.forum_topics(peer: InputPeer, offset_date: int, offset_id: int, offset_topic: int, limit: int)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "q", + "type": "flags.0?string", + "required": false, + "default": null + }, + { + "name": "offset_date", + "type": "int", + "required": false, + "default": null + }, + { + "name": "offset_id", + "type": "int", + "required": false, + "default": null + }, + { + "name": "offset_topic", + "type": "int", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + } + ], + "desc_en": "Get topics of a forum", + "desc_ru": "Получить темы форума." + }, + { + "name": "forum_topics_by_ids", + "rpc": "messages.getForumTopicsByID", + "namespace": "messages", + "signature": "await ctx.forum_topics_by_ids(peer: InputPeer, topics: Vector)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "topics", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Get forum topics by their ID", + "desc_ru": "Получить темы форума по их идентификаторам." + }, + { + "name": "edit_forum_topic", + "rpc": "messages.editForumTopic", + "namespace": "messages", + "signature": "await ctx.edit_forum_topic(peer: InputPeer, topic_id: int)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "topic_id", + "type": "int", + "required": true, + "default": null + }, + { + "name": "title", + "type": "flags.0?string", + "required": false, + "default": null + }, + { + "name": "icon_emoji_id", + "type": "flags.1?long", + "required": false, + "default": null + }, + { + "name": "closed", + "type": "flags.2?Bool", + "required": false, + "default": null + }, + { + "name": "hidden", + "type": "flags.3?Bool", + "required": false, + "default": null + } + ], + "desc_en": "Edit forum topic.", + "desc_ru": "Изменить тему форума." + }, + { + "name": "set_forum_topic_pinned", + "rpc": "messages.updatePinnedForumTopic", + "namespace": "messages", + "signature": "await ctx.set_forum_topic_pinned(peer: InputPeer, topic_id: int, pinned: Bool)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "topic_id", + "type": "int", + "required": true, + "default": null + }, + { + "name": "pinned", + "type": "Bool", + "required": true, + "default": null + } + ], + "desc_en": "Pin or unpin forum topics", + "desc_ru": "Закрепить или открепить темы форума." + }, + { + "name": "reorder_forum_pins", + "rpc": "messages.reorderPinnedForumTopics", + "namespace": "messages", + "signature": "await ctx.reorder_forum_pins(peer: InputPeer, order: Vector)", + "returns": "Any", + "params": [ + { + "name": "force", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "order", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Reorder pinned forum topics", + "desc_ru": "Изменить порядок закреплённых тем форума." + }, + { + "name": "create_forum_topic", + "rpc": "messages.createForumTopic", + "namespace": "messages", + "signature": "await ctx.create_forum_topic(peer: InputPeer, title: string, random_id: long)", + "returns": "Any", + "params": [ + { + "name": "title_missing", + "type": "flags.4?true", + "required": false, + "default": null + }, + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "title", + "type": "string", + "required": true, + "default": null + }, + { + "name": "icon_color", + "type": "flags.0?int", + "required": false, + "default": null + }, + { + "name": "icon_emoji_id", + "type": "flags.3?long", + "required": false, + "default": null + }, + { + "name": "random_id", + "type": "long", + "required": false, + "default": "$random_id" + }, + { + "name": "send_as", + "type": "flags.2?InputPeer", + "required": false, + "default": null + } + ], + "desc_en": "Create a forum topic.", + "desc_ru": "Создать тему форума." + }, + { + "name": "remove_forum_topic", + "rpc": "messages.deleteTopicHistory", + "namespace": "messages", + "signature": "await ctx.remove_forum_topic(peer: InputPeer, top_msg_id: int)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "top_msg_id", + "type": "int", + "required": true, + "default": null + } + ], + "desc_en": "Delete message history of a forum topic", + "desc_ru": "Удалить историю сообщений темы форума." + }, + { + "name": "set_forum_enabled", + "rpc": "channels.toggleForum", + "namespace": "channels", + "signature": "await ctx.set_forum_enabled(channel: InputChannel, enabled: Bool, tabs: Bool)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "enabled", + "type": "Bool", + "required": true, + "default": null + }, + { + "name": "tabs", + "type": "Bool", + "required": true, + "default": null + } + ], + "desc_en": "Enable or disable forum functionality in a supergroup.", + "desc_ru": "Включить или выключить режим форума в супергруппе." + }, + { + "name": "set_forum_message_view", + "rpc": "channels.toggleViewForumAsMessages", + "namespace": "channels", + "signature": "await ctx.set_forum_message_view(channel: InputChannel, enabled: Bool)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "enabled", + "type": "Bool", + "required": true, + "default": null + } + ], + "desc_en": "Users may also choose to display messages from all topics of a forum as if they were sent to a normal group, using a \"View as messages\" setting in the local client: this setting only affects the current account, and is synced to other logged in sessions using this method. Invoking this method will update the value of the view_forum_as_messages flag of channelFull or dialog and emit an updateChannelViewForumAsMessages.", + "desc_ru": "Пользователи могут показывать сообщения всех тем форума как сообщения обычной группы через настройку Показывать как сообщения. Настройка действует только на текущий аккаунт и синхронизируется с другими сессиями. Вызов обновляет флаг view_forum_as_messages у channelFull или dialog и вызывает updateChannelViewForumAsMessages." + }, + { + "name": "story_posting_quota", + "rpc": "stories.canSendStory", + "namespace": "stories", + "signature": "await ctx.story_posting_quota(peer: InputPeer)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": true, + "default": null + } + ], + "desc_en": "Check whether we can post stories as the specified peer.", + "desc_ru": "Проверить, можно ли публиковать истории от имени указанного собеседника." + }, + { + "name": "post_story", + "rpc": "stories.sendStory", + "namespace": "stories", + "signature": "await ctx.post_story(peer: InputPeer, media: InputMedia, privacy_rules: Vector, random_id: long)", + "returns": "Any", + "params": [ + { + "name": "pinned", + "type": "flags.2?true", + "required": false, + "default": null + }, + { + "name": "noforwards", + "type": "flags.4?true", + "required": false, + "default": null + }, + { + "name": "fwd_modified", + "type": "flags.7?true", + "required": false, + "default": null + }, + { + "name": "peer", + "type": "InputPeer", + "required": true, + "default": null + }, + { + "name": "media", + "type": "InputMedia", + "required": true, + "default": null + }, + { + "name": "media_areas", + "type": "flags.5?Vector", + "required": false, + "default": null + }, + { + "name": "caption", + "type": "flags.0?string", + "required": false, + "default": null + }, + { + "name": "entities", + "type": "flags.1?Vector", + "required": false, + "default": null + }, + { + "name": "privacy_rules", + "type": "Vector", + "required": true, + "default": null + }, + { + "name": "random_id", + "type": "long", + "required": false, + "default": "$random_id" + }, + { + "name": "period", + "type": "flags.3?int", + "required": false, + "default": null + }, + { + "name": "fwd_from_id", + "type": "flags.6?InputPeer", + "required": false, + "default": null + }, + { + "name": "fwd_from_story", + "type": "flags.6?int", + "required": false, + "default": null + }, + { + "name": "albums", + "type": "flags.8?Vector", + "required": false, + "default": null + }, + { + "name": "music", + "type": "flags.9?InputDocument", + "required": false, + "default": null + } + ], + "desc_en": "Uploads a Telegram Story. May also be used in a business connection, not by wrapping the query in invokeWithBusinessConnection, but rather by specifying the ID of a controlled business user in peer.", + "desc_ru": "Опубликовать историю Telegram. Может использоваться и в бизнес-подключении: укажите ID управляемого бизнес-пользователя в peer." + }, + { + "name": "edit_story", + "rpc": "stories.editStory", + "namespace": "stories", + "signature": "await ctx.edit_story(peer: InputPeer, id: int)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": true, + "default": null + }, + { + "name": "id", + "type": "int", + "required": true, + "default": null + }, + { + "name": "media", + "type": "flags.0?InputMedia", + "required": false, + "default": null + }, + { + "name": "media_areas", + "type": "flags.3?Vector", + "required": false, + "default": null + }, + { + "name": "caption", + "type": "flags.1?string", + "required": false, + "default": null + }, + { + "name": "entities", + "type": "flags.1?Vector", + "required": false, + "default": null + }, + { + "name": "privacy_rules", + "type": "flags.2?Vector", + "required": false, + "default": null + }, + { + "name": "music", + "type": "flags.4?InputDocument", + "required": false, + "default": null + } + ], + "desc_en": "Edit an uploaded story May also be used in a business connection, not by wrapping the query in invokeWithBusinessConnection, but rather by specifying the ID of a controlled business user in peer: in this context, the method can only be used to edit stories posted by the same business bot on behalf of the user with stories.sendStory.", + "desc_ru": "Изменить загруженную историю. Может использоваться и в бизнес-подключении: укажите ID управляемого бизнес-пользователя в peer, тогда метод правит только истории, опубликованные тем же ботом от имени пользователя." + }, + { + "name": "delete_stories", + "rpc": "stories.deleteStories", + "namespace": "stories", + "signature": "await ctx.delete_stories(peer: InputPeer, id: Vector)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": true, + "default": null + }, + { + "name": "id", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Deletes some posted stories.", + "desc_ru": "Удалить опубликованные истории." + }, + { + "name": "set_stories_on_profile", + "rpc": "stories.togglePinned", + "namespace": "stories", + "signature": "await ctx.set_stories_on_profile(peer: InputPeer, id: Vector, pinned: Bool)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": true, + "default": null + }, + { + "name": "id", + "type": "Vector", + "required": true, + "default": null + }, + { + "name": "pinned", + "type": "Bool", + "required": true, + "default": null + } + ], + "desc_en": "Pin or unpin one or more stories", + "desc_ru": "Закрепить или открепить одну или несколько историй." + }, + { + "name": "story_feed", + "rpc": "stories.getAllStories", + "namespace": "stories", + "signature": "await ctx.story_feed()", + "returns": "Any", + "params": [ + { + "name": "next", + "type": "flags.1?true", + "required": false, + "default": null + }, + { + "name": "hidden", + "type": "flags.2?true", + "required": false, + "default": null + }, + { + "name": "state", + "type": "flags.0?string", + "required": false, + "default": null + } + ], + "desc_en": "Fetch the List of active (or active and hidden) stories, see here for more info on watching stories.", + "desc_ru": "Получить список активных, а также активных и скрытых историй." + }, + { + "name": "profile_stories", + "rpc": "stories.getPinnedStories", + "namespace": "stories", + "signature": "await ctx.profile_stories(peer: InputPeer, offset_id: int, limit: int)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": true, + "default": null + }, + { + "name": "offset_id", + "type": "int", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + } + ], + "desc_en": "Fetch the stories pinned on a peer's profile.", + "desc_ru": "Получить истории, закреплённые в профиле собеседника." + }, + { + "name": "archived_stories", + "rpc": "stories.getStoriesArchive", + "namespace": "stories", + "signature": "await ctx.archived_stories(peer: InputPeer, offset_id: int, limit: int)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": true, + "default": null + }, + { + "name": "offset_id", + "type": "int", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + } + ], + "desc_en": "Fetch the story archive of a peer we control.", + "desc_ru": "Получить архив историй собеседника, которым мы управляем." + }, + { + "name": "stories_by_ids", + "rpc": "stories.getStoriesByID", + "namespace": "stories", + "signature": "await ctx.stories_by_ids(peer: InputPeer, id: Vector)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": true, + "default": null + }, + { + "name": "id", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Obtain full info about a set of stories by their IDs.", + "desc_ru": "Получить полные сведения об историях по их идентификаторам." + }, + { + "name": "mark_stories_read", + "rpc": "stories.readStories", + "namespace": "stories", + "signature": "await ctx.mark_stories_read(peer: InputPeer, max_id: int)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": true, + "default": null + }, + { + "name": "max_id", + "type": "int", + "required": false, + "default": null + } + ], + "desc_en": "Mark all stories up to a certain ID as read, for a given peer; will emit an updateReadStories update to all logged-in sessions.", + "desc_ru": "Отметить все истории до указанного идентификатора как прочитанные для заданного собеседника. Обновление updateReadStories уходит во все активные сессии." + }, + { + "name": "story_viewers", + "rpc": "stories.getStoryViewsList", + "namespace": "stories", + "signature": "await ctx.story_viewers(peer: InputPeer, id: int, offset: string, limit: int)", + "returns": "Any", + "params": [ + { + "name": "just_contacts", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "reactions_first", + "type": "flags.2?true", + "required": false, + "default": null + }, + { + "name": "forwards_first", + "type": "flags.3?true", + "required": false, + "default": null + }, + { + "name": "peer", + "type": "InputPeer", + "required": true, + "default": null + }, + { + "name": "q", + "type": "flags.1?string", + "required": false, + "default": null + }, + { + "name": "id", + "type": "int", + "required": true, + "default": null + }, + { + "name": "offset", + "type": "string", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + } + ], + "desc_en": "Obtain the list of users that have viewed a specific story we posted", + "desc_ru": "Получить список пользователей, посмотревших опубликованную нами историю." + }, + { + "name": "story_view_counts", + "rpc": "stories.getStoriesViews", + "namespace": "stories", + "signature": "await ctx.story_view_counts(peer: InputPeer, id: Vector)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": true, + "default": null + }, + { + "name": "id", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Obtain info about the view count, forward count, reactions and recent viewers of one or more stories.", + "desc_ru": "Получить число просмотров, пересылок, реакции и недавних зрителей одной или нескольких историй." + }, + { + "name": "story_link", + "rpc": "stories.exportStoryLink", + "namespace": "stories", + "signature": "await ctx.story_link(peer: InputPeer, id: int)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": true, + "default": null + }, + { + "name": "id", + "type": "int", + "required": true, + "default": null + } + ], + "desc_en": "Generate a story deep link for a specific story", + "desc_ru": "Сгенерировать ссылку на конкретную историю." + }, + { + "name": "activate_story_stealth", + "rpc": "stories.activateStealthMode", + "namespace": "stories", + "signature": "await ctx.activate_story_stealth()", + "returns": "Any", + "params": [ + { + "name": "past", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "future", + "type": "flags.1?true", + "required": false, + "default": null + } + ], + "desc_en": "Activates stories stealth mode, see here for more info. Will return an updateStoriesStealthMode.", + "desc_ru": "Включить режим скрытности историй. Возвращает updateStoriesStealthMode." + }, + { + "name": "react_to_story", + "rpc": "stories.sendReaction", + "namespace": "stories", + "signature": "await ctx.react_to_story(peer: InputPeer, story_id: int, reaction: Reaction)", + "returns": "Any", + "params": [ + { + "name": "add_to_recent", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "peer", + "type": "InputPeer", + "required": true, + "default": null + }, + { + "name": "story_id", + "type": "int", + "required": true, + "default": null + }, + { + "name": "reaction", + "type": "Reaction", + "required": true, + "default": null + } + ], + "desc_en": "React to a story.", + "desc_ru": "Отреагировать на историю." + }, + { + "name": "peer_stories", + "rpc": "stories.getPeerStories", + "namespace": "stories", + "signature": "await ctx.peer_stories(peer: InputPeer)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": true, + "default": null + } + ], + "desc_en": "Fetch the full active story list of a specific peer.", + "desc_ru": "Получить полный список активных историй конкретного собеседника." + }, + { + "name": "story_read_markers", + "rpc": "stories.getAllReadPeerStories", + "namespace": "stories", + "signature": "await ctx.story_read_markers()", + "returns": "Any", + "params": [ + ], + "desc_en": "Obtain the latest read story ID for all peers when first logging in, returned as a list of updateReadStories updates, see here for more info.", + "desc_ru": "Получить последние прочитанные идентификаторы историй для всех собеседников при первом входе. Возвращается списком обновлений updateReadStories." + }, + { + "name": "peer_latest_story_ids", + "rpc": "stories.getPeerMaxIDs", + "namespace": "stories", + "signature": "await ctx.peer_latest_story_ids(id: Vector)", + "returns": "Any", + "params": [ + { + "name": "id", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Get compact active story summaries for a set of peers.", + "desc_ru": "Получить краткие сводки активных историй для набора собеседников." + }, + { + "name": "story_posting_chats", + "rpc": "stories.getChatsToSend", + "namespace": "stories", + "signature": "await ctx.story_posting_chats()", + "returns": "Any", + "params": [ + ], + "desc_en": "Obtain a list of channels where the user can post stories", + "desc_ru": "Получить список каналов, где пользователь может публиковать истории." + }, + { + "name": "set_peer_stories_hidden", + "rpc": "stories.togglePeerStoriesHidden", + "namespace": "stories", + "signature": "await ctx.set_peer_stories_hidden(peer: InputPeer, hidden: Bool)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": true, + "default": null + }, + { + "name": "hidden", + "type": "Bool", + "required": true, + "default": null + } + ], + "desc_en": "Hide the active stories of a user, preventing them from being displayed on the action bar on the homescreen, see here for more info.", + "desc_ru": "Скрыть активные истории пользователя, чтобы они не показывались на панели действий на главном экране." + }, + { + "name": "story_reaction_senders", + "rpc": "stories.getStoryReactionsList", + "namespace": "stories", + "signature": "await ctx.story_reaction_senders(peer: InputPeer, id: int, limit: int)", + "returns": "Any", + "params": [ + { + "name": "forwards_first", + "type": "flags.2?true", + "required": false, + "default": null + }, + { + "name": "peer", + "type": "InputPeer", + "required": true, + "default": null + }, + { + "name": "id", + "type": "int", + "required": true, + "default": null + }, + { + "name": "reaction", + "type": "flags.0?Reaction", + "required": false, + "default": null + }, + { + "name": "offset", + "type": "flags.1?string", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + } + ], + "desc_en": "Get the reaction and interaction list of a story posted to a channel, along with the sender of each reaction. Can only be used by channel admins.", + "desc_ru": "Получить список реакций и взаимодействий с историей в канале вместе с автором каждой реакции. Доступно только администраторам канала." + }, + { + "name": "reorder_profile_story_pins", + "rpc": "stories.togglePinnedToTop", + "namespace": "stories", + "signature": "await ctx.reorder_profile_story_pins(peer: InputPeer, id: Vector)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": true, + "default": null + }, + { + "name": "id", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Pin some stories to the top of the profile, see here for more info.", + "desc_ru": "Закрепить истории вверху профиля." + }, + { + "name": "search_stories", + "rpc": "stories.searchPosts", + "namespace": "stories", + "signature": "await ctx.search_stories(offset: string, limit: int)", + "returns": "Any", + "params": [ + { + "name": "hashtag", + "type": "flags.0?string", + "required": false, + "default": null + }, + { + "name": "area", + "type": "flags.1?MediaArea", + "required": false, + "default": null + }, + { + "name": "peer", + "type": "flags.2?InputPeer", + "required": false, + "default": null + }, + { + "name": "offset", + "type": "string", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + } + ], + "desc_en": "Globally search for stories using a hashtag or a location media area, see here for more info on the full flow. Either hashtag or area must be set when invoking the method.", + "desc_ru": "Искать истории по всему Telegram по хэштегу или географической области. При вызове должен быть задан хэштег или область." + }, + { + "name": "create_story_album", + "rpc": "stories.createAlbum", + "namespace": "stories", + "signature": "await ctx.create_story_album(peer: InputPeer, title: string, stories: Vector)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": true, + "default": null + }, + { + "name": "title", + "type": "string", + "required": true, + "default": null + }, + { + "name": "stories", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Creates a story album.", + "desc_ru": "Создать альбом историй." + }, + { + "name": "edit_story_album", + "rpc": "stories.updateAlbum", + "namespace": "stories", + "signature": "await ctx.edit_story_album(peer: InputPeer, album_id: int)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": true, + "default": null + }, + { + "name": "album_id", + "type": "int", + "required": true, + "default": null + }, + { + "name": "title", + "type": "flags.0?string", + "required": false, + "default": null + }, + { + "name": "delete_stories", + "type": "flags.1?Vector", + "required": false, + "default": null + }, + { + "name": "add_stories", + "type": "flags.2?Vector", + "required": false, + "default": null + }, + { + "name": "order", + "type": "flags.3?Vector", + "required": false, + "default": null + } + ], + "desc_en": "Rename a story albums, or add, delete or reorder stories in it.", + "desc_ru": "Переименовать альбом историй, а также добавить, удалить или переставить в нём истории." + }, + { + "name": "reorder_story_albums", + "rpc": "stories.reorderAlbums", + "namespace": "stories", + "signature": "await ctx.reorder_story_albums(peer: InputPeer, order: Vector)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": true, + "default": null + }, + { + "name": "order", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Reorder story albums on a profile.", + "desc_ru": "Изменить порядок альбомов историй в профиле." + }, + { + "name": "remove_story_album", + "rpc": "stories.deleteAlbum", + "namespace": "stories", + "signature": "await ctx.remove_story_album(peer: InputPeer, album_id: int)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": true, + "default": null + }, + { + "name": "album_id", + "type": "int", + "required": true, + "default": null + } + ], + "desc_en": "Delete a story album.", + "desc_ru": "Удалить альбом историй." + }, + { + "name": "story_albums", + "rpc": "stories.getAlbums", + "namespace": "stories", + "signature": "await ctx.story_albums(peer: InputPeer, hash: long)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": true, + "default": null + }, + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Get story albums created by a peer.", + "desc_ru": "Получить альбомы историй, созданные собеседником." + }, + { + "name": "story_album_items", + "rpc": "stories.getAlbumStories", + "namespace": "stories", + "signature": "await ctx.story_album_items(peer: InputPeer, album_id: int, offset: int, limit: int)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": true, + "default": null + }, + { + "name": "album_id", + "type": "int", + "required": true, + "default": null + }, + { + "name": "offset", + "type": "int", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + } + ], + "desc_en": "Get stories in a story album.", + "desc_ru": "Получить истории из альбома." + }, + { + "name": "stickers_for_emoji", + "rpc": "messages.getStickers", + "namespace": "messages", + "signature": "await ctx.stickers_for_emoji(emoticon: string, hash: long)", + "returns": "Any", + "params": [ + { + "name": "emoticon", + "type": "string", + "required": true, + "default": null + }, + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Get stickers by emoji", + "desc_ru": "Получить стикеры по эмодзи." + }, + { + "name": "installed_sticker_sets", + "rpc": "messages.getAllStickers", + "namespace": "messages", + "signature": "await ctx.installed_sticker_sets(hash: long)", + "returns": "Any", + "params": [ + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Get all installed stickers", + "desc_ru": "Получить все установленные наборы стикеров." + }, + { + "name": "sticker_set", + "rpc": "messages.getStickerSet", + "namespace": "messages", + "signature": "await ctx.sticker_set(stickerset: InputStickerSet, hash: int)", + "returns": "Any", + "params": [ + { + "name": "stickerset", + "type": "InputStickerSet", + "required": true, + "default": null + }, + { + "name": "hash", + "type": "int", + "required": false, + "default": null + } + ], + "desc_en": "Get info about a stickerset", + "desc_ru": "Получить сведения о наборе стикеров." + }, + { + "name": "install_sticker_set", + "rpc": "messages.installStickerSet", + "namespace": "messages", + "signature": "await ctx.install_sticker_set(stickerset: InputStickerSet, archived: Bool)", + "returns": "Any", + "params": [ + { + "name": "stickerset", + "type": "InputStickerSet", + "required": true, + "default": null + }, + { + "name": "archived", + "type": "Bool", + "required": false, + "default": null + } + ], + "desc_en": "Install a stickerset", + "desc_ru": "Установить набор стикеров." + }, + { + "name": "uninstall_sticker_set", + "rpc": "messages.uninstallStickerSet", + "namespace": "messages", + "signature": "await ctx.uninstall_sticker_set(stickerset: InputStickerSet)", + "returns": "Any", + "params": [ + { + "name": "stickerset", + "type": "InputStickerSet", + "required": true, + "default": null + } + ], + "desc_en": "Uninstall a stickerset", + "desc_ru": "Удалить набор стикеров." + }, + { + "name": "reorder_sticker_sets", + "rpc": "messages.reorderStickerSets", + "namespace": "messages", + "signature": "await ctx.reorder_sticker_sets(order: Vector)", + "returns": "Any", + "params": [ + { + "name": "masks", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "emojis", + "type": "flags.1?true", + "required": false, + "default": null + }, + { + "name": "order", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Reorder installed stickersets", + "desc_ru": "Изменить порядок установленных наборов стикеров." + }, + { + "name": "saved_gifs", + "rpc": "messages.getSavedGifs", + "namespace": "messages", + "signature": "await ctx.saved_gifs(hash: long)", + "returns": "Any", + "params": [ + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Get saved GIFs.", + "desc_ru": "Получить сохранённые GIF." + }, + { + "name": "set_gif_saved", + "rpc": "messages.saveGif", + "namespace": "messages", + "signature": "await ctx.set_gif_saved(id: InputDocument, unsave: Bool)", + "returns": "Any", + "params": [ + { + "name": "id", + "type": "InputDocument", + "required": true, + "default": null + }, + { + "name": "unsave", + "type": "Bool", + "required": true, + "default": null + } + ], + "desc_en": "Add GIF to saved gifs list", + "desc_ru": "Добавить GIF в список сохранённых." + }, + { + "name": "featured_sticker_sets", + "rpc": "messages.getFeaturedStickers", + "namespace": "messages", + "signature": "await ctx.featured_sticker_sets(hash: long)", + "returns": "Any", + "params": [ + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Get featured stickers", + "desc_ru": "Получить рекомендуемые стикеры." + }, + { + "name": "mark_featured_stickers_seen", + "rpc": "messages.readFeaturedStickers", + "namespace": "messages", + "signature": "await ctx.mark_featured_stickers_seen(id: Vector)", + "returns": "Any", + "params": [ + { + "name": "id", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Mark new featured stickers as read", + "desc_ru": "Отметить новые рекомендуемые стикеры как просмотренные." + }, + { + "name": "recent_stickers", + "rpc": "messages.getRecentStickers", + "namespace": "messages", + "signature": "await ctx.recent_stickers(hash: long)", + "returns": "Any", + "params": [ + { + "name": "attached", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Get recent stickers", + "desc_ru": "Получить недавние стикеры." + }, + { + "name": "set_sticker_recent", + "rpc": "messages.saveRecentSticker", + "namespace": "messages", + "signature": "await ctx.set_sticker_recent(id: InputDocument, unsave: Bool)", + "returns": "Any", + "params": [ + { + "name": "attached", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "id", + "type": "InputDocument", + "required": true, + "default": null + }, + { + "name": "unsave", + "type": "Bool", + "required": true, + "default": null + } + ], + "desc_en": "Add/remove sticker from recent stickers list", + "desc_ru": "Добавить или удалить стикер из списка недавних." + }, + { + "name": "clear_recent_stickers", + "rpc": "messages.clearRecentStickers", + "namespace": "messages", + "signature": "await ctx.clear_recent_stickers()", + "returns": "Any", + "params": [ + { + "name": "attached", + "type": "flags.0?true", + "required": false, + "default": null + } + ], + "desc_en": "Clear recent stickers", + "desc_ru": "Очистить список недавних стикеров." + }, + { + "name": "archived_sticker_sets", + "rpc": "messages.getArchivedStickers", + "namespace": "messages", + "signature": "await ctx.archived_sticker_sets(offset_id: long, limit: int)", + "returns": "Any", + "params": [ + { + "name": "masks", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "emojis", + "type": "flags.1?true", + "required": false, + "default": null + }, + { + "name": "offset_id", + "type": "long", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + } + ], + "desc_en": "Get all archived stickers", + "desc_ru": "Получить все архивные наборы стикеров." + }, + { + "name": "installed_masks", + "rpc": "messages.getMaskStickers", + "namespace": "messages", + "signature": "await ctx.installed_masks(hash: long)", + "returns": "Any", + "params": [ + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Get installed mask stickers", + "desc_ru": "Получить установленные стикеры-маски." + }, + { + "name": "media_sticker_sets", + "rpc": "messages.getAttachedStickers", + "namespace": "messages", + "signature": "await ctx.media_sticker_sets(media: InputStickeredMedia)", + "returns": "Any", + "params": [ + { + "name": "media", + "type": "InputStickeredMedia", + "required": true, + "default": null + } + ], + "desc_en": "Get stickers attached to a photo or video", + "desc_ru": "Получить стикеры, прикреплённые к фото или видео." + }, + { + "name": "favorite_stickers", + "rpc": "messages.getFavedStickers", + "namespace": "messages", + "signature": "await ctx.favorite_stickers(hash: long)", + "returns": "Any", + "params": [ + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Get faved stickers", + "desc_ru": "Получить избранные стикеры." + }, + { + "name": "set_sticker_favorite", + "rpc": "messages.faveSticker", + "namespace": "messages", + "signature": "await ctx.set_sticker_favorite(id: InputDocument, unfave: Bool)", + "returns": "Any", + "params": [ + { + "name": "id", + "type": "InputDocument", + "required": true, + "default": null + }, + { + "name": "unfave", + "type": "Bool", + "required": true, + "default": null + } + ], + "desc_en": "Mark or unmark a sticker as favorite", + "desc_ru": "Отметить стикер как избранный или снять отметку." + }, + { + "name": "search_sticker_sets", + "rpc": "messages.searchStickerSets", + "namespace": "messages", + "signature": "await ctx.search_sticker_sets(q: string, hash: long)", + "returns": "Any", + "params": [ + { + "name": "exclude_featured", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "q", + "type": "string", + "required": true, + "default": null + }, + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Search for stickersets", + "desc_ru": "Искать наборы стикеров." + }, + { + "name": "bulk_sticker_set_action", + "rpc": "messages.toggleStickerSets", + "namespace": "messages", + "signature": "await ctx.bulk_sticker_set_action(stickersets: Vector)", + "returns": "Any", + "params": [ + { + "name": "uninstall", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "archive", + "type": "flags.1?true", + "required": false, + "default": null + }, + { + "name": "unarchive", + "type": "flags.2?true", + "required": false, + "default": null + }, + { + "name": "stickersets", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Apply changes to multiple stickersets", + "desc_ru": "Применить изменения сразу к нескольким наборам стикеров." + }, + { + "name": "older_featured_sticker_sets", + "rpc": "messages.getOldFeaturedStickers", + "namespace": "messages", + "signature": "await ctx.older_featured_sticker_sets(offset: int, limit: int, hash: long)", + "returns": "Any", + "params": [ + { + "name": "offset", + "type": "int", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + }, + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Method for fetching previously featured stickers", + "desc_ru": "Получить ранее рекомендуемые стикеры." + }, + { + "name": "custom_emoji_documents", + "rpc": "messages.getCustomEmojiDocuments", + "namespace": "messages", + "signature": "await ctx.custom_emoji_documents(document_id: Vector)", + "returns": "Any", + "params": [ + { + "name": "document_id", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Fetch custom emoji stickers. Returns a list of documents with the animated custom emoji in TGS format, and a documentAttributeCustomEmoji attribute with the original emoji and info about the emoji stickerset this custom emoji belongs to.", + "desc_ru": "Получить стикеры кастомных эмодзи. Возвращает документы с анимированными эмодзи в формате TGS и атрибут documentAttributeCustomEmoji с исходным эмодзи и данными о наборе." + }, + { + "name": "installed_emoji_sets", + "rpc": "messages.getEmojiStickers", + "namespace": "messages", + "signature": "await ctx.installed_emoji_sets(hash: long)", + "returns": "Any", + "params": [ + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Gets the list of currently installed custom emoji stickersets.", + "desc_ru": "Получить список установленных наборов стикеров кастомных эмодзи." + }, + { + "name": "featured_emoji_sets", + "rpc": "messages.getFeaturedEmojiStickers", + "namespace": "messages", + "signature": "await ctx.featured_emoji_sets(hash: long)", + "returns": "Any", + "params": [ + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Gets featured custom emoji stickersets.", + "desc_ru": "Получить рекомендуемые наборы стикеров кастомных эмодзи." + }, + { + "name": "search_custom_emoji", + "rpc": "messages.searchCustomEmoji", + "namespace": "messages", + "signature": "await ctx.search_custom_emoji(emoticon: string, hash: long)", + "returns": "Any", + "params": [ + { + "name": "emoticon", + "type": "string", + "required": true, + "default": null + }, + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Look for custom emojis associated to a UTF8 emoji", + "desc_ru": "Найти кастомные эмодзи по символу UTF-8." + }, + { + "name": "search_emoji_sets", + "rpc": "messages.searchEmojiStickerSets", + "namespace": "messages", + "signature": "await ctx.search_emoji_sets(q: string, hash: long)", + "returns": "Any", + "params": [ + { + "name": "exclude_featured", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "q", + "type": "string", + "required": true, + "default": null + }, + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Search for custom emoji stickersets", + "desc_ru": "Искать наборы стикеров кастомных эмодзи." + }, + { + "name": "owned_sticker_sets", + "rpc": "messages.getMyStickers", + "namespace": "messages", + "signature": "await ctx.owned_sticker_sets(offset_id: long, limit: int)", + "returns": "Any", + "params": [ + { + "name": "offset_id", + "type": "long", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + } + ], + "desc_en": "Fetch all stickersets owned by the current user.", + "desc_ru": "Получить все наборы стикеров, принадлежащие текущему пользователю." + }, + { + "name": "search_stickers", + "rpc": "messages.searchStickers", + "namespace": "messages", + "signature": "await ctx.search_stickers(q: string, emoticon: string, lang_code: Vector, offset: int, limit: int, hash: long)", + "returns": "Any", + "params": [ + { + "name": "emojis", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "q", + "type": "string", + "required": true, + "default": null + }, + { + "name": "emoticon", + "type": "string", + "required": true, + "default": null + }, + { + "name": "lang_code", + "type": "Vector", + "required": true, + "default": null + }, + { + "name": "offset", + "type": "int", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + }, + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Search for stickers using AI-powered keyword search", + "desc_ru": "Искать стикеры по ключевым словам с помощью ИИ." + }, + { + "name": "create_sticker_set", + "rpc": "stickers.createStickerSet", + "namespace": "stickers", + "signature": "await ctx.create_sticker_set(user_id: InputUser, title: string, short_name: string, stickers: Vector)", + "returns": "Any", + "params": [ + { + "name": "masks", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "emojis", + "type": "flags.5?true", + "required": false, + "default": null + }, + { + "name": "text_color", + "type": "flags.6?true", + "required": false, + "default": null + }, + { + "name": "user_id", + "type": "InputUser", + "required": true, + "default": null + }, + { + "name": "title", + "type": "string", + "required": true, + "default": null + }, + { + "name": "short_name", + "type": "string", + "required": true, + "default": null + }, + { + "name": "thumb", + "type": "flags.2?InputDocument", + "required": false, + "default": null + }, + { + "name": "stickers", + "type": "Vector", + "required": true, + "default": null + }, + { + "name": "software", + "type": "flags.3?string", + "required": false, + "default": null + } + ], + "desc_en": "Create a stickerset.", + "desc_ru": "Создать набор стикеров." + }, + { + "name": "remove_sticker", + "rpc": "stickers.removeStickerFromSet", + "namespace": "stickers", + "signature": "await ctx.remove_sticker(sticker: InputDocument)", + "returns": "Any", + "params": [ + { + "name": "sticker", + "type": "InputDocument", + "required": true, + "default": null + } + ], + "desc_en": "Remove a sticker from the set where it belongs. The sticker set must have been created by the current user/bot.", + "desc_ru": "Удалить стикер из его набора. Набор должен быть создан текущим пользователем или ботом." + }, + { + "name": "move_sticker", + "rpc": "stickers.changeStickerPosition", + "namespace": "stickers", + "signature": "await ctx.move_sticker(sticker: InputDocument, position: int)", + "returns": "Any", + "params": [ + { + "name": "sticker", + "type": "InputDocument", + "required": true, + "default": null + }, + { + "name": "position", + "type": "int", + "required": true, + "default": null + } + ], + "desc_en": "Changes the absolute position of a sticker in the set to which it belongs. The sticker set must have been created by the current user/bot.", + "desc_ru": "Изменить абсолютную позицию стикера в его наборе. Набор должен быть создан текущим пользователем или ботом." + }, + { + "name": "add_sticker", + "rpc": "stickers.addStickerToSet", + "namespace": "stickers", + "signature": "await ctx.add_sticker(stickerset: InputStickerSet, sticker: InputStickerSetItem)", + "returns": "Any", + "params": [ + { + "name": "stickerset", + "type": "InputStickerSet", + "required": true, + "default": null + }, + { + "name": "sticker", + "type": "InputStickerSetItem", + "required": true, + "default": null + } + ], + "desc_en": "Add a sticker to a stickerset. The sticker set must have been created by the current user/bot.", + "desc_ru": "Добавить стикер в набор. Набор должен быть создан текущим пользователем или ботом." + }, + { + "name": "set_sticker_set_thumbnail", + "rpc": "stickers.setStickerSetThumb", + "namespace": "stickers", + "signature": "await ctx.set_sticker_set_thumbnail(stickerset: InputStickerSet)", + "returns": "Any", + "params": [ + { + "name": "stickerset", + "type": "InputStickerSet", + "required": true, + "default": null + }, + { + "name": "thumb", + "type": "flags.0?InputDocument", + "required": false, + "default": null + }, + { + "name": "thumb_document_id", + "type": "flags.1?long", + "required": false, + "default": null + } + ], + "desc_en": "Set stickerset thumbnail", + "desc_ru": "Задать обложку набора стикеров." + }, + { + "name": "check_sticker_set_name", + "rpc": "stickers.checkShortName", + "namespace": "stickers", + "signature": "await ctx.check_sticker_set_name(short_name: string)", + "returns": "Any", + "params": [ + { + "name": "short_name", + "type": "string", + "required": true, + "default": null + } + ], + "desc_en": "Check whether the given short name is available", + "desc_ru": "Проверить, доступно ли указанное короткое имя." + }, + { + "name": "suggest_sticker_set_name", + "rpc": "stickers.suggestShortName", + "namespace": "stickers", + "signature": "await ctx.suggest_sticker_set_name(title: string)", + "returns": "Any", + "params": [ + { + "name": "title", + "type": "string", + "required": true, + "default": null + } + ], + "desc_en": "Suggests a short name for a given stickerpack name", + "desc_ru": "Предложить короткое имя для указанного набора стикеров." + }, + { + "name": "edit_sticker_metadata", + "rpc": "stickers.changeSticker", + "namespace": "stickers", + "signature": "await ctx.edit_sticker_metadata(sticker: InputDocument)", + "returns": "Any", + "params": [ + { + "name": "sticker", + "type": "InputDocument", + "required": true, + "default": null + }, + { + "name": "emoji", + "type": "flags.0?string", + "required": false, + "default": null + }, + { + "name": "mask_coords", + "type": "flags.1?MaskCoords", + "required": false, + "default": null + }, + { + "name": "keywords", + "type": "flags.2?string", + "required": false, + "default": null + } + ], + "desc_en": "Update the keywords, emojis or mask coordinates of a sticker.", + "desc_ru": "Обновить ключевые слова, эмодзи или координаты маски стикера." + }, + { + "name": "rename_sticker_set", + "rpc": "stickers.renameStickerSet", + "namespace": "stickers", + "signature": "await ctx.rename_sticker_set(stickerset: InputStickerSet, title: string)", + "returns": "Any", + "params": [ + { + "name": "stickerset", + "type": "InputStickerSet", + "required": true, + "default": null + }, + { + "name": "title", + "type": "string", + "required": true, + "default": null + } + ], + "desc_en": "Renames a stickerset.", + "desc_ru": "Переименовать набор стикеров." + }, + { + "name": "remove_sticker_set", + "rpc": "stickers.deleteStickerSet", + "namespace": "stickers", + "signature": "await ctx.remove_sticker_set(stickerset: InputStickerSet)", + "returns": "Any", + "params": [ + { + "name": "stickerset", + "type": "InputStickerSet", + "required": true, + "default": null + } + ], + "desc_en": "Deletes a stickerset we created.", + "desc_ru": "Удалить созданный нами набор стикеров." + }, + { + "name": "replace_sticker", + "rpc": "stickers.replaceSticker", + "namespace": "stickers", + "signature": "await ctx.replace_sticker(sticker: InputDocument, new_sticker: InputStickerSetItem)", + "returns": "Any", + "params": [ + { + "name": "sticker", + "type": "InputDocument", + "required": true, + "default": null + }, + { + "name": "new_sticker", + "type": "InputStickerSetItem", + "required": true, + "default": null + } + ], + "desc_en": "Replace a sticker in a stickerset.", + "desc_ru": "Заменить стикер в наборе." + }, + { + "name": "contact_ids", + "rpc": "contacts.getContactIDs", + "namespace": "contacts", + "signature": "await ctx.contact_ids(hash: long)", + "returns": "Any", + "params": [ + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Get the telegram IDs of all contacts. Returns an array of Telegram user IDs for all contacts (0 if a contact does not have an associated Telegram account or have hidden their account using privacy settings).", + "desc_ru": "Получить Telegram ID всех контактов. Возвращает массив идентификаторов; для контакта без Telegram-аккаунта или со скрытым аккаунтом возвращается 0." + }, + { + "name": "contact_statuses", + "rpc": "contacts.getStatuses", + "namespace": "contacts", + "signature": "await ctx.contact_statuses()", + "returns": "Any", + "params": [ + ], + "desc_en": "Use this method to obtain the online statuses of all contacts with an accessible Telegram account.", + "desc_ru": "Получить статусы в сети всех контактов с доступным Telegram-аккаунтом." + }, + { + "name": "contacts_list", + "rpc": "contacts.getContacts", + "namespace": "contacts", + "signature": "await ctx.contacts_list(hash: long)", + "returns": "Any", + "params": [ + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Returns the current user's contact list.", + "desc_ru": "Вернуть текущий список контактов пользователя." + }, + { + "name": "import_contacts", + "rpc": "contacts.importContacts", + "namespace": "contacts", + "signature": "await ctx.import_contacts(contacts: Vector)", + "returns": "Any", + "params": [ + { + "name": "contacts", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Imports contacts: saves a full list on the server, adds already registered contacts to the contact list, returns added contacts and their info. Use contacts.addContact to add Telegram contacts without actually using their phone number.", + "desc_ru": "Импортировать контакты: сохранить полный список на сервере, добавить зарегистрированные контакты в список и вернуть добавленные контакты с их данными. Чтобы добавить контакт Telegram без использования его номера, вызывайте contacts.addContact." + }, + { + "name": "remove_contacts", + "rpc": "contacts.deleteContacts", + "namespace": "contacts", + "signature": "await ctx.remove_contacts(id: Vector)", + "returns": "Any", + "params": [ + { + "name": "id", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Deletes several contacts from the list.", + "desc_ru": "Удалить несколько контактов из списка." + }, + { + "name": "remove_contacts_by_phone", + "rpc": "contacts.deleteByPhones", + "namespace": "contacts", + "signature": "await ctx.remove_contacts_by_phone(phones: Vector)", + "returns": "Any", + "params": [ + { + "name": "phones", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Delete contacts by phone number", + "desc_ru": "Удалить контакты по номеру телефона." + }, + { + "name": "block_peer", + "rpc": "contacts.block", + "namespace": "contacts", + "signature": "await ctx.block_peer(id: InputPeer)", + "returns": "Any", + "params": [ + { + "name": "my_stories_from", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "id", + "type": "InputPeer", + "required": true, + "default": null + } + ], + "desc_en": "Adds a peer to a blocklist, see here for more info.", + "desc_ru": "Добавить собеседника в список заблокированных." + }, + { + "name": "unblock_peer", + "rpc": "contacts.unblock", + "namespace": "contacts", + "signature": "await ctx.unblock_peer(id: InputPeer)", + "returns": "Any", + "params": [ + { + "name": "my_stories_from", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "id", + "type": "InputPeer", + "required": true, + "default": null + } + ], + "desc_en": "Deletes a peer from a blocklist, see here for more info.", + "desc_ru": "Удалить собеседника из списка заблокированных." + }, + { + "name": "blocked_peers", + "rpc": "contacts.getBlocked", + "namespace": "contacts", + "signature": "await ctx.blocked_peers(offset: int, limit: int)", + "returns": "Any", + "params": [ + { + "name": "my_stories_from", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "offset", + "type": "int", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + } + ], + "desc_en": "Returns the list of blocked users.", + "desc_ru": "Вернуть список заблокированных пользователей." + }, + { + "name": "search_public_peers", + "rpc": "contacts.search", + "namespace": "contacts", + "signature": "await ctx.search_public_peers(q: string, limit: int)", + "returns": "Any", + "params": [ + { + "name": "broadcasts", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "bots", + "type": "flags.1?true", + "required": false, + "default": null + }, + { + "name": "q", + "type": "string", + "required": true, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + } + ], + "desc_en": "Returns users found by username substring.", + "desc_ru": "Вернуть пользователей, найденных по подстроке имени пользователя." + }, + { + "name": "frequent_peers", + "rpc": "contacts.getTopPeers", + "namespace": "contacts", + "signature": "await ctx.frequent_peers(offset: int, limit: int, hash: long)", + "returns": "Any", + "params": [ + { + "name": "correspondents", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "bots_pm", + "type": "flags.1?true", + "required": false, + "default": null + }, + { + "name": "bots_inline", + "type": "flags.2?true", + "required": false, + "default": null + }, + { + "name": "phone_calls", + "type": "flags.3?true", + "required": false, + "default": null + }, + { + "name": "forward_users", + "type": "flags.4?true", + "required": false, + "default": null + }, + { + "name": "forward_chats", + "type": "flags.5?true", + "required": false, + "default": null + }, + { + "name": "groups", + "type": "flags.10?true", + "required": false, + "default": null + }, + { + "name": "channels", + "type": "flags.15?true", + "required": false, + "default": null + }, + { + "name": "bots_app", + "type": "flags.16?true", + "required": false, + "default": null + }, + { + "name": "bots_guestchat", + "type": "flags.17?true", + "required": false, + "default": null + }, + { + "name": "offset", + "type": "int", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + }, + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Get most used peers", + "desc_ru": "Получить чаще всего используемых собеседников." + }, + { + "name": "reset_peer_rating", + "rpc": "contacts.resetTopPeerRating", + "namespace": "contacts", + "signature": "await ctx.reset_peer_rating(category: TopPeerCategory, peer: InputPeer)", + "returns": "Any", + "params": [ + { + "name": "category", + "type": "TopPeerCategory", + "required": true, + "default": null + }, + { + "name": "peer", + "type": "InputPeer", + "required": true, + "default": null + } + ], + "desc_en": "Reset rating of top peer", + "desc_ru": "Сбросить рейтинг часто используемого собеседника." + }, + { + "name": "clear_imported_contacts", + "rpc": "contacts.resetSaved", + "namespace": "contacts", + "signature": "await ctx.clear_imported_contacts()", + "returns": "Any", + "params": [ + ], + "desc_en": "Removes all contacts without an associated Telegram account.", + "desc_ru": "Удалить все контакты без связанного Telegram-аккаунта." + }, + { + "name": "imported_contacts", + "rpc": "contacts.getSaved", + "namespace": "contacts", + "signature": "await ctx.imported_contacts()", + "returns": "Any", + "params": [ + ], + "desc_en": "Get all contacts, requires a takeout session, see here for more info.", + "desc_ru": "Получить все контакты. Требуется сессия выгрузки данных." + }, + { + "name": "set_frequent_peers_enabled", + "rpc": "contacts.toggleTopPeers", + "namespace": "contacts", + "signature": "await ctx.set_frequent_peers_enabled(enabled: Bool)", + "returns": "Any", + "params": [ + { + "name": "enabled", + "type": "Bool", + "required": true, + "default": null + } + ], + "desc_en": "Enable/disable top peers", + "desc_ru": "Включить или выключить список часто используемых собеседников." + }, + { + "name": "add_contact", + "rpc": "contacts.addContact", + "namespace": "contacts", + "signature": "await ctx.add_contact(id: InputUser, first_name: string, last_name: string, phone: string)", + "returns": "Any", + "params": [ + { + "name": "add_phone_privacy_exception", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "id", + "type": "InputUser", + "required": true, + "default": null + }, + { + "name": "first_name", + "type": "string", + "required": true, + "default": null + }, + { + "name": "last_name", + "type": "string", + "required": true, + "default": null + }, + { + "name": "phone", + "type": "string", + "required": true, + "default": null + }, + { + "name": "note", + "type": "flags.1?TextWithEntities", + "required": false, + "default": null + } + ], + "desc_en": "Add an existing telegram user as contact. Use contacts.importContacts to add contacts by phone number, without knowing their Telegram ID.", + "desc_ru": "Добавить существующего пользователя Telegram в контакты. Чтобы добавить контакт по номеру телефона, не зная его Telegram ID, используйте contacts.importContacts." + }, + { + "name": "accept_contact", + "rpc": "contacts.acceptContact", + "namespace": "contacts", + "signature": "await ctx.accept_contact(id: InputUser)", + "returns": "Any", + "params": [ + { + "name": "id", + "type": "InputUser", + "required": true, + "default": null + } + ], + "desc_en": "If the add contact action bar is active, add that user as contact", + "desc_ru": "Добавить пользователя в контакты, если активна панель добавления контакта." + }, + { + "name": "set_close_friends", + "rpc": "contacts.editCloseFriends", + "namespace": "contacts", + "signature": "await ctx.set_close_friends(id: Vector)", + "returns": "Any", + "params": [ + { + "name": "id", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Edit the close friends list, see here for more info.", + "desc_ru": "Изменить список близких друзей." + }, + { + "name": "replace_blocklist", + "rpc": "contacts.setBlocked", + "namespace": "contacts", + "signature": "await ctx.replace_blocklist(id: Vector, limit: int)", + "returns": "Any", + "params": [ + { + "name": "my_stories_from", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "id", + "type": "Vector", + "required": true, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + } + ], + "desc_en": "Replace the contents of an entire blocklist, see here for more info.", + "desc_ru": "Заменить содержимое всего списка заблокированных." + }, + { + "name": "contact_birthdays", + "rpc": "contacts.getBirthdays", + "namespace": "contacts", + "signature": "await ctx.contact_birthdays()", + "returns": "Any", + "params": [ + ], + "desc_en": "Fetch all users with birthdays that fall within +1/-1 days, relative to the current day: this method should be invoked by clients every 6-8 hours, and if the result is non-empty, it should be used to appropriately update locally cached birthday information in user.birthday. See here for more info.", + "desc_ru": "Получить пользователей с днями рождения в пределах плюс или минус одного дня от текущего. Клиенту стоит вызывать метод каждые 6-8 часов и обновлять локальный кеш дня рождения." + }, + { + "name": "edit_contact_note", + "rpc": "contacts.updateContactNote", + "namespace": "contacts", + "signature": "await ctx.edit_contact_note(id: InputUser, note: TextWithEntities)", + "returns": "Any", + "params": [ + { + "name": "id", + "type": "InputUser", + "required": true, + "default": null + }, + { + "name": "note", + "type": "TextWithEntities", + "required": true, + "default": null + } + ], + "desc_en": "Update the private note associated to a contact; see here for more info.", + "desc_ru": "Обновить личную заметку о контакте." + }, + { + "name": "dialogs", + "rpc": "messages.getDialogs", + "namespace": "messages", + "signature": "await ctx.dialogs(offset_date: int, offset_id: int, offset_peer: InputPeer, limit: int, hash: long)", + "returns": "Any", + "params": [ + { + "name": "exclude_pinned", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "folder_id", + "type": "flags.1?int", + "required": false, + "default": null + }, + { + "name": "offset_date", + "type": "int", + "required": false, + "default": null + }, + { + "name": "offset_id", + "type": "int", + "required": false, + "default": null + }, + { + "name": "offset_peer", + "type": "InputPeer", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + }, + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Returns the current user dialog list.", + "desc_ru": "Вернуть текущий список диалогов пользователя." + }, + { + "name": "chat_history", + "rpc": "messages.getHistory", + "namespace": "messages", + "signature": "await ctx.chat_history(peer: InputPeer, offset_id: int, offset_date: int, add_offset: int, limit: int, max_id: int, min_id: int, hash: long)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "offset_id", + "type": "int", + "required": false, + "default": null + }, + { + "name": "offset_date", + "type": "int", + "required": false, + "default": null + }, + { + "name": "add_offset", + "type": "int", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + }, + { + "name": "max_id", + "type": "int", + "required": false, + "default": null + }, + { + "name": "min_id", + "type": "int", + "required": false, + "default": null + }, + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Returns the message history in a peer. Results are ordered by date (descending).", + "desc_ru": "Вернуть историю сообщений в диалоге. Результат отсортирован по дате по убыванию." + }, + { + "name": "search_chat_messages", + "rpc": "messages.search", + "namespace": "messages", + "signature": "await ctx.search_chat_messages(peer: InputPeer, q: string, filter: MessagesFilter, min_date: int, max_date: int, offset_id: int, add_offset: int, limit: int, max_id: int, min_id: int, hash: long)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "q", + "type": "string", + "required": true, + "default": null + }, + { + "name": "from_id", + "type": "flags.0?InputPeer", + "required": false, + "default": null + }, + { + "name": "saved_peer_id", + "type": "flags.2?InputPeer", + "required": false, + "default": null + }, + { + "name": "saved_reaction", + "type": "flags.3?Vector", + "required": false, + "default": null + }, + { + "name": "top_msg_id", + "type": "flags.1?int", + "required": false, + "default": null + }, + { + "name": "filter", + "type": "MessagesFilter", + "required": false, + "default": null + }, + { + "name": "min_date", + "type": "int", + "required": false, + "default": null + }, + { + "name": "max_date", + "type": "int", + "required": false, + "default": null + }, + { + "name": "offset_id", + "type": "int", + "required": false, + "default": null + }, + { + "name": "add_offset", + "type": "int", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + }, + { + "name": "max_id", + "type": "int", + "required": false, + "default": null + }, + { + "name": "min_id", + "type": "int", + "required": false, + "default": null + }, + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Search for messages.", + "desc_ru": "Искать сообщения." + }, + { + "name": "mark_chat_read", + "rpc": "messages.readHistory", + "namespace": "messages", + "signature": "await ctx.mark_chat_read(peer: InputPeer, max_id: int)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "max_id", + "type": "int", + "required": true, + "default": null + } + ], + "desc_en": "Marks message history as read.", + "desc_ru": "Отметить историю сообщений как прочитанную." + }, + { + "name": "clear_chat_history", + "rpc": "messages.deleteHistory", + "namespace": "messages", + "signature": "await ctx.clear_chat_history(peer: InputPeer, max_id: int)", + "returns": "Any", + "params": [ + { + "name": "just_clear", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "revoke", + "type": "flags.1?true", + "required": false, + "default": null + }, + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "max_id", + "type": "int", + "required": true, + "default": null + }, + { + "name": "min_date", + "type": "flags.2?int", + "required": false, + "default": null + }, + { + "name": "max_date", + "type": "flags.3?int", + "required": false, + "default": null + } + ], + "desc_en": "Deletes communication history.", + "desc_ru": "Удалить историю переписки." + }, + { + "name": "peer_settings", + "rpc": "messages.getPeerSettings", + "namespace": "messages", + "signature": "await ctx.peer_settings(peer: InputPeer)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + } + ], + "desc_en": "Get peer settings", + "desc_ru": "Получить настройки собеседника." + }, + { + "name": "basic_groups", + "rpc": "messages.getChats", + "namespace": "messages", + "signature": "await ctx.basic_groups(id: Vector)", + "returns": "Any", + "params": [ + { + "name": "id", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Returns chat basic info on their IDs.", + "desc_ru": "Вернуть основные сведения о чатах по их идентификаторам." + }, + { + "name": "basic_group_details", + "rpc": "messages.getFullChat", + "namespace": "messages", + "signature": "await ctx.basic_group_details(chat_id: long)", + "returns": "Any", + "params": [ + { + "name": "chat_id", + "type": "long", + "required": true, + "default": null + } + ], + "desc_en": "Get full info about a basic group.", + "desc_ru": "Получить полные сведения о базовой группе." + }, + { + "name": "search_all_messages", + "rpc": "messages.searchGlobal", + "namespace": "messages", + "signature": "await ctx.search_all_messages(q: string, filter: MessagesFilter, min_date: int, max_date: int, offset_rate: int, offset_peer: InputPeer, offset_id: int, limit: int)", + "returns": "Any", + "params": [ + { + "name": "broadcasts_only", + "type": "flags.1?true", + "required": false, + "default": null + }, + { + "name": "groups_only", + "type": "flags.2?true", + "required": false, + "default": null + }, + { + "name": "users_only", + "type": "flags.3?true", + "required": false, + "default": null + }, + { + "name": "folder_id", + "type": "flags.0?int", + "required": false, + "default": null + }, + { + "name": "community", + "type": "flags.4?InputChannel", + "required": false, + "default": null + }, + { + "name": "q", + "type": "string", + "required": true, + "default": null + }, + { + "name": "filter", + "type": "MessagesFilter", + "required": false, + "default": null + }, + { + "name": "min_date", + "type": "int", + "required": false, + "default": null + }, + { + "name": "max_date", + "type": "int", + "required": false, + "default": null + }, + { + "name": "offset_rate", + "type": "int", + "required": false, + "default": null + }, + { + "name": "offset_peer", + "type": "InputPeer", + "required": false, + "default": null + }, + { + "name": "offset_id", + "type": "int", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + } + ], + "desc_en": "Search for messages and peers globally", + "desc_ru": "Искать сообщения и собеседников по всему Telegram." + }, + { + "name": "message_editability", + "rpc": "messages.getMessageEditData", + "namespace": "messages", + "signature": "await ctx.message_editability(peer: InputPeer, id: int)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "id", + "type": "int", + "required": false, + "default": "$message" + } + ], + "desc_en": "Find out if a media message's caption can be edited", + "desc_ru": "Узнать, можно ли изменить подпись к медиасообщению." + }, + { + "name": "peer_dialogs", + "rpc": "messages.getPeerDialogs", + "namespace": "messages", + "signature": "await ctx.peer_dialogs(peers: Vector)", + "returns": "Any", + "params": [ + { + "name": "peers", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Get dialog info of specified peers", + "desc_ru": "Получить сведения о диалогах с указанными собеседниками." + }, + { + "name": "all_drafts", + "rpc": "messages.getAllDrafts", + "namespace": "messages", + "signature": "await ctx.all_drafts()", + "returns": "Any", + "params": [ + ], + "desc_en": "Return all message drafts. Returns all the latest updateDraftMessage updates related to all chats with drafts.", + "desc_ru": "Вернуть все черновики сообщений: последние обновления updateDraftMessage по всем чатам с черновиками." + }, + { + "name": "mutual_groups", + "rpc": "messages.getCommonChats", + "namespace": "messages", + "signature": "await ctx.mutual_groups(user_id: InputUser, max_id: long, limit: int)", + "returns": "Any", + "params": [ + { + "name": "user_id", + "type": "InputUser", + "required": true, + "default": null + }, + { + "name": "max_id", + "type": "long", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + } + ], + "desc_en": "Get chats in common with a user", + "desc_ru": "Получить общие чаты с пользователем." + }, + { + "name": "set_dialog_pinned", + "rpc": "messages.toggleDialogPin", + "namespace": "messages", + "signature": "await ctx.set_dialog_pinned(peer: InputDialogPeer)", + "returns": "Any", + "params": [ + { + "name": "pinned", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "peer", + "type": "InputDialogPeer", + "required": true, + "default": null + } + ], + "desc_en": "Pin/unpin a dialog", + "desc_ru": "Закрепить или открепить диалог." + }, + { + "name": "reorder_dialog_pins", + "rpc": "messages.reorderPinnedDialogs", + "namespace": "messages", + "signature": "await ctx.reorder_dialog_pins(folder_id: int, order: Vector)", + "returns": "Any", + "params": [ + { + "name": "force", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "folder_id", + "type": "int", + "required": true, + "default": null + }, + { + "name": "order", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Reorder pinned dialogs", + "desc_ru": "Изменить порядок закреплённых диалогов." + }, + { + "name": "pinned_dialogs", + "rpc": "messages.getPinnedDialogs", + "namespace": "messages", + "signature": "await ctx.pinned_dialogs(folder_id: int)", + "returns": "Any", + "params": [ + { + "name": "folder_id", + "type": "int", + "required": true, + "default": null + } + ], + "desc_en": "Get pinned dialogs", + "desc_ru": "Получить закреплённые диалоги." + }, + { + "name": "unread_mentions", + "rpc": "messages.getUnreadMentions", + "namespace": "messages", + "signature": "await ctx.unread_mentions(peer: InputPeer, offset_id: int, add_offset: int, limit: int, max_id: int, min_id: int)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "top_msg_id", + "type": "flags.0?int", + "required": false, + "default": null + }, + { + "name": "offset_id", + "type": "int", + "required": false, + "default": null + }, + { + "name": "add_offset", + "type": "int", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + }, + { + "name": "max_id", + "type": "int", + "required": false, + "default": null + }, + { + "name": "min_id", + "type": "int", + "required": false, + "default": null + } + ], + "desc_en": "Get unread messages where we were mentioned", + "desc_ru": "Получить непрочитанные сообщения, в которых нас упомянули." + }, + { + "name": "mark_mentions_read", + "rpc": "messages.readMentions", + "namespace": "messages", + "signature": "await ctx.mark_mentions_read(peer: InputPeer)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "top_msg_id", + "type": "flags.0?int", + "required": false, + "default": null + } + ], + "desc_en": "Mark mentions as read; can be used in forums but cannot be used in monoforums.", + "desc_ru": "Отметить упоминания как прочитанные. Работает в форумах, но не в монфорумах." + }, + { + "name": "recent_live_locations", + "rpc": "messages.getRecentLocations", + "namespace": "messages", + "signature": "await ctx.recent_live_locations(peer: InputPeer, limit: int, hash: long)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + }, + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Get all recent live locations sent to a specific chat: returns up to 1 location message (messageMediaGeoLive) per chat participant.", + "desc_ru": "Получить все недавние трансляции геопозиции в чате: не больше одного сообщения messageMediaGeoLive на каждого участника." + }, + { + "name": "set_dialog_unread", + "rpc": "messages.markDialogUnread", + "namespace": "messages", + "signature": "await ctx.set_dialog_unread(peer: InputDialogPeer)", + "returns": "Any", + "params": [ + { + "name": "unread", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "parent_peer", + "type": "flags.1?InputPeer", + "required": false, + "default": null + }, + { + "name": "peer", + "type": "InputDialogPeer", + "required": true, + "default": null + } + ], + "desc_en": "Manually mark dialog as unread", + "desc_ru": "Вручную отметить диалог непрочитанным." + }, + { + "name": "unread_dialog_marks", + "rpc": "messages.getDialogUnreadMarks", + "namespace": "messages", + "signature": "await ctx.unread_dialog_marks()", + "returns": "Any", + "params": [ + { + "name": "parent_peer", + "type": "flags.0?InputPeer", + "required": false, + "default": null + } + ], + "desc_en": "Get dialogs manually marked as unread", + "desc_ru": "Получить диалоги, вручную отмеченные непрочитанными." + }, + { + "name": "clear_all_drafts", + "rpc": "messages.clearAllDrafts", + "namespace": "messages", + "signature": "await ctx.clear_all_drafts()", + "returns": "Any", + "params": [ + ], + "desc_en": "Clear all drafts.", + "desc_ru": "Удалить все черновики." + }, + { + "name": "chat_online_count", + "rpc": "messages.getOnlines", + "namespace": "messages", + "signature": "await ctx.chat_online_count(peer: InputPeer)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + } + ], + "desc_en": "Get count of online users in a chat", + "desc_ru": "Получить число пользователей в сети в чате." + }, + { + "name": "message_type_counts", + "rpc": "messages.getSearchCounters", + "namespace": "messages", + "signature": "await ctx.message_type_counts(peer: InputPeer, filters: Vector)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "saved_peer_id", + "type": "flags.2?InputPeer", + "required": false, + "default": null + }, + { + "name": "top_msg_id", + "type": "flags.0?int", + "required": false, + "default": null + }, + { + "name": "filters", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Get the number of results that would be found by a messages.search call with the same parameters", + "desc_ru": "Получить число результатов, которые нашёл бы вызов messages.search с теми же параметрами." + }, + { + "name": "dismiss_peer_settings_bar", + "rpc": "messages.hidePeerSettingsBar", + "namespace": "messages", + "signature": "await ctx.dismiss_peer_settings_bar(peer: InputPeer)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + } + ], + "desc_en": "Should be called after the user hides the report spam/add as contact bar of a new chat, effectively prevents the user from executing the actions specified in the action bar.", + "desc_ru": "Вызывается после того, как пользователь скрыл панель пожаловаться на спам или добавить в контакты в новом чате, и запрещает выполнение действий этой панели." + }, + { + "name": "mark_discussion_read", + "rpc": "messages.readDiscussion", + "namespace": "messages", + "signature": "await ctx.mark_discussion_read(peer: InputPeer, msg_id: int, read_max_id: int)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "msg_id", + "type": "int", + "required": false, + "default": "$message" + }, + { + "name": "read_max_id", + "type": "int", + "required": true, + "default": null + } + ], + "desc_en": "Mark a thread as read", + "desc_ru": "Отметить ветку как прочитанную." + }, + { + "name": "unpin_all_chat_messages", + "rpc": "messages.unpinAllMessages", + "namespace": "messages", + "signature": "await ctx.unpin_all_chat_messages(peer: InputPeer)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "top_msg_id", + "type": "flags.0?int", + "required": false, + "default": null + }, + { + "name": "saved_peer_id", + "type": "flags.1?InputPeer", + "required": false, + "default": null + } + ], + "desc_en": "Unpin all pinned messages", + "desc_ru": "Открепить все закреплённые сообщения." + }, + { + "name": "message_readers", + "rpc": "messages.getMessageReadParticipants", + "namespace": "messages", + "signature": "await ctx.message_readers(peer: InputPeer, msg_id: int)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "msg_id", + "type": "int", + "required": false, + "default": "$message" + } + ], + "desc_en": "Get which users read a specific message: only available for groups and supergroups with less than chat_read_mark_size_threshold members, read receipts will be stored for chat_read_mark_expire_period seconds after the message was sent, see client configuration for more info.", + "desc_ru": "Получить список пользователей, прочитавших конкретное сообщение. Доступно только для групп и супергрупп с числом участников меньше chat_read_mark_size_threshold; отметки о прочтении хранятся chat_read_mark_expire_period секунд после отправки." + }, + { + "name": "message_search_calendar", + "rpc": "messages.getSearchResultsCalendar", + "namespace": "messages", + "signature": "await ctx.message_search_calendar(peer: InputPeer, filter: MessagesFilter, offset_id: int, offset_date: int)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "saved_peer_id", + "type": "flags.2?InputPeer", + "required": false, + "default": null + }, + { + "name": "filter", + "type": "MessagesFilter", + "required": false, + "default": null + }, + { + "name": "offset_id", + "type": "int", + "required": false, + "default": null + }, + { + "name": "offset_date", + "type": "int", + "required": false, + "default": null + } + ], + "desc_en": "Returns information about the next messages of the specified type in the chat split by days. Returns the results in reverse chronological order. Can return partial results for the last returned day.", + "desc_ru": "Вернуть сведения о следующих сообщениях указанного типа в чате с разбивкой по дням. Порядок обратный хронологический; для последнего дня результат может быть неполным." + }, + { + "name": "message_search_positions", + "rpc": "messages.getSearchResultsPositions", + "namespace": "messages", + "signature": "await ctx.message_search_positions(peer: InputPeer, filter: MessagesFilter, offset_id: int, limit: int)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "saved_peer_id", + "type": "flags.2?InputPeer", + "required": false, + "default": null + }, + { + "name": "filter", + "type": "MessagesFilter", + "required": false, + "default": null + }, + { + "name": "offset_id", + "type": "int", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + } + ], + "desc_en": "Returns sparse positions of messages of the specified type in the chat to be used for shared media scroll implementation. Returns the results in reverse chronological order (i.e., in order of decreasing message_id).", + "desc_ru": "Вернуть разреженные позиции сообщений указанного типа в чате для прокрутки общих медиа. Порядок обратный хронологический, по убыванию message_id." + }, + { + "name": "set_default_send_as", + "rpc": "messages.saveDefaultSendAs", + "namespace": "messages", + "signature": "await ctx.set_default_send_as(peer: InputPeer, send_as: InputPeer)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "send_as", + "type": "InputPeer", + "required": true, + "default": null + } + ], + "desc_en": "Change the default peer that should be used when sending messages, reactions, poll votes to a specific group", + "desc_ru": "Задать собеседника по умолчанию для отправки сообщений, реакций и голосов в опросах в конкретной группе." + }, + { + "name": "sent_media_search", + "rpc": "messages.searchSentMedia", + "namespace": "messages", + "signature": "await ctx.sent_media_search(q: string, filter: MessagesFilter, limit: int)", + "returns": "Any", + "params": [ + { + "name": "q", + "type": "string", + "required": true, + "default": null + }, + { + "name": "filter", + "type": "MessagesFilter", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + } + ], + "desc_en": "View and search recently sent media. This method does not support pagination.", + "desc_ru": "Просмотреть и найти недавно отправленные медиа. Метод не поддерживает постраничность." + }, + { + "name": "outgoing_read_date", + "rpc": "messages.getOutboxReadDate", + "namespace": "messages", + "signature": "await ctx.outgoing_read_date(peer: InputPeer, msg_id: int)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "msg_id", + "type": "int", + "required": false, + "default": "$message" + } + ], + "desc_en": "Get the exact read date of one of our messages, sent to a private chat with another user. Can be only done for private outgoing messages not older than appConfig.pm_read_date_expire_period. If the peer's userFull.read_dates_private flag is set, we will not be able to fetch the exact read date of messages we send to them, and a USER_PRIVACY_RESTRICTED RPC error will be emitted. The exact read date of messages might still be unavailable for other reasons, see here for more info. To set userFull.read_dates_private for ourselves invoke account.setGlobalPrivacySettings, setting the settings.hide_read_marks flag.", + "desc_ru": "Получить точную дату прочтения одного из исходящих сообщений в личном чате. Работает только для личных исходящих сообщений не старше appConfig.pm_read_date_expire_period. Если у собеседника установлен флаг userFull.read_dates_private, точную дату получить нельзя и вернётся ошибка USER_PRIVACY_RESTRICTED." + }, + { + "name": "channel_message_author", + "rpc": "channels.getMessageAuthor", + "namespace": "channels", + "signature": "await ctx.channel_message_author(channel: InputChannel, id: int)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "id", + "type": "int", + "required": true, + "default": null + } + ], + "desc_en": "Can only be invoked by non-bot admins of a monoforum, obtains the original sender of a message sent by other monoforum admins to the monoforum, on behalf of the channel associated to the monoforum.", + "desc_ru": "Доступно только администраторам монфорума, кроме ботов. Возвращает исходного отправителя сообщения, отправленного другими администраторами монфорума от имени связанного с ним канала." + }, + { + "name": "move_dialogs_to_archive", + "rpc": "folders.editPeerFolders", + "namespace": "folders", + "signature": "await ctx.move_dialogs_to_archive(folder_peers: Vector)", + "returns": "Any", + "params": [ + { + "name": "folder_peers", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Edit peers in peer folder", + "desc_ru": "Изменить папку, в которой лежат собеседники." + }, + { + "name": "chat_folders", + "rpc": "messages.getDialogFilters", + "namespace": "messages", + "signature": "await ctx.chat_folders()", + "returns": "Any", + "params": [ + ], + "desc_en": "Get folders", + "desc_ru": "Получить папки." + }, + { + "name": "suggested_chat_folders", + "rpc": "messages.getSuggestedDialogFilters", + "namespace": "messages", + "signature": "await ctx.suggested_chat_folders()", + "returns": "Any", + "params": [ + ], + "desc_en": "Get suggested folders", + "desc_ru": "Получить рекомендуемые папки." + }, + { + "name": "save_chat_folder", + "rpc": "messages.updateDialogFilter", + "namespace": "messages", + "signature": "await ctx.save_chat_folder(id: int)", + "returns": "Any", + "params": [ + { + "name": "id", + "type": "int", + "required": true, + "default": null + }, + { + "name": "filter", + "type": "flags.0?DialogFilter", + "required": false, + "default": null + } + ], + "desc_en": "Update folder", + "desc_ru": "Обновить папку." + }, + { + "name": "reorder_chat_folders", + "rpc": "messages.updateDialogFiltersOrder", + "namespace": "messages", + "signature": "await ctx.reorder_chat_folders(order: Vector)", + "returns": "Any", + "params": [ + { + "name": "order", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Reorder folders", + "desc_ru": "Изменить порядок папок." + }, + { + "name": "set_folder_tags_visible", + "rpc": "messages.toggleDialogFilterTags", + "namespace": "messages", + "signature": "await ctx.set_folder_tags_visible(enabled: Bool)", + "returns": "Any", + "params": [ + { + "name": "enabled", + "type": "Bool", + "required": true, + "default": null + } + ], + "desc_en": "Enable or disable folder tags.", + "desc_ru": "Показать или скрыть теги папок." + }, + { + "name": "share_chat_folder", + "rpc": "chatlists.exportChatlistInvite", + "namespace": "chatlists", + "signature": "await ctx.share_chat_folder(chatlist: InputChatlist, title: string, peers: Vector)", + "returns": "Any", + "params": [ + { + "name": "chatlist", + "type": "InputChatlist", + "required": true, + "default": null + }, + { + "name": "title", + "type": "string", + "required": true, + "default": null + }, + { + "name": "peers", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Export a folder, creating a chat folder deep link.", + "desc_ru": "Экспортировать папку, создав ссылку на папку чатов." + }, + { + "name": "remove_folder_invite", + "rpc": "chatlists.deleteExportedInvite", + "namespace": "chatlists", + "signature": "await ctx.remove_folder_invite(chatlist: InputChatlist, slug: string)", + "returns": "Any", + "params": [ + { + "name": "chatlist", + "type": "InputChatlist", + "required": true, + "default": null + }, + { + "name": "slug", + "type": "string", + "required": true, + "default": null + } + ], + "desc_en": "Delete a previously created chat folder deep link.", + "desc_ru": "Удалить ранее созданную ссылку на папку чатов." + }, + { + "name": "edit_folder_invite", + "rpc": "chatlists.editExportedInvite", + "namespace": "chatlists", + "signature": "await ctx.edit_folder_invite(chatlist: InputChatlist, slug: string)", + "returns": "Any", + "params": [ + { + "name": "chatlist", + "type": "InputChatlist", + "required": true, + "default": null + }, + { + "name": "slug", + "type": "string", + "required": true, + "default": null + }, + { + "name": "title", + "type": "flags.1?string", + "required": false, + "default": null + }, + { + "name": "peers", + "type": "flags.2?Vector", + "required": false, + "default": null + } + ], + "desc_en": "Edit a chat folder deep link.", + "desc_ru": "Изменить ссылку на папку чатов." + }, + { + "name": "folder_invites", + "rpc": "chatlists.getExportedInvites", + "namespace": "chatlists", + "signature": "await ctx.folder_invites(chatlist: InputChatlist)", + "returns": "Any", + "params": [ + { + "name": "chatlist", + "type": "InputChatlist", + "required": true, + "default": null + } + ], + "desc_en": "List all chat folder deep links associated to a folder", + "desc_ru": "Получить все ссылки на папку чатов, связанные с папкой." + }, + { + "name": "inspect_folder_invite", + "rpc": "chatlists.checkChatlistInvite", + "namespace": "chatlists", + "signature": "await ctx.inspect_folder_invite(slug: string)", + "returns": "Any", + "params": [ + { + "name": "slug", + "type": "string", + "required": true, + "default": null + } + ], + "desc_en": "Obtain information about a chat folder deep link.", + "desc_ru": "Получить сведения о ссылке на папку чатов." + }, + { + "name": "join_folder_invite", + "rpc": "chatlists.joinChatlistInvite", + "namespace": "chatlists", + "signature": "await ctx.join_folder_invite(slug: string, peers: Vector)", + "returns": "Any", + "params": [ + { + "name": "slug", + "type": "string", + "required": true, + "default": null + }, + { + "name": "peers", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Import a chat folder deep link, joining some or all the chats in the folder.", + "desc_ru": "Импортировать ссылку на папку чатов, присоединившись к некоторым или всем чатам в ней." + }, + { + "name": "folder_updates", + "rpc": "chatlists.getChatlistUpdates", + "namespace": "chatlists", + "signature": "await ctx.folder_updates(chatlist: InputChatlist)", + "returns": "Any", + "params": [ + { + "name": "chatlist", + "type": "InputChatlist", + "required": true, + "default": null + } + ], + "desc_en": "Fetch new chats associated with an imported chat folder deep link. Must be invoked at most every chatlist_update_period seconds (as per the related client configuration parameter ).", + "desc_ru": "Получить новые чаты, связанные с импортированной ссылкой на папку чатов. Метод следует вызывать не чаще, чем раз в chatlist_update_period секунд." + }, + { + "name": "accept_folder_updates", + "rpc": "chatlists.joinChatlistUpdates", + "namespace": "chatlists", + "signature": "await ctx.accept_folder_updates(chatlist: InputChatlist, peers: Vector)", + "returns": "Any", + "params": [ + { + "name": "chatlist", + "type": "InputChatlist", + "required": true, + "default": null + }, + { + "name": "peers", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Join channels and supergroups recently added to a chat folder deep link.", + "desc_ru": "Присоединиться к каналам и супергруппам, недавно добавленным по ссылке на папку чатов." + }, + { + "name": "dismiss_folder_updates", + "rpc": "chatlists.hideChatlistUpdates", + "namespace": "chatlists", + "signature": "await ctx.dismiss_folder_updates(chatlist: InputChatlist)", + "returns": "Any", + "params": [ + { + "name": "chatlist", + "type": "InputChatlist", + "required": true, + "default": null + } + ], + "desc_en": "Dismiss new pending peers recently added to a chat folder deep link.", + "desc_ru": "Отклонить новых ожидающих собеседников, добавленных по ссылке на папку чатов." + }, + { + "name": "folder_leave_suggestions", + "rpc": "chatlists.getLeaveChatlistSuggestions", + "namespace": "chatlists", + "signature": "await ctx.folder_leave_suggestions(chatlist: InputChatlist)", + "returns": "Any", + "params": [ + { + "name": "chatlist", + "type": "InputChatlist", + "required": true, + "default": null + } + ], + "desc_en": "Returns identifiers of pinned or always included chats from a chat folder imported using a chat folder deep link, which are suggested to be left when the chat folder is deleted.", + "desc_ru": "Вернуть идентификаторы закреплённых или всегда включаемых чатов из импортированной папки, которые предлагается покинуть при её удалении." + }, + { + "name": "leave_shared_folder", + "rpc": "chatlists.leaveChatlist", + "namespace": "chatlists", + "signature": "await ctx.leave_shared_folder(chatlist: InputChatlist, peers: Vector)", + "returns": "Any", + "params": [ + { + "name": "chatlist", + "type": "InputChatlist", + "required": true, + "default": null + }, + { + "name": "peers", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Delete a folder imported using a chat folder deep link", + "desc_ru": "Удалить папку, импортированную по ссылке на папку чатов." + }, + { + "name": "edit_profile", + "rpc": "account.updateProfile", + "namespace": "account", + "signature": "await ctx.edit_profile()", + "returns": "Any", + "params": [ + { + "name": "first_name", + "type": "flags.0?string", + "required": false, + "default": null + }, + { + "name": "last_name", + "type": "flags.1?string", + "required": false, + "default": null + }, + { + "name": "about", + "type": "flags.2?string", + "required": false, + "default": null + } + ], + "desc_en": "Updates user profile.", + "desc_ru": "Обновить профиль пользователя." + }, + { + "name": "set_online_status", + "rpc": "account.updateStatus", + "namespace": "account", + "signature": "await ctx.set_online_status(offline: Bool)", + "returns": "Any", + "params": [ + { + "name": "offline", + "type": "Bool", + "required": true, + "default": null + } + ], + "desc_en": "Updates online user status.", + "desc_ru": "Обновить статус в сети." + }, + { + "name": "check_profile_username", + "rpc": "account.checkUsername", + "namespace": "account", + "signature": "await ctx.check_profile_username(username: string)", + "returns": "Any", + "params": [ + { + "name": "username", + "type": "string", + "required": true, + "default": null + } + ], + "desc_en": "Validates a username and checks availability.", + "desc_ru": "Проверить корректность и доступность имени пользователя." + }, + { + "name": "set_profile_username", + "rpc": "account.updateUsername", + "namespace": "account", + "signature": "await ctx.set_profile_username(username: string)", + "returns": "Any", + "params": [ + { + "name": "username", + "type": "string", + "required": true, + "default": null + } + ], + "desc_en": "Changes username for the current user.", + "desc_ru": "Изменить имя пользователя текущего аккаунта." + }, + { + "name": "privacy_rules", + "rpc": "account.getPrivacy", + "namespace": "account", + "signature": "await ctx.privacy_rules(key: InputPrivacyKey)", + "returns": "Any", + "params": [ + { + "name": "key", + "type": "InputPrivacyKey", + "required": true, + "default": null + } + ], + "desc_en": "Get privacy settings of current account", + "desc_ru": "Получить настройки приватности текущего аккаунта." + }, + { + "name": "account_inactivity_ttl", + "rpc": "account.getAccountTTL", + "namespace": "account", + "signature": "await ctx.account_inactivity_ttl()", + "returns": "Any", + "params": [ + ], + "desc_en": "Get days to live of account", + "desc_ru": "Получить срок жизни аккаунта в днях." + }, + { + "name": "set_emoji_status", + "rpc": "account.updateEmojiStatus", + "namespace": "account", + "signature": "await ctx.set_emoji_status(emoji_status: EmojiStatus)", + "returns": "Any", + "params": [ + { + "name": "emoji_status", + "type": "EmojiStatus", + "required": true, + "default": null + } + ], + "desc_en": "Set an emoji status", + "desc_ru": "Задать эмодзи-статус." + }, + { + "name": "suggested_emoji_statuses", + "rpc": "account.getDefaultEmojiStatuses", + "namespace": "account", + "signature": "await ctx.suggested_emoji_statuses(hash: long)", + "returns": "Any", + "params": [ + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Get a list of default suggested emoji statuses", + "desc_ru": "Получить список эмодзи-статусов, рекомендуемых по умолчанию." + }, + { + "name": "recent_emoji_statuses", + "rpc": "account.getRecentEmojiStatuses", + "namespace": "account", + "signature": "await ctx.recent_emoji_statuses(hash: long)", + "returns": "Any", + "params": [ + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Get recently used emoji statuses", + "desc_ru": "Получить недавно использованные эмодзи-статусы." + }, + { + "name": "clear_recent_emoji_statuses", + "rpc": "account.clearRecentEmojiStatuses", + "namespace": "account", + "signature": "await ctx.clear_recent_emoji_statuses()", + "returns": "Any", + "params": [ + ], + "desc_en": "Clears list of recently used emoji statuses", + "desc_ru": "Очистить список недавно использованных эмодзи-статусов." + }, + { + "name": "reorder_profile_usernames", + "rpc": "account.reorderUsernames", + "namespace": "account", + "signature": "await ctx.reorder_profile_usernames(order: Vector)", + "returns": "Any", + "params": [ + { + "name": "order", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Reorder usernames associated with the currently logged-in user.", + "desc_ru": "Изменить порядок имён пользователей текущего аккаунта." + }, + { + "name": "set_profile_username_active", + "rpc": "account.toggleUsername", + "namespace": "account", + "signature": "await ctx.set_profile_username_active(username: string, active: Bool)", + "returns": "Any", + "params": [ + { + "name": "username", + "type": "string", + "required": true, + "default": null + }, + { + "name": "active", + "type": "Bool", + "required": true, + "default": null + } + ], + "desc_en": "Activate or deactivate a purchased fragment.com username associated to the currently logged-in user.", + "desc_ru": "Активировать или деактивировать купленное имя пользователя на fragment.com, привязанное к текущему аккаунту." + }, + { + "name": "profile_photo_emojis", + "rpc": "account.getDefaultProfilePhotoEmojis", + "namespace": "account", + "signature": "await ctx.profile_photo_emojis(hash: long)", + "returns": "Any", + "params": [ + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Get a set of suggested custom emoji stickers that can be used as profile picture", + "desc_ru": "Получить набор рекомендуемых стикеров кастомных эмодзи для использования как фото профиля." + }, + { + "name": "set_profile_color", + "rpc": "account.updateColor", + "namespace": "account", + "signature": "await ctx.set_profile_color()", + "returns": "Any", + "params": [ + { + "name": "for_profile", + "type": "flags.1?true", + "required": false, + "default": null + }, + { + "name": "color", + "type": "flags.2?PeerColor", + "required": false, + "default": null + } + ], + "desc_en": "Update the accent color and background custom emoji of the current account.", + "desc_ru": "Обновить акцентный цвет и фоновый кастомный эмодзи текущего аккаунта." + }, + { + "name": "set_birthday", + "rpc": "account.updateBirthday", + "namespace": "account", + "signature": "await ctx.set_birthday()", + "returns": "Any", + "params": [ + { + "name": "birthday", + "type": "flags.0?Birthday", + "required": false, + "default": null + } + ], + "desc_en": "Update our birthday, see here for more info.", + "desc_ru": "Обновить день рождения текущего аккаунта." + }, + { + "name": "set_personal_channel", + "rpc": "account.updatePersonalChannel", + "namespace": "account", + "signature": "await ctx.set_personal_channel(channel: InputChannel)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": true, + "default": null + } + ], + "desc_en": "Associate (or remove) a personal channel, that will be listed on our personal profile page. Changing it will emit an updateUser update.", + "desc_ru": "Привязать или отвязать личный канал, который показывается на странице профиля. Изменение вызывает обновление updateUser." + }, + { + "name": "set_profile_tab", + "rpc": "account.setMainProfileTab", + "namespace": "account", + "signature": "await ctx.set_profile_tab(tab: ProfileTab)", + "returns": "Any", + "params": [ + { + "name": "tab", + "type": "ProfileTab", + "required": true, + "default": null + } + ], + "desc_en": "Changes the main profile tab of the current user, see here for more info.", + "desc_ru": "Изменить основную вкладку профиля текущего пользователя." + }, + { + "name": "set_music_saved", + "rpc": "account.saveMusic", + "namespace": "account", + "signature": "await ctx.set_music_saved(id: InputDocument)", + "returns": "Any", + "params": [ + { + "name": "unsave", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "id", + "type": "InputDocument", + "required": true, + "default": null + }, + { + "name": "after_id", + "type": "flags.1?InputDocument", + "required": false, + "default": null + } + ], + "desc_en": "Adds or removes a song from the current user's profile see here for more info on the music tab of the profile page.", + "desc_ru": "Добавить или удалить трек из профиля текущего пользователя." + }, + { + "name": "saved_music_ids", + "rpc": "account.getSavedMusicIds", + "namespace": "account", + "signature": "await ctx.saved_music_ids(hash: long)", + "returns": "Any", + "params": [ + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Fetch the full list of only the IDs of songs currently added to the profile, see here for more info.", + "desc_ru": "Получить полный список идентификаторов треков, добавленных в профиль." + }, + { + "name": "user_details", + "rpc": "users.getFullUser", + "namespace": "users", + "signature": "await ctx.user_details(id: InputUser)", + "returns": "Any", + "params": [ + { + "name": "id", + "type": "InputUser", + "required": true, + "default": null + } + ], + "desc_en": "Returns extended user info by ID.", + "desc_ru": "Вернуть расширенные сведения о пользователе по его ID." + }, + { + "name": "contact_requirements", + "rpc": "users.getRequirementsToContact", + "namespace": "users", + "signature": "await ctx.contact_requirements(id: Vector)", + "returns": "Any", + "params": [ + { + "name": "id", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Check whether we can write to the specified users, used to implement bulk checks for Premium-only messages and paid messages. For each input user, returns a RequirementToContact constructor (at the same offset in the vector) containing requirements to contact them.", + "desc_ru": "Проверить, можно ли писать указанным пользователям. Нужен для массовых проверок сообщений только для Premium и платных сообщений. Для каждого пользователя возвращает конструктор RequirementToContact с требованиями к написанию." + }, + { + "name": "user_music", + "rpc": "users.getSavedMusic", + "namespace": "users", + "signature": "await ctx.user_music(id: InputUser, offset: int, limit: int, hash: long)", + "returns": "Any", + "params": [ + { + "name": "id", + "type": "InputUser", + "required": true, + "default": null + }, + { + "name": "offset", + "type": "int", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + }, + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Get songs pinned to the user's profile, see here for more info.", + "desc_ru": "Получить треки, закреплённые в профиле пользователя." + }, + { + "name": "user_music_by_documents", + "rpc": "users.getSavedMusicByID", + "namespace": "users", + "signature": "await ctx.user_music_by_documents(id: InputUser, documents: Vector)", + "returns": "Any", + "params": [ + { + "name": "id", + "type": "InputUser", + "required": true, + "default": null + }, + { + "name": "documents", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Check if the passed songs are still pinned to the user's profile, or refresh the file references of songs pinned on a user's profile see here for more info.", + "desc_ru": "Проверить, закреплены ли переданные треки в профиле пользователя, либо обновить ссылки на файлы закреплённых треков." + }, + { + "name": "suggest_contact_birthday", + "rpc": "users.suggestBirthday", + "namespace": "users", + "signature": "await ctx.suggest_contact_birthday(id: InputUser, birthday: Birthday)", + "returns": "Any", + "params": [ + { + "name": "id", + "type": "InputUser", + "required": true, + "default": null + }, + { + "name": "birthday", + "type": "Birthday", + "required": true, + "default": null + } + ], + "desc_en": "Suggest a birthday to another user, see here for more info on birthdays in the API.", + "desc_ru": "Предложить другому пользователю день рождения." + }, + { + "name": "select_profile_photo", + "rpc": "photos.updateProfilePhoto", + "namespace": "photos", + "signature": "await ctx.select_profile_photo(id: InputPhoto)", + "returns": "Any", + "params": [ + { + "name": "fallback", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "bot", + "type": "flags.1?InputUser", + "required": false, + "default": null + }, + { + "name": "id", + "type": "InputPhoto", + "required": true, + "default": null + } + ], + "desc_en": "Installs a previously uploaded photo as a profile photo.", + "desc_ru": "Установить ранее загруженную фотографию как фото профиля." + }, + { + "name": "upload_profile_photo", + "rpc": "photos.uploadProfilePhoto", + "namespace": "photos", + "signature": "await ctx.upload_profile_photo()", + "returns": "Any", + "params": [ + { + "name": "fallback", + "type": "flags.3?true", + "required": false, + "default": null + }, + { + "name": "bot", + "type": "flags.5?InputUser", + "required": false, + "default": null + }, + { + "name": "file", + "type": "flags.0?InputFile", + "required": false, + "default": null + }, + { + "name": "video", + "type": "flags.1?InputFile", + "required": false, + "default": null + }, + { + "name": "video_start_ts", + "type": "flags.2?double", + "required": false, + "default": null + }, + { + "name": "video_emoji_markup", + "type": "flags.4?VideoSize", + "required": false, + "default": null + } + ], + "desc_en": "Updates current user profile photo. The file, video and video_emoji_markup flags are mutually exclusive.", + "desc_ru": "Обновить фото профиля текущего пользователя. Флаги file, video и video_emoji_markup взаимоисключающи." + }, + { + "name": "remove_profile_photos", + "rpc": "photos.deletePhotos", + "namespace": "photos", + "signature": "await ctx.remove_profile_photos(id: Vector)", + "returns": "Any", + "params": [ + { + "name": "id", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Deletes profile photos. The method returns a list of successfully deleted photo IDs.", + "desc_ru": "Удалить фотографии профиля. Возвращает список идентификаторов удалённых фотографий." + }, + { + "name": "profile_photos", + "rpc": "photos.getUserPhotos", + "namespace": "photos", + "signature": "await ctx.profile_photos(user_id: InputUser, offset: int, max_id: long, limit: int)", + "returns": "Any", + "params": [ + { + "name": "user_id", + "type": "InputUser", + "required": true, + "default": null + }, + { + "name": "offset", + "type": "int", + "required": false, + "default": null + }, + { + "name": "max_id", + "type": "long", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + } + ], + "desc_en": "Returns the list of user photos.", + "desc_ru": "Вернуть список фотографий пользователя." + }, + { + "name": "set_contact_photo", + "rpc": "photos.uploadContactProfilePhoto", + "namespace": "photos", + "signature": "await ctx.set_contact_photo(user_id: InputUser)", + "returns": "Any", + "params": [ + { + "name": "suggest", + "type": "flags.3?true", + "required": false, + "default": null + }, + { + "name": "save", + "type": "flags.4?true", + "required": false, + "default": null + }, + { + "name": "user_id", + "type": "InputUser", + "required": true, + "default": null + }, + { + "name": "file", + "type": "flags.0?InputFile", + "required": false, + "default": null + }, + { + "name": "video", + "type": "flags.1?InputFile", + "required": false, + "default": null + }, + { + "name": "video_start_ts", + "type": "flags.2?double", + "required": false, + "default": null + }, + { + "name": "video_emoji_markup", + "type": "flags.5?VideoSize", + "required": false, + "default": null + } + ], + "desc_en": "Upload a custom profile picture for a contact, or suggest a new profile picture to a contact. The file, video and video_emoji_markup flags are mutually exclusive.", + "desc_ru": "Загрузить своё фото для контакта или предложить контакту новое. Флаги file, video и video_emoji_markup взаимоисключающи." + }, + { + "name": "notification_settings", + "rpc": "account.getNotifySettings", + "namespace": "account", + "signature": "await ctx.notification_settings(peer: InputNotifyPeer)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputNotifyPeer", + "required": true, + "default": null + } + ], + "desc_en": "Gets current notification settings for a given user/group, from all users/all groups.", + "desc_ru": "Получить текущие настройки уведомлений для указанного пользователя или группы, либо для всех пользователей и групп." + }, + { + "name": "set_notification_settings", + "rpc": "account.updateNotifySettings", + "namespace": "account", + "signature": "await ctx.set_notification_settings(peer: InputNotifyPeer, settings: InputPeerNotifySettings)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputNotifyPeer", + "required": true, + "default": null + }, + { + "name": "settings", + "type": "InputPeerNotifySettings", + "required": true, + "default": null + } + ], + "desc_en": "Edits notification settings from a given user/group, from all users/all groups.", + "desc_ru": "Изменить настройки уведомлений для указанного пользователя или группы, либо для всех пользователей и групп." + }, + { + "name": "reset_notification_settings", + "rpc": "account.resetNotifySettings", + "namespace": "account", + "signature": "await ctx.reset_notification_settings()", + "returns": "Any", + "params": [ + ], + "desc_en": "Resets all notification settings from users and groups.", + "desc_ru": "Сбросить все настройки уведомлений пользователей и групп." + }, + { + "name": "contact_signup_notifications", + "rpc": "account.getContactSignUpNotification", + "namespace": "account", + "signature": "await ctx.contact_signup_notifications()", + "returns": "Any", + "params": [ + ], + "desc_en": "Whether the user will receive notifications when contacts sign up", + "desc_ru": "Будут ли приходить уведомления, когда контакты регистрируются в Telegram." + }, + { + "name": "set_contact_signup_notifications", + "rpc": "account.setContactSignUpNotification", + "namespace": "account", + "signature": "await ctx.set_contact_signup_notifications(silent: Bool)", + "returns": "Any", + "params": [ + { + "name": "silent", + "type": "Bool", + "required": true, + "default": null + } + ], + "desc_en": "Toggle contact sign up notifications", + "desc_ru": "Включить или выключить уведомления о контактах, зарегистрировавшихся в Telegram." + }, + { + "name": "notification_exceptions", + "rpc": "account.getNotifyExceptions", + "namespace": "account", + "signature": "await ctx.notification_exceptions()", + "returns": "Any", + "params": [ + { + "name": "compare_sound", + "type": "flags.1?true", + "required": false, + "default": null + }, + { + "name": "compare_stories", + "type": "flags.2?true", + "required": false, + "default": null + }, + { + "name": "peer", + "type": "flags.0?InputNotifyPeer", + "required": false, + "default": null + } + ], + "desc_en": "Returns list of chats with non-default notification settings", + "desc_ru": "Вернуть список чатов с нестандартными настройками уведомлений." + }, + { + "name": "reaction_notification_settings", + "rpc": "account.getReactionsNotifySettings", + "namespace": "account", + "signature": "await ctx.reaction_notification_settings()", + "returns": "Any", + "params": [ + ], + "desc_en": "Get the current reaction notification settings.", + "desc_ru": "Получить текущие настройки уведомлений о реакциях." + }, + { + "name": "set_reaction_notification_settings", + "rpc": "account.setReactionsNotifySettings", + "namespace": "account", + "signature": "await ctx.set_reaction_notification_settings(settings: ReactionsNotifySettings)", + "returns": "Any", + "params": [ + { + "name": "settings", + "type": "ReactionsNotifySettings", + "required": true, + "default": null + } + ], + "desc_en": "Change the reaction notification settings.", + "desc_ru": "Изменить настройки уведомлений о реакциях." + }, + { + "name": "saved_notification_sounds", + "rpc": "account.getSavedRingtones", + "namespace": "account", + "signature": "await ctx.saved_notification_sounds(hash: long)", + "returns": "Any", + "params": [ + { + "name": "hash", + "type": "long", + "required": false, + "default": null + } + ], + "desc_en": "Fetch saved notification sounds", + "desc_ru": "Получить сохранённые звуки уведомлений." + }, + { + "name": "set_notification_sound_saved", + "rpc": "account.saveRingtone", + "namespace": "account", + "signature": "await ctx.set_notification_sound_saved(id: InputDocument, unsave: Bool)", + "returns": "Any", + "params": [ + { + "name": "id", + "type": "InputDocument", + "required": true, + "default": null + }, + { + "name": "unsave", + "type": "Bool", + "required": true, + "default": null + } + ], + "desc_en": "Save or remove saved notification sound. If the notification sound is already in MP3 format, account.savedRingtone will be returned. Otherwise, it will be automatically converted and a account.savedRingtoneConverted will be returned, containing a new document object that should be used to refer to the ringtone from now on (ie when deleting it using the unsave parameter, or when downloading it).", + "desc_ru": "Сохранить или удалить звук уведомления. Если звук уже в MP3, вернётся account.savedRingtone, иначе он будет сконвертирован и вернётся account.savedRingtoneConverted с новым документом." + }, + { + "name": "upload_notification_sound", + "rpc": "account.uploadRingtone", + "namespace": "account", + "signature": "await ctx.upload_notification_sound(file: InputFile, file_name: string, mime_type: string)", + "returns": "Any", + "params": [ + { + "name": "file", + "type": "InputFile", + "required": true, + "default": null + }, + { + "name": "file_name", + "type": "string", + "required": true, + "default": null + }, + { + "name": "mime_type", + "type": "string", + "required": true, + "default": null + } + ], + "desc_en": "Upload notification sound, use account.saveRingtone to convert it and add it to the list of saved notification sounds.", + "desc_ru": "Загрузить звук уведомления. Чтобы добавить его в список сохранённых, используйте account.saveRingtone." + }, + { + "name": "rename_basic_group", + "rpc": "messages.editChatTitle", + "namespace": "messages", + "signature": "await ctx.rename_basic_group(chat_id: long, title: string)", + "returns": "Any", + "params": [ + { + "name": "chat_id", + "type": "long", + "required": true, + "default": null + }, + { + "name": "title", + "type": "string", + "required": true, + "default": null + } + ], + "desc_en": "Changes chat name and sends a service message on it.", + "desc_ru": "Изменить название чата и отправить служебное сообщение." + }, + { + "name": "set_basic_group_photo", + "rpc": "messages.editChatPhoto", + "namespace": "messages", + "signature": "await ctx.set_basic_group_photo(chat_id: long, photo: InputChatPhoto)", + "returns": "Any", + "params": [ + { + "name": "chat_id", + "type": "long", + "required": true, + "default": null + }, + { + "name": "photo", + "type": "InputChatPhoto", + "required": true, + "default": null + } + ], + "desc_en": "Changes chat photo and sends a service message on it", + "desc_ru": "Изменить фото чата и отправить служебное сообщение." + }, + { + "name": "add_basic_group_member", + "rpc": "messages.addChatUser", + "namespace": "messages", + "signature": "await ctx.add_basic_group_member(chat_id: long, user_id: InputUser, fwd_limit: int)", + "returns": "Any", + "params": [ + { + "name": "chat_id", + "type": "long", + "required": true, + "default": null + }, + { + "name": "user_id", + "type": "InputUser", + "required": true, + "default": null + }, + { + "name": "fwd_limit", + "type": "int", + "required": false, + "default": null + } + ], + "desc_en": "Adds a user to a chat and sends a service message on it.", + "desc_ru": "Добавить пользователя в чат и отправить служебное сообщение." + }, + { + "name": "remove_basic_group_member", + "rpc": "messages.deleteChatUser", + "namespace": "messages", + "signature": "await ctx.remove_basic_group_member(chat_id: long, user_id: InputUser)", + "returns": "Any", + "params": [ + { + "name": "revoke_history", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "chat_id", + "type": "long", + "required": true, + "default": null + }, + { + "name": "user_id", + "type": "InputUser", + "required": true, + "default": null + } + ], + "desc_en": "Deletes a user from a chat and sends a service message on it.", + "desc_ru": "Удалить пользователя из чата и отправить служебное сообщение." + }, + { + "name": "create_basic_group", + "rpc": "messages.createChat", + "namespace": "messages", + "signature": "await ctx.create_basic_group(users: Vector, title: string)", + "returns": "Any", + "params": [ + { + "name": "users", + "type": "Vector", + "required": true, + "default": null + }, + { + "name": "title", + "type": "string", + "required": true, + "default": null + }, + { + "name": "ttl_period", + "type": "flags.0?int", + "required": false, + "default": null + } + ], + "desc_en": "Creates a new chat.", + "desc_ru": "Создать новый чат." + }, + { + "name": "set_basic_group_admin", + "rpc": "messages.editChatAdmin", + "namespace": "messages", + "signature": "await ctx.set_basic_group_admin(chat_id: long, user_id: InputUser, is_admin: Bool)", + "returns": "Any", + "params": [ + { + "name": "chat_id", + "type": "long", + "required": true, + "default": null + }, + { + "name": "user_id", + "type": "InputUser", + "required": true, + "default": null + }, + { + "name": "is_admin", + "type": "Bool", + "required": true, + "default": null + } + ], + "desc_en": "Make a user admin in a basic group.", + "desc_ru": "Назначить пользователя администратором базовой группы." + }, + { + "name": "upgrade_basic_group", + "rpc": "messages.migrateChat", + "namespace": "messages", + "signature": "await ctx.upgrade_basic_group(chat_id: long)", + "returns": "Any", + "params": [ + { + "name": "chat_id", + "type": "long", + "required": true, + "default": null + } + ], + "desc_en": "Turn a basic group into a supergroup", + "desc_ru": "Превратить базовую группу в супергруппу." + }, + { + "name": "edit_chat_description", + "rpc": "messages.editChatAbout", + "namespace": "messages", + "signature": "await ctx.edit_chat_description(peer: InputPeer, about: string)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "about", + "type": "string", + "required": true, + "default": null + } + ], + "desc_en": "Edit the description of a group/supergroup/channel.", + "desc_ru": "Изменить описание группы, супергруппы или канала." + }, + { + "name": "set_default_member_restrictions", + "rpc": "messages.editChatDefaultBannedRights", + "namespace": "messages", + "signature": "await ctx.set_default_member_restrictions(peer: InputPeer, banned_rights: ChatBannedRights)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "banned_rights", + "type": "ChatBannedRights", + "required": true, + "default": null + } + ], + "desc_en": "Edit the default banned rights of a channel/supergroup/group.", + "desc_ru": "Изменить права по умолчанию для участников канала, супергруппы или группы." + }, + { + "name": "remove_basic_group", + "rpc": "messages.deleteChat", + "namespace": "messages", + "signature": "await ctx.remove_basic_group(chat_id: long)", + "returns": "Any", + "params": [ + { + "name": "chat_id", + "type": "long", + "required": true, + "default": null + } + ], + "desc_en": "Delete a chat", + "desc_ru": "Удалить чат." + }, + { + "name": "set_chat_auto_delete", + "rpc": "messages.setHistoryTTL", + "namespace": "messages", + "signature": "await ctx.set_chat_auto_delete(peer: InputPeer, period: int)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "period", + "type": "int", + "required": true, + "default": null + } + ], + "desc_en": "Set maximum Time-To-Live of all messages in the specified chat", + "desc_ru": "Задать максимальный срок жизни сообщений в указанном чате." + }, + { + "name": "set_content_protection", + "rpc": "messages.toggleNoForwards", + "namespace": "messages", + "signature": "await ctx.set_content_protection(peer: InputPeer, enabled: Bool)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "enabled", + "type": "Bool", + "required": true, + "default": null + }, + { + "name": "request_msg_id", + "type": "flags.0?int", + "required": false, + "default": null + } + ], + "desc_en": "Enable or disable content protection on a channel, group or private chat.", + "desc_ru": "Включить или выключить защиту содержимого в канале, группе или личном чате." + }, + { + "name": "mark_channel_read", + "rpc": "channels.readHistory", + "namespace": "channels", + "signature": "await ctx.mark_channel_read(channel: InputChannel, max_id: int)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "max_id", + "type": "int", + "required": true, + "default": null + } + ], + "desc_en": "Mark channel/supergroup history as read", + "desc_ru": "Отметить историю канала или супергруппы как прочитанную." + }, + { + "name": "channel_members", + "rpc": "channels.getParticipants", + "namespace": "channels", + "signature": "await ctx.channel_members(channel: InputChannel, filter: ChannelParticipantsFilter, offset: int, limit: int, hash: long)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "filter", + "type": "ChannelParticipantsFilter", + "required": false, + "default": null + }, + { + "name": "offset", + "type": "int", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + }, + { + "name": "hash", + "type": "long", + "required": true, + "default": null + } + ], + "desc_en": "Get the participants of a supergroup/channel", + "desc_ru": "Получить участников супергруппы или канала." + }, + { + "name": "channel_member", + "rpc": "channels.getParticipant", + "namespace": "channels", + "signature": "await ctx.channel_member(channel: InputChannel, participant: InputPeer)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "participant", + "type": "InputPeer", + "required": true, + "default": null + } + ], + "desc_en": "Get info about a channel/supergroup participant", + "desc_ru": "Получить сведения об участнике канала или супергруппы." + }, + { + "name": "channel_details", + "rpc": "channels.getFullChannel", + "namespace": "channels", + "signature": "await ctx.channel_details(channel: InputChannel)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + } + ], + "desc_en": "Get full info about a supergroup, gigagroup or channel", + "desc_ru": "Получить полные сведения о супергруппе, гигагруппе или канале." + }, + { + "name": "create_channel", + "rpc": "channels.createChannel", + "namespace": "channels", + "signature": "await ctx.create_channel(title: string, about: string)", + "returns": "Any", + "params": [ + { + "name": "broadcast", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "megagroup", + "type": "flags.1?true", + "required": false, + "default": null + }, + { + "name": "for_import", + "type": "flags.3?true", + "required": false, + "default": null + }, + { + "name": "forum", + "type": "flags.5?true", + "required": false, + "default": null + }, + { + "name": "title", + "type": "string", + "required": true, + "default": null + }, + { + "name": "about", + "type": "string", + "required": true, + "default": null + }, + { + "name": "geo_point", + "type": "flags.2?InputGeoPoint", + "required": false, + "default": null + }, + { + "name": "address", + "type": "flags.2?string", + "required": false, + "default": null + }, + { + "name": "ttl_period", + "type": "flags.4?int", + "required": false, + "default": null + } + ], + "desc_en": "Create a supergroup/channel.", + "desc_ru": "Создать супергруппу или канал." + }, + { + "name": "set_channel_admin", + "rpc": "channels.editAdmin", + "namespace": "channels", + "signature": "await ctx.set_channel_admin(channel: InputChannel, user_id: InputUser, admin_rights: ChatAdminRights)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "user_id", + "type": "InputUser", + "required": true, + "default": null + }, + { + "name": "admin_rights", + "type": "ChatAdminRights", + "required": true, + "default": null + }, + { + "name": "rank", + "type": "flags.0?string", + "required": false, + "default": null + } + ], + "desc_en": "Modify the admin rights of a user in a supergroup/channel.", + "desc_ru": "Изменить права администратора пользователя в супергруппе или канале." + }, + { + "name": "rename_channel", + "rpc": "channels.editTitle", + "namespace": "channels", + "signature": "await ctx.rename_channel(channel: InputChannel, title: string)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "title", + "type": "string", + "required": true, + "default": null + } + ], + "desc_en": "Edit the name of a channel/supergroup", + "desc_ru": "Изменить название канала или супергруппы." + }, + { + "name": "set_channel_photo", + "rpc": "channels.editPhoto", + "namespace": "channels", + "signature": "await ctx.set_channel_photo(channel: InputChannel, photo: InputChatPhoto)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "photo", + "type": "InputChatPhoto", + "required": true, + "default": null + } + ], + "desc_en": "Change the photo of a channel/supergroup", + "desc_ru": "Изменить фото канала или супергруппы." + }, + { + "name": "check_channel_username", + "rpc": "channels.checkUsername", + "namespace": "channels", + "signature": "await ctx.check_channel_username(channel: InputChannel, username: string)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "username", + "type": "string", + "required": true, + "default": null + } + ], + "desc_en": "Check if a username is free and can be assigned to a channel/supergroup", + "desc_ru": "Проверить, свободно ли имя пользователя и можно ли назначить его каналу или супергруппе." + }, + { + "name": "set_channel_username", + "rpc": "channels.updateUsername", + "namespace": "channels", + "signature": "await ctx.set_channel_username(channel: InputChannel, username: string)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "username", + "type": "string", + "required": true, + "default": null + } + ], + "desc_en": "Change or remove the username of a supergroup/channel", + "desc_ru": "Изменить или снять имя пользователя супергруппы или канала." + }, + { + "name": "join_channel", + "rpc": "channels.joinChannel", + "namespace": "channels", + "signature": "await ctx.join_channel(channel: InputChannel)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + } + ], + "desc_en": "Join a channel/supergroup", + "desc_ru": "Вступить в канал или супергруппу." + }, + { + "name": "leave_channel", + "rpc": "channels.leaveChannel", + "namespace": "channels", + "signature": "await ctx.leave_channel(channel: InputChannel)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + } + ], + "desc_en": "Leave a channel/supergroup", + "desc_ru": "Покинуть канал или супергруппу." + }, + { + "name": "invite_channel_members", + "rpc": "channels.inviteToChannel", + "namespace": "channels", + "signature": "await ctx.invite_channel_members(channel: InputChannel, users: Vector)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "users", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Invite users to a channel/supergroup", + "desc_ru": "Пригласить пользователей в канал или супергруппу." + }, + { + "name": "remove_channel", + "rpc": "channels.deleteChannel", + "namespace": "channels", + "signature": "await ctx.remove_channel(channel: InputChannel)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + } + ], + "desc_en": "Delete a channel/supergroup", + "desc_ru": "Удалить канал или супергруппу." + }, + { + "name": "set_channel_signatures", + "rpc": "channels.toggleSignatures", + "namespace": "channels", + "signature": "await ctx.set_channel_signatures(channel: InputChannel)", + "returns": "Any", + "params": [ + { + "name": "signatures_enabled", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "profiles_enabled", + "type": "flags.1?true", + "required": false, + "default": null + }, + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + } + ], + "desc_en": "Enable/disable message signatures in channels", + "desc_ru": "Включить или выключить подписи сообщений в каналах." + }, + { + "name": "owned_public_channels", + "rpc": "channels.getAdminedPublicChannels", + "namespace": "channels", + "signature": "await ctx.owned_public_channels()", + "returns": "Any", + "params": [ + { + "name": "by_location", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "check_limit", + "type": "flags.1?true", + "required": false, + "default": null + }, + { + "name": "for_personal", + "type": "flags.2?true", + "required": false, + "default": null + }, + { + "name": "for_community_peer", + "type": "flags.3?true", + "required": false, + "default": null + } + ], + "desc_en": "Get channels/supergroups/geogroups we're admin in. Usually called when the user exceeds the limit for owned public channels/supergroups/geogroups, and the user is given the choice to remove one of his channels/supergroups/geogroups.", + "desc_ru": "Получить каналы, супергруппы и геогруппы, где мы администратор. Обычно вызывается, когда пользователь превысил лимит публичных каналов и должен выбрать, какой удалить." + }, + { + "name": "restrict_channel_member", + "rpc": "channels.editBanned", + "namespace": "channels", + "signature": "await ctx.restrict_channel_member(channel: InputChannel, participant: InputPeer, banned_rights: ChatBannedRights)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "participant", + "type": "InputPeer", + "required": true, + "default": null + }, + { + "name": "banned_rights", + "type": "ChatBannedRights", + "required": true, + "default": null + } + ], + "desc_en": "Ban/unban/kick a user in a supergroup/channel.", + "desc_ru": "Забанить, разбанить или исключить пользователя в супергруппе или канале." + }, + { + "name": "channel_admin_log", + "rpc": "channels.getAdminLog", + "namespace": "channels", + "signature": "await ctx.channel_admin_log(channel: InputChannel, q: string, max_id: long, min_id: long, limit: int)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "q", + "type": "string", + "required": false, + "default": null + }, + { + "name": "events_filter", + "type": "flags.0?ChannelAdminLogEventsFilter", + "required": false, + "default": null + }, + { + "name": "admins", + "type": "flags.1?Vector", + "required": false, + "default": null + }, + { + "name": "max_id", + "type": "long", + "required": true, + "default": null + }, + { + "name": "min_id", + "type": "long", + "required": true, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + } + ], + "desc_en": "Get the admin log of a channel/supergroup", + "desc_ru": "Получить журнал администраторов канала или супергруппы." + }, + { + "name": "set_group_sticker_set", + "rpc": "channels.setStickers", + "namespace": "channels", + "signature": "await ctx.set_group_sticker_set(channel: InputChannel, stickerset: InputStickerSet)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "stickerset", + "type": "InputStickerSet", + "required": true, + "default": null + } + ], + "desc_en": "Associate a stickerset to the supergroup", + "desc_ru": "Назначить набор стикеров супергруппе." + }, + { + "name": "mark_channel_media_read", + "rpc": "channels.readMessageContents", + "namespace": "channels", + "signature": "await ctx.mark_channel_media_read(channel: InputChannel, id: Vector)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "id", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Mark channel/supergroup message contents as read, emitting an updateChannelReadMessagesContents.", + "desc_ru": "Отметить содержимое сообщений канала или супергруппы как прочитанное. Вызывается обновление updateChannelReadMessagesContents." + }, + { + "name": "clear_channel_history", + "rpc": "channels.deleteHistory", + "namespace": "channels", + "signature": "await ctx.clear_channel_history(channel: InputChannel, max_id: int)", + "returns": "Any", + "params": [ + { + "name": "for_everyone", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "max_id", + "type": "int", + "required": true, + "default": null + } + ], + "desc_en": "Delete the history of a supergroup", + "desc_ru": "Удалить историю супергруппы." + }, + { + "name": "set_prehistory_hidden", + "rpc": "channels.togglePreHistoryHidden", + "namespace": "channels", + "signature": "await ctx.set_prehistory_hidden(channel: InputChannel, enabled: Bool)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "enabled", + "type": "Bool", + "required": true, + "default": null + } + ], + "desc_en": "Hide/unhide message history for new channel/supergroup users", + "desc_ru": "Скрыть или показать историю сообщений для новых участников канала или супергруппы." + }, + { + "name": "left_channels", + "rpc": "channels.getLeftChannels", + "namespace": "channels", + "signature": "await ctx.left_channels(offset: int)", + "returns": "Any", + "params": [ + { + "name": "offset", + "type": "int", + "required": false, + "default": null + } + ], + "desc_en": "Get a list of channels/supergroups we left, requires a takeout session, see here for more info.", + "desc_ru": "Получить список каналов и супергрупп, из которых мы вышли. Требуется сессия выгрузки данных." + }, + { + "name": "eligible_discussion_groups", + "rpc": "channels.getGroupsForDiscussion", + "namespace": "channels", + "signature": "await ctx.eligible_discussion_groups()", + "returns": "Any", + "params": [ + ], + "desc_en": "Get all groups that can be used as discussion groups. Returned basic group chats must be first upgraded to supergroups before they can be set as a discussion group. To set a returned supergroup as a discussion group, access to its old messages must be enabled using channels.togglePreHistoryHidden, first.", + "desc_ru": "Получить все группы, которые можно назначить обсуждением. Базовую группу сначала нужно повысить до супергруппы, а для супергруппы открыть доступ к старым сообщениям через channels.togglePreHistoryHidden." + }, + { + "name": "set_discussion_group", + "rpc": "channels.setDiscussionGroup", + "namespace": "channels", + "signature": "await ctx.set_discussion_group(broadcast: InputChannel, group: InputChannel)", + "returns": "Any", + "params": [ + { + "name": "broadcast", + "type": "InputChannel", + "required": true, + "default": null + }, + { + "name": "group", + "type": "InputChannel", + "required": true, + "default": null + } + ], + "desc_en": "Associate a group to a channel as discussion group for that channel", + "desc_ru": "Назначить группу обсуждением для канала." + }, + { + "name": "set_group_location", + "rpc": "channels.editLocation", + "namespace": "channels", + "signature": "await ctx.set_group_location(channel: InputChannel, geo_point: InputGeoPoint, address: string)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "geo_point", + "type": "InputGeoPoint", + "required": true, + "default": null + }, + { + "name": "address", + "type": "string", + "required": true, + "default": null + } + ], + "desc_en": "Edit location of geogroup, see here for more info on geogroups.", + "desc_ru": "Изменить местоположение геогруппы." + }, + { + "name": "set_slow_mode", + "rpc": "channels.toggleSlowMode", + "namespace": "channels", + "signature": "await ctx.set_slow_mode(channel: InputChannel, seconds: int)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "seconds", + "type": "int", + "required": true, + "default": null + } + ], + "desc_en": "Toggle supergroup slow mode: if enabled, users will only be able to send one message every seconds seconds", + "desc_ru": "Включить или выключить медленный режим в супергруппе: пользователи смогут отправлять одно сообщение в seconds секунд." + }, + { + "name": "inactive_channels", + "rpc": "channels.getInactiveChannels", + "namespace": "channels", + "signature": "await ctx.inactive_channels()", + "returns": "Any", + "params": [ + ], + "desc_en": "Get inactive channels and supergroups", + "desc_ru": "Получить неактивные каналы и супергруппы." + }, + { + "name": "send_as_identities", + "rpc": "channels.getSendAs", + "namespace": "channels", + "signature": "await ctx.send_as_identities(peer: InputPeer)", + "returns": "Any", + "params": [ + { + "name": "for_paid_reactions", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "for_live_stories", + "type": "flags.1?true", + "required": false, + "default": null + }, + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + } + ], + "desc_en": "Obtains a list of peers that can be displayed as the sender in a specific context. With for_live_stories, returns peers that may author live story in-call messages.", + "desc_ru": "Получить список собеседников, которых можно показать как отправителя в конкретном контексте. С флагом for_live_stories возвращает тех, кто может публиковать сообщения в звонках в трансляции." + }, + { + "name": "remove_member_history", + "rpc": "channels.deleteParticipantHistory", + "namespace": "channels", + "signature": "await ctx.remove_member_history(channel: InputChannel, participant: InputPeer)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "participant", + "type": "InputPeer", + "required": true, + "default": null + } + ], + "desc_en": "Delete all messages sent by a specific participant of a given supergroup", + "desc_ru": "Удалить все сообщения, отправленные конкретным участником супергруппы." + }, + { + "name": "set_join_to_send", + "rpc": "channels.toggleJoinToSend", + "namespace": "channels", + "signature": "await ctx.set_join_to_send(channel: InputChannel, enabled: Bool)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "enabled", + "type": "Bool", + "required": true, + "default": null + } + ], + "desc_en": "Set whether all users should join a discussion group in order to comment on a post", + "desc_ru": "Задать, должны ли все пользователи вступать в группу обсуждения, чтобы комментировать публикацию." + }, + { + "name": "set_join_requests", + "rpc": "channels.toggleJoinRequest", + "namespace": "channels", + "signature": "await ctx.set_join_requests(channel: InputChannel, enabled: Bool)", + "returns": "Any", + "params": [ + { + "name": "apply_to_invites", + "type": "flags.1?true", + "required": false, + "default": null + }, + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "enabled", + "type": "Bool", + "required": true, + "default": null + }, + { + "name": "guard_bot", + "type": "flags.0?InputUser", + "required": false, + "default": null + } + ], + "desc_en": "Set whether all users should request admin approval to join the group.", + "desc_ru": "Задать, должны ли все пользователи отправлять заявку на одобрение администратора для вступления в группу." + }, + { + "name": "reorder_channel_usernames", + "rpc": "channels.reorderUsernames", + "namespace": "channels", + "signature": "await ctx.reorder_channel_usernames(channel: InputChannel, order: Vector)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "order", + "type": "Vector", + "required": true, + "default": null + } + ], + "desc_en": "Reorder active usernames", + "desc_ru": "Изменить порядок активных имён пользователей." + }, + { + "name": "set_channel_username_active", + "rpc": "channels.toggleUsername", + "namespace": "channels", + "signature": "await ctx.set_channel_username_active(channel: InputChannel, username: string, active: Bool)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "username", + "type": "string", + "required": true, + "default": null + }, + { + "name": "active", + "type": "Bool", + "required": true, + "default": null + } + ], + "desc_en": "Activate or deactivate a purchased fragment.com username associated to a supergroup or channel we own.", + "desc_ru": "Активировать или деактивировать купленное имя пользователя на fragment.com, привязанное к супергруппе или каналу." + }, + { + "name": "deactivate_channel_usernames", + "rpc": "channels.deactivateAllUsernames", + "namespace": "channels", + "signature": "await ctx.deactivate_channel_usernames(channel: InputChannel)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + } + ], + "desc_en": "Disable all purchased usernames of a supergroup or channel", + "desc_ru": "Отключить все купленные имена пользователей супергруппы или канала." + }, + { + "name": "set_antispam", + "rpc": "channels.toggleAntiSpam", + "namespace": "channels", + "signature": "await ctx.set_antispam(channel: InputChannel, enabled: Bool)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "enabled", + "type": "Bool", + "required": true, + "default": null + } + ], + "desc_en": "Enable or disable the native antispam system.", + "desc_ru": "Включить или выключить встроенную систему антиспама." + }, + { + "name": "set_members_hidden", + "rpc": "channels.toggleParticipantsHidden", + "namespace": "channels", + "signature": "await ctx.set_members_hidden(channel: InputChannel, enabled: Bool)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "enabled", + "type": "Bool", + "required": true, + "default": null + } + ], + "desc_en": "Hide or display the participants list in a supergroup. The supergroup must have at least hidden_members_group_size_min participants in order to use this method, as specified by the client configuration parameters.", + "desc_ru": "Скрыть или показать список участников супергруппы. В supergroup должно быть не меньше hidden_members_group_size_min участников." + }, + { + "name": "set_channel_color", + "rpc": "channels.updateColor", + "namespace": "channels", + "signature": "await ctx.set_channel_color(channel: InputChannel)", + "returns": "Any", + "params": [ + { + "name": "for_profile", + "type": "flags.1?true", + "required": false, + "default": null + }, + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "color", + "type": "flags.2?int", + "required": false, + "default": null + }, + { + "name": "background_emoji_id", + "type": "flags.0?long", + "required": false, + "default": null + } + ], + "desc_en": "Update the accent color and background custom emoji of a channel.", + "desc_ru": "Обновить акцентный цвет и фоновый кастомный эмодзи канала." + }, + { + "name": "related_channels", + "rpc": "channels.getChannelRecommendations", + "namespace": "channels", + "signature": "await ctx.related_channels()", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "flags.0?InputChannel", + "required": false, + "default": null + } + ], + "desc_en": "Obtain a list of similarly themed public channels, selected based on similarities in their subscriber bases.", + "desc_ru": "Получить список публичных каналов со схожей тематикой, отобранных по сходству баз подписчиков." + }, + { + "name": "set_channel_emoji_status", + "rpc": "channels.updateEmojiStatus", + "namespace": "channels", + "signature": "await ctx.set_channel_emoji_status(channel: InputChannel, emoji_status: EmojiStatus)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "emoji_status", + "type": "EmojiStatus", + "required": true, + "default": null + } + ], + "desc_en": "Set an emoji status for a channel or supergroup.", + "desc_ru": "Задать эмодзи-статус для канала или супергруппы." + }, + { + "name": "set_group_emoji_set", + "rpc": "channels.setEmojiStickers", + "namespace": "channels", + "signature": "await ctx.set_group_emoji_set(channel: InputChannel, stickerset: InputStickerSet)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "stickerset", + "type": "InputStickerSet", + "required": true, + "default": null + } + ], + "desc_en": "Set a custom emoji stickerset for supergroups. Only usable after reaching at least the boost level specified in the group_emoji_stickers_level_min config parameter.", + "desc_ru": "Задать набор стикеров кастомных эмодзи для супергруппы. Доступно только после достижения уровня буста, заданного параметром group_emoji_stickers_level_min." + }, + { + "name": "set_channel_auto_translation", + "rpc": "channels.toggleAutotranslation", + "namespace": "channels", + "signature": "await ctx.set_channel_auto_translation(channel: InputChannel, enabled: Bool)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "enabled", + "type": "Bool", + "required": true, + "default": null + } + ], + "desc_en": "Toggle autotranslation in a channel, for all users: see here for more info.", + "desc_ru": "Включить или выключить автоперевод в канале для всех пользователей." + }, + { + "name": "set_channel_profile_tab", + "rpc": "channels.setMainProfileTab", + "namespace": "channels", + "signature": "await ctx.set_channel_profile_tab(channel: InputChannel, tab: ProfileTab)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "tab", + "type": "ProfileTab", + "required": true, + "default": null + } + ], + "desc_en": "Changes the main profile tab of a channel, see here for more info.", + "desc_ru": "Изменить основную вкладку профиля канала." + }, + { + "name": "edit_member_rank", + "rpc": "messages.editChatParticipantRank", + "namespace": "messages", + "signature": "await ctx.edit_member_rank(peer: InputPeer, participant: InputPeer, rank: string)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "participant", + "type": "InputPeer", + "required": true, + "default": null + }, + { + "name": "rank", + "type": "string", + "required": true, + "default": null + } + ], + "desc_en": "Edit a group participant's tag.", + "desc_ru": "Изменить тег участника группы." + }, + { + "name": "create_chat_invite", + "rpc": "messages.exportChatInvite", + "namespace": "messages", + "signature": "await ctx.create_chat_invite(peer: InputPeer)", + "returns": "Any", + "params": [ + { + "name": "legacy_revoke_permanent", + "type": "flags.2?true", + "required": false, + "default": null + }, + { + "name": "request_needed", + "type": "flags.3?true", + "required": false, + "default": null + }, + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "expire_date", + "type": "flags.0?int", + "required": false, + "default": null + }, + { + "name": "usage_limit", + "type": "flags.1?int", + "required": false, + "default": null + }, + { + "name": "title", + "type": "flags.4?string", + "required": false, + "default": null + } + ], + "desc_en": "Export an invite link for a chat", + "desc_ru": "Экспортировать ссылку-приглашение в чат." + }, + { + "name": "chat_invites", + "rpc": "messages.getExportedChatInvites", + "namespace": "messages", + "signature": "await ctx.chat_invites(peer: InputPeer, admin_id: InputUser, limit: int)", + "returns": "Any", + "params": [ + { + "name": "revoked", + "type": "flags.3?true", + "required": false, + "default": null + }, + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "admin_id", + "type": "InputUser", + "required": true, + "default": null + }, + { + "name": "offset_date", + "type": "flags.2?int", + "required": false, + "default": null + }, + { + "name": "offset_link", + "type": "flags.2?string", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + } + ], + "desc_en": "Get info about the chat invites of a specific chat", + "desc_ru": "Получить сведения о приглашениях в конкретный чат." + }, + { + "name": "chat_invite_details", + "rpc": "messages.getExportedChatInvite", + "namespace": "messages", + "signature": "await ctx.chat_invite_details(peer: InputPeer, link: string)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "link", + "type": "string", + "required": true, + "default": null + } + ], + "desc_en": "Get info about a chat invite", + "desc_ru": "Получить сведения о приглашении в чат." + }, + { + "name": "edit_chat_invite", + "rpc": "messages.editExportedChatInvite", + "namespace": "messages", + "signature": "await ctx.edit_chat_invite(peer: InputPeer, link: string)", + "returns": "Any", + "params": [ + { + "name": "revoked", + "type": "flags.2?true", + "required": false, + "default": null + }, + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "link", + "type": "string", + "required": true, + "default": null + }, + { + "name": "expire_date", + "type": "flags.0?int", + "required": false, + "default": null + }, + { + "name": "usage_limit", + "type": "flags.1?int", + "required": false, + "default": null + }, + { + "name": "request_needed", + "type": "flags.3?Bool", + "required": false, + "default": null + }, + { + "name": "title", + "type": "flags.4?string", + "required": false, + "default": null + } + ], + "desc_en": "Edit an exported chat invite", + "desc_ru": "Изменить экспортированное приглашение в чат." + }, + { + "name": "purge_revoked_chat_invites", + "rpc": "messages.deleteRevokedExportedChatInvites", + "namespace": "messages", + "signature": "await ctx.purge_revoked_chat_invites(peer: InputPeer, admin_id: InputUser)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "admin_id", + "type": "InputUser", + "required": true, + "default": null + } + ], + "desc_en": "Delete all revoked chat invites", + "desc_ru": "Удалить все отозванные приглашения в чаты." + }, + { + "name": "remove_chat_invite", + "rpc": "messages.deleteExportedChatInvite", + "namespace": "messages", + "signature": "await ctx.remove_chat_invite(peer: InputPeer, link: string)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "link", + "type": "string", + "required": true, + "default": null + } + ], + "desc_en": "Delete a chat invite", + "desc_ru": "Удалить приглашение в чат." + }, + { + "name": "invite_admins", + "rpc": "messages.getAdminsWithInvites", + "namespace": "messages", + "signature": "await ctx.invite_admins(peer: InputPeer)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + } + ], + "desc_en": "Get info about chat invites generated by admins.", + "desc_ru": "Получить сведения о приглашениях в чат, созданных администраторами." + }, + { + "name": "invite_joiners", + "rpc": "messages.getChatInviteImporters", + "namespace": "messages", + "signature": "await ctx.invite_joiners(peer: InputPeer, offset_date: int, offset_user: InputUser, limit: int)", + "returns": "Any", + "params": [ + { + "name": "requested", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "subscription_expired", + "type": "flags.3?true", + "required": false, + "default": null + }, + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "link", + "type": "flags.1?string", + "required": false, + "default": null + }, + { + "name": "q", + "type": "flags.2?string", + "required": false, + "default": null + }, + { + "name": "offset_date", + "type": "int", + "required": false, + "default": null + }, + { + "name": "offset_user", + "type": "InputUser", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + } + ], + "desc_en": "Get info about the users that joined the chat using a specific chat invite", + "desc_ru": "Получить сведения о пользователях, присоединившихся к чату по конкретному приглашению." + }, + { + "name": "resolve_join_request", + "rpc": "messages.hideChatJoinRequest", + "namespace": "messages", + "signature": "await ctx.resolve_join_request(peer: InputPeer, user_id: InputUser)", + "returns": "Any", + "params": [ + { + "name": "approved", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "user_id", + "type": "InputUser", + "required": true, + "default": null + } + ], + "desc_en": "Dismiss or approve a chat join request related to a specific chat or channel.", + "desc_ru": "Отклонить или одобрить заявку на вступление в чат или канал." + }, + { + "name": "resolve_all_join_requests", + "rpc": "messages.hideAllChatJoinRequests", + "namespace": "messages", + "signature": "await ctx.resolve_all_join_requests(peer: InputPeer)", + "returns": "Any", + "params": [ + { + "name": "approved", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "link", + "type": "flags.1?string", + "required": false, + "default": null + } + ], + "desc_en": "Dismiss or approve all join requests related to a specific chat or channel.", + "desc_ru": "Отклонить или одобрить все заявки на вступление в чат или канал." + }, + { + "name": "channel_statistics", + "rpc": "stats.getBroadcastStats", + "namespace": "stats", + "signature": "await ctx.channel_statistics(channel: InputChannel)", + "returns": "Any", + "params": [ + { + "name": "dark", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + } + ], + "desc_en": "Get channel statistics", + "desc_ru": "Получить статистику канала." + }, + { + "name": "supergroup_statistics", + "rpc": "stats.getMegagroupStats", + "namespace": "stats", + "signature": "await ctx.supergroup_statistics(channel: InputChannel)", + "returns": "Any", + "params": [ + { + "name": "dark", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + } + ], + "desc_en": "Get supergroup statistics", + "desc_ru": "Получить статистику супергруппы." + }, + { + "name": "message_statistics", + "rpc": "stats.getMessageStats", + "namespace": "stats", + "signature": "await ctx.message_statistics(channel: InputChannel, msg_id: int)", + "returns": "Any", + "params": [ + { + "name": "dark", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "msg_id", + "type": "int", + "required": true, + "default": null + } + ], + "desc_en": "Get message statistics", + "desc_ru": "Получить статистику сообщения." + }, + { + "name": "message_public_forwards", + "rpc": "stats.getMessagePublicForwards", + "namespace": "stats", + "signature": "await ctx.message_public_forwards(channel: InputChannel, msg_id: int, offset: string, limit: int)", + "returns": "Any", + "params": [ + { + "name": "channel", + "type": "InputChannel", + "required": false, + "default": "$peer" + }, + { + "name": "msg_id", + "type": "int", + "required": true, + "default": null + }, + { + "name": "offset", + "type": "string", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + } + ], + "desc_en": "Obtains a list of messages, indicating to which other public channels was a channel message forwarded. Will return a list of messages with peer_id equal to the public channel to which this message was forwarded.", + "desc_ru": "Получить список сообщений с указанием, в какие другие публичные каналы было переслано сообщение канала. В списке peer_id равен публичному каналу-получателю." + }, + { + "name": "story_statistics", + "rpc": "stats.getStoryStats", + "namespace": "stats", + "signature": "await ctx.story_statistics(peer: InputPeer, id: int)", + "returns": "Any", + "params": [ + { + "name": "dark", + "type": "flags.0?true", + "required": false, + "default": null + }, + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "id", + "type": "int", + "required": false, + "default": "$message" + } + ], + "desc_en": "Get statistics for a certain story.", + "desc_ru": "Получить статистику конкретной истории." + }, + { + "name": "story_public_forwards", + "rpc": "stats.getStoryPublicForwards", + "namespace": "stats", + "signature": "await ctx.story_public_forwards(peer: InputPeer, id: int, offset: string, limit: int)", + "returns": "Any", + "params": [ + { + "name": "peer", + "type": "InputPeer", + "required": false, + "default": "$peer" + }, + { + "name": "id", + "type": "int", + "required": false, + "default": "$message" + }, + { + "name": "offset", + "type": "string", + "required": false, + "default": null + }, + { + "name": "limit", + "type": "int", + "required": false, + "default": null + } + ], + "desc_en": "Obtain forwards of a story as a message to public chats and reposts by public channels.", + "desc_ru": "Получить пересылки истории в публичные чаты и репосты публичными каналами." + } +]; diff --git a/src/data/content.js b/src/data/content.js deleted file mode 100644 index 0866aec..0000000 --- a/src/data/content.js +++ /dev/null @@ -1,458 +0,0 @@ -import { DOCS_EN, DOCS_RU } from './docs.js'; - -export const CONTENT = { - en: { - nav: { - overview: "Overview", - architecture: "Architecture", - modules: "Modules", - docs: "Documentation", - skill: "Agent Skill", - github: "GitHub", - install: "Install", - downloadSkill: "Get Skill (.md)", - }, - hero: { - badge: "SECURITY-FIRST TELEGRAM USERBOT", - title: "HOTARU", - subtitle: "A modern Telegram userbot built on GoyGram with Linux namespace isolation and strict capability sandboxing.", - installTitle: "Interactive one-line installation:", - copyTooltip: "Copy command", - copiedTooltip: "Copied to clipboard", - ctaDocs: "Explore Documentation", - ctaSkill: "Download Agent Skill", - ctaGithub: "View Source Code", - metrics: [ - { label: "Core Engine", value: "GoyGram 0.8.28" }, - { label: "Runtime", value: "Python 3.13+" }, - { label: "Isolation", value: "Linux Namespaces" }, - { label: "Vault", value: "AES-GCM Encrypted" }, - ], - }, - architecture: { - sectionTitle: "Security Architecture", - sectionSubtitle: "Hotaru eliminates attack vectors common in userbots by running untrusted third-party code in unprivileged namespaces.", - cards: [ - { - id: "namespaces", - title: "Linux Namespace Sandboxing", - tag: "OS Containment", - description: "Every .hmod module executes inside isolated CLONE_NEWNS, CLONE_NEWIPC, CLONE_NEWUTS, and CLONE_NEWNET namespaces. Processes run as unprivileged user nobody (UID 65534) with an ephemeral tmpfs root. An untrusted script cannot inspect host files, credentials, or parent memory.", - }, - { - id: "capabilities", - title: "Capability Privilege Model", - tag: "Relay Firewall", - description: "Modules explicitly declare required capabilities: mt for Telegram MTProto RPC, state for scoped key-value storage, and net for outbound network connections. If net is not declared, the kernel network namespace blocks raw sockets at the kernel boundary.", - }, - { - id: "vault", - title: "Encrypted Master Vault", - tag: "AES-GCM", - description: "Telegram auth keys, session strings, and runtime state are kept in an encrypted SQLite vault (sanctuary/hotaru.vault) with key derivation and automatic backup rotation. Sensitive credentials never leak into module environments.", - }, - { - id: "goygram", - title: "GoyGram Core Transport", - tag: "Native Rust MTProto", - description: "Hotaru combines an asynchronous Python event loop with GoyGram native Rust cryptography for MTProto serialization and payload encryption, achieving low latency and reduced memory overhead.", - }, - { - id: "singularity", - title: "Singularity Web Dashboard", - tag: "Mini App UI", - description: "An embedded web dashboard runs locally on Node.js and Vite, providing metrics, logs, and live module configuration. It connects through Cloudflare Horizon tunnels to function as a native Telegram Mini App.", - }, - { - id: "shield", - title: "Shield FloodWait Guard", - tag: "Rate Monitoring", - description: "A sliding-window rate tracking engine monitors Telegram API request frequency. When approaching limits, it pauses outbound calls locally to prevent account bans and temporary flood restrictions.", - }, - ], - }, - modules: { - sectionTitle: "Module Ecosystem (.hmod)", - sectionSubtitle: "Modules are standard Python 3.13 scripts declaring capabilities, command callbacks, and localized lexicons.", - tabs: [ - { - id: "qr", - title: "QR Generator (Net)", - code: `from __future__ import annotations -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from hotaru.response import ModuleContext - -async def qr_cmd(ctx: ModuleContext) -> None: - text = ctx.raw_args.strip() - if not text: - await ctx.respond(ctx.t("missing_text")) - return - url = f"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data={text}" - response = await ctx.net(url) - await ctx.reply_photo(response.content, caption=ctx.t("generated")) - -HOTARU = { - "id": "qr_tool", - "name": "QR Generator", - "version": "1.0.0", - "about": "Renders high resolution QR codes directly in chat.", - "commands": { - "qr": qr_cmd, - }, - "capabilities": ["mt", "net"], - "lexicon": { - "en": { - "missing_text": "Please provide text or a URL after .qr", - "generated": "Here is your generated QR code.", - }, - "ru": { - "missing_text": "Укажите текст или ссылку после .qr", - "generated": "Ваш QR-код успешно сгенерирован.", - }, - }, -}`, - }, - { - id: "notes", - title: "Encrypted Notes (State)", - code: `from __future__ import annotations -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from hotaru.response import ModuleContext - -async def notes_cmd(ctx: ModuleContext) -> None: - args = ctx.args - if not args: - items = ctx.state.get("notes", {}) - if not items: - await ctx.respond(ctx.t("empty")) - return - lines = [f"• {k}: {v}" for k, v in items.items()] - await ctx.respond("\\n".join(lines)) - return - - sub, name = args[0].lower(), args[1] if len(args) > 1 else "" - items = dict(ctx.state.get("notes", {})) - if sub == "set" and len(args) >= 3: - items[name] = " ".join(args[2:]) - ctx.state.set("notes", items) - await ctx.respond(ctx.t("saved", name=name)) - elif sub == "del" and name in items: - del items[name] - ctx.state.set("notes", items) - await ctx.respond(ctx.t("deleted", name=name)) - -HOTARU = { - "id": "notes", - "name": "Notes Storage", - "version": "1.0.0", - "about": "Persistent note storage using module-scoped state.", - "commands": {"notes": notes_cmd}, - "capabilities": ["mt", "state"], - "lexicon": { - "en": { - "empty": "No notes stored. Use .notes set [name] [text]", - "saved": "Note {name} saved.", - "deleted": "Note {name} deleted.", - }, - "ru": { - "empty": "Заметок нет. Используйте .notes set [имя] [текст]", - "saved": "Заметка {name} сохранена.", - "deleted": "Заметка {name} удалена.", - }, - }, -}`, - }, - { - id: "screen", - title: "Interactive Screen Form", - code: `from __future__ import annotations -from hotaru.screens import Screen -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from hotaru.response import ModuleContext - -async def menu_cmd(ctx: ModuleContext) -> None: - rows = [ - [ - {"text": "Option A", "callback": on_option_a}, - {"text": "Option B", "callback": on_option_b}, - ], - [ - {"text": "Close Menu", "action": "close"}, - ] - ] - screen = Screen( - text="Interactive Form\\nSelect an option below:", - rows=rows, - rich=True, - ) - await ctx.screens.show(screen) - -HOTARU = { - "id": "interactive_menu", - "commands": {"menu": menu_cmd}, - "capabilities": ["mt"], -}`, - }, - ], - }, - docs: { - searchPlaceholder: "Search developer reference & ctx methods...", - tocTitle: "Table of Contents", - sections: DOCS_EN, - }, - skill: { - badge: "AI CODING ASSISTANT SKILL", - title: "Hotaru Agent Skill (SKILL.md)", - subtitle: "A comprehensive instruction manual for Antigravity, Claude Code, Cursor, and ChatGPT agents to write correct, secure .hmod modules.", - downloadBtn: "Download SKILL.md", - previewBtn: "View Specification", - features: [ - "Complete manifest schema with typed definitions", - "Every ModuleContext method, signature, and parameter", - "Zero-comments rule enforcement for Python code", - "Linux namespace sandbox compliance patterns", - "Ready-to-use production module templates", - ], - }, - footer: { - copyright: "Hotaru Project. Open-source software released under the MIT License.", - docsLink: "Documentation", - githubHotaru: "Hotaru Core", - githubWeb: "HotaruWeb", - telegramCommunity: "Telegram", - }, - }, - ru: { - nav: { - overview: "Обзор", - architecture: "Архитектура", - modules: "Модули", - docs: "Документация", - skill: "Agent Skill", - github: "GitHub", - install: "Установка", - downloadSkill: "Скачать Skill", - }, - hero: { - badge: "SECURITY-FIRST TELEGRAM ЮЗЕРБОТ", - title: "HOTARU", - subtitle: "Telegram юзербот с архитектурой security-first на базе GoyGram, изоляцией в Linux namespaces и строгой моделью capabilities.", - installTitle: "Быстрая установка одной командой:", - copyTooltip: "Скопировать команду", - copiedTooltip: "Скопировано в буфер", - ctaDocs: "Перейти к документации", - ctaSkill: "Скачать Agent Skill", - ctaGithub: "Исходный код", - metrics: [ - { label: "Ядро MTProto", value: "GoyGram 0.8.28" }, - { label: "Среда", value: "Python 3.13+" }, - { label: "Изоляция", value: "Linux Namespaces" }, - { label: "Хранилище", value: "AES-GCM Vault" }, - ], - }, - architecture: { - sectionTitle: "Архитектура безопасности", - sectionSubtitle: "Hotaru исключает типичные векторы атак в юзерботах, изолируя сторонний код модулей в непривилегированных пространствах имён.", - cards: [ - { - id: "namespaces", - title: "Песочница Linux Namespaces", - tag: "Изоляция ОС", - description: "Каждый модуль .hmod исполняется в изолированных пространствах имён CLONE_NEWNS, CLONE_NEWIPC, CLONE_NEWUTS и CLONE_NEWNET. Процессы запускаются от непривилегированного пользователя nobody (UID 65534) с временным tmpfs. Недоверенный код не может читать файлы хоста, сессии или память ядра.", - }, - { - id: "capabilities", - title: "Модель прав Capabilities", - tag: "Сетевой фаервол", - description: "Модули явно декларируют требуемые разрешения: mt для Telegram MTProto RPC, state для изолированного хранилища и net для сетевых подключений. Если net не указан, сетевой стек блокирует сокеты на уровне ядра Linux.", - }, - { - id: "vault", - title: "Шифрованное хранилище Vault", - tag: "AES-GCM", - description: "Ключи авторизации Telegram, сессионные строки и состояние хранятся в зашифрованной SQLite базе (sanctuary/hotaru.vault) с автоматической ротацией ключей и резервным копированием. Секреты никогда не попадают в окружение модулей.", - }, - { - id: "goygram", - title: "Движок GoyGram MTProto", - tag: "Rust MTProto криптография", - description: "Hotaru объединяет асинхронный цикл Python с нативной Rust-криптографией GoyGram для сериализации MTProto сообщений и шифрования пакетов, обеспечивая минимальную задержку и низкое потребление памяти.", - }, - { - id: "singularity", - title: "Веб-панель Singularity", - tag: "Telegram Mini App", - description: "Встроенная веб-панель работает локально на Node.js и Vite, отображая метрики, логи и управление модулями. Подключается через туннели Cloudflare Horizon и доступна как нативный Telegram Mini App.", - }, - { - id: "shield", - title: "Защита Shield FloodWait", - tag: "Контроль лимитов", - description: "Модуль Shield отслеживает частоту запросов к API Telegram в скользящем окне. При приближении к лимитам вызовы локально приостанавливаются, защищая аккаунт от банов и флудвейтов.", - }, - ], - }, - modules: { - sectionTitle: "Экосистема модулей (.hmod)", - sectionSubtitle: "Модули представляют собой стандартные скрипты Python 3.13 с объявлением прав, обработчиков команд и многоязычного лексикона.", - tabs: [ - { - id: "qr", - title: "Генератор QR (Net)", - code: `from __future__ import annotations -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from hotaru.response import ModuleContext - -async def qr_cmd(ctx: ModuleContext) -> None: - text = ctx.raw_args.strip() - if not text: - await ctx.respond(ctx.t("missing_text")) - return - url = f"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data={text}" - response = await ctx.net(url) - await ctx.reply_photo(response.content, caption=ctx.t("generated")) - -HOTARU = { - "id": "qr_tool", - "name": "QR Generator", - "version": "1.0.0", - "about": "Генерация QR-кодов прямо в чате.", - "commands": { - "qr": qr_cmd, - }, - "capabilities": ["mt", "net"], - "lexicon": { - "en": { - "missing_text": "Please provide text or a URL after .qr", - "generated": "Here is your generated QR code.", - }, - "ru": { - "missing_text": "Укажите текст или ссылку после .qr", - "generated": "Ваш QR-код успешно сгенерирован.", - }, - }, -}`, - }, - { - id: "notes", - title: "Заметки (Хранилище State)", - code: `from __future__ import annotations -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from hotaru.response import ModuleContext - -async def notes_cmd(ctx: ModuleContext) -> None: - args = ctx.args - if not args: - items = ctx.state.get("notes", {}) - if not items: - await ctx.respond(ctx.t("empty")) - return - lines = [f"• {k}: {v}" for k, v in items.items()] - await ctx.respond("\\n".join(lines)) - return - - sub, name = args[0].lower(), args[1] if len(args) > 1 else "" - items = dict(ctx.state.get("notes", {})) - if sub == "set" and len(args) >= 3: - items[name] = " ".join(args[2:]) - ctx.state.set("notes", items) - await ctx.respond(ctx.t("saved", name=name)) - elif sub == "del" and name in items: - del items[name] - ctx.state.set("notes", items) - await ctx.respond(ctx.t("deleted", name=name)) - -HOTARU = { - "id": "notes", - "name": "Заметки", - "version": "1.0.0", - "about": "Хранение заметок в изолированном пространстве модуля.", - "commands": {"notes": notes_cmd}, - "capabilities": ["mt", "state"], - "lexicon": { - "en": { - "empty": "No notes stored. Use .notes set [name] [text]", - "saved": "Note {name} saved.", - "deleted": "Note {name} deleted.", - }, - "ru": { - "empty": "Заметок нет. Используйте .notes set [имя] [текст]", - "saved": "Заметка {name} сохранена.", - "deleted": "Заметка {name} удалена.", - }, - }, -}`, - }, - { - id: "screen", - title: "Интерактивная экранная форма", - code: `from __future__ import annotations -from hotaru.screens import Screen -from typing import TYPE_CHECKING - -if TYPE_CHECKING: - from hotaru.response import ModuleContext - -async def menu_cmd(ctx: ModuleContext) -> None: - rows = [ - [ - {"text": "Пункт А", "callback": on_option_a}, - {"text": "Пункт Б", "callback": on_option_b}, - ], - [ - {"text": "Закрыть меню", "action": "close"}, - ] - ] - screen = Screen( - text="Интерактивная форма\\nВыберите действие:", - rows=rows, - rich=True, - ) - await ctx.screens.show(screen) - -HOTARU = { - "id": "interactive_menu", - "commands": {"menu": menu_cmd}, - "capabilities": ["mt"], -}`, - }, - ], - }, - docs: { - searchPlaceholder: "Поиск по документации и методам ctx...", - tocTitle: "Содержание", - sections: DOCS_RU, - }, - skill: { - badge: "SKILL ДЛЯ AI-АГЕНТОВ", - title: "Hotaru Agent Skill (SKILL.md)", - subtitle: "Полная инструкция для агентов Antigravity, Claude Code, Cursor и ChatGPT для безошибочного создания модулей .hmod.", - downloadBtn: "Скачать SKILL.md", - previewBtn: "Открыть спецификацию", - features: [ - "Полная схема манифеста с типизированными определениями", - "Каждый метод ModuleContext с сигнатурами и аргументами", - "Соблюдение правила отсутствия комментариев в коде", - "Соответствие требованиям песочницы Linux Namespaces", - "Готовые шаблоны модулей для продакшена", - ], - }, - footer: { - copyright: "Hotaru Project. Открытое программное обеспечение под лицензией MIT.", - docsLink: "Документация", - githubHotaru: "Hotaru Core", - githubWeb: "HotaruWeb", - telegramCommunity: "Telegram", - }, - }, -}; diff --git a/src/data/content.jsx b/src/data/content.jsx new file mode 100644 index 0000000..7b65a8c --- /dev/null +++ b/src/data/content.jsx @@ -0,0 +1,54 @@ +import { DOCS_EN, DOCS_RU } from './docs.jsx'; + +export const CONTENT = { + en: { + nav: { + docs: 'Docs', + downloadSkill: 'Download skill', + }, + hero: { + title: 'Hotaru', + subtitle: 'Documentation for writing modules for Hotaru userbot', + ctaDocs: 'Open docs', + ctaSkill: 'Download skill', + }, + docs: { + title: 'Developer manual', + subtitle: 'How to write a .hmod and run it in Telegram.', + searchPlaceholder: 'Search the guide and the methods', + tocTitle: 'Chapters', + sections: DOCS_EN, + }, + footer: { + copyright: 'Hotaru Project. AGPL-3.0.', + githubHotaru: 'Hotaru', + githubWeb: 'HotaruWeb', + telegramCommunity: 'Telegram', + }, + }, + ru: { + nav: { + docs: 'Документация', + downloadSkill: 'Скачать скилл', + }, + hero: { + title: 'Hotaru', + subtitle: 'Документация по написанию модулей для юзербота Hotaru', + ctaDocs: 'Открыть документацию', + ctaSkill: 'Скачать скилл', + }, + docs: { + title: 'Руководство разработчика', + subtitle: 'Как написать .hmod и запустить его в Telegram.', + searchPlaceholder: 'Поиск по руководству и методам', + tocTitle: 'Главы', + sections: DOCS_RU, + }, + footer: { + copyright: 'Hotaru Project. AGPL-3.0.', + githubHotaru: 'Hotaru', + githubWeb: 'HotaruWeb', + telegramCommunity: 'Telegram', + }, + }, +}; diff --git a/src/data/docs.js b/src/data/docs.js deleted file mode 100644 index 4e7812c..0000000 --- a/src/data/docs.js +++ /dev/null @@ -1,173 +0,0 @@ -export const DOCS_EN = [ - { - "id": "architecture", - "title": "1. Core Architecture & Linux Namespace Isolation", - "summary": "Deep architectural specification of Hotaru, GoyGram MTProto core, and Linux namespace sandbox containment.", - "content": "Hotaru is a security-first Telegram userbot operating from a primary user account. Unlike legacy userbot platforms that load third-party scripts directly into the interpreter alongside Telegram authentication sessions, Hotaru enforces process isolation and hardware-assisted capability sandboxing.\n\n### Subsystem Topology\n\nThe Hotaru repository is divided into four distinct security tiers:\n\n1. hotaru/ (Kernel Core):\nThe privileged supervisor managing account sessions, the encrypted master vault (AES-GCM), event dispatching, command registries, and interactive screen rendering. It never executes unverified third-party code in its process space.\n\n2. relay/ (Capability Firewall):\nThe security boundary mediating all communication between external modules and the Telegram MTProto transport. The relay contains capability definitions (relay/caps.py), network egress proxies (relay/proxies.py), filesystem isolation gates (relay/files.py), and the RPC denylist (relay/denylist.py).\n\n3. constellations/ (Built-in Modules):\nSystem extensions implemented in the .hmod format (accounts, acl, backups, catalyst, executor, genesis, help, info, logger, power, settings, shield, singularity, translations, updater). Built-in modules are core components and their triggers are reserved.\n\n4. sanctuary/ (Private Runtime State):\nEncrypted user data directory containing session credentials (sanctuary/hotaru.vault), SQLite state databases, and audit logs. This directory is strictly inaccessible to third-party modules.\n\n### Linux Namespace Isolation Model\n\nWhen Hotaru loads a third-party .hmod module, it launches an isolated worker process configured with four Linux kernel namespaces:\n\n• CLONE_NEWNS (Mount Namespace):\nThe worker process receives a private mount table. Critical directories (/root, /home, /etc, /proc/keys, and sanctuary/) are either concealed or mounted read-only. Temporary files reside in an ephemeral tmpfs mount discarded on process exit.\n\n• CLONE_NEWIPC (IPC Namespace):\nIsolates System V IPC and POSIX message queues, preventing shared-memory snooping or signal hijacking between modules.\n\n• CLONE_NEWUTS (Hostname Namespace):\nIsolates UTS system identifiers and hostname information.\n\n• CLONE_NEWNET (Network Namespace):\nIsolates the network stack. Unless a module explicitly declares the 'net' capability in its manifest, its network namespace contains only a down loopback device. Raw socket calls, DNS queries, and HTTP requests fail at the OS syscall boundary with ENETUNREACH or EPERM.\n\n### Privilege Dropping & Syscall Control\n\nBefore executing module code, the worker drops root privileges:\n• Switches effective UID to nobody (65534) and GID to nogroup (65534).\n• Enforces prctl(PR_SET_NO_NEW_PRIVS, 1) to prevent privilege escalation via setuid binaries.\n• Channels all I/O through unidirectional UNIX pipes and typed JSON/TLV RPC serialization." - }, - { - "id": "hmod-specification", - "title": "2. The .hmod Module Specification & Lifecycle", - "summary": "Complete manifest schema, module lifecycle, command dispatch, and task registration.", - "content": "A Hotaru module is a self-contained Python source file ending with the .hmod extension. The runtime loads modules dynamically through the sandboxed runner.\n\n### Manifest Schema: HOTARU Dictionary\n\nEvery .hmod module must expose a top-level module dictionary named HOTARU:\n\n```python\nfrom __future__ import annotations\nfrom typing import TYPE_CHECKING\n\nif TYPE_CHECKING:\n from hotaru.response import ModuleContext\n\nasync def qr_command(ctx: ModuleContext) -> None:\n text = ctx.raw_args.strip()\n if not text:\n await ctx.respond(ctx.t(\"missing_text\"))\n return\n url = f\"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data={text}\"\n response = await ctx.net(url)\n await ctx.reply_photo(response.content, caption=ctx.t(\"generated\"))\n\nHOTARU = {\n \"id\": \"qr_tool\",\n \"name\": \"QR Generator\",\n \"version\": \"1.0.0\",\n \"author\": \"Security Engineering\",\n \"description\": \"Renders high resolution QR codes directly in chat.\",\n \"capabilities\": [\"mt\", \"net\"],\n \"commands\": {\n \"qr\": qr_command,\n },\n \"lexicon\": {\n \"en\": {\n \"missing_text\": \"Please provide text or a URL after .qr\",\n \"generated\": \"Here is your generated QR code.\",\n },\n \"ru\": {\n \"missing_text\": \"Укажите текст или ссылку после .qr\",\n \"generated\": \"Ваш QR-код успешно сгенерирован.\",\n },\n },\n}\n```\n\n### Manifest Fields Reference\n\n• id (str, required): Unique lowercase identifier containing alphanumeric characters and underscores (e.g. 'qr_tool', 'notes_mgr', 'crypto_ticker').\n• name (str, required): Human-readable display name.\n• version (str, required): Semantic version string (MAJOR.MINOR.PATCH).\n• author (str, optional): Author handle or organization.\n• description (str, optional): Functional summary of the module.\n• capabilities (list[str], required): Set of hardware and network capabilities requested by the module.\n• commands (dict[str, Callable], required): Mapping of command triggers to asynchronous handler coroutines. Every handler receives ctx: ModuleContext as its single argument.\n• tasks (dict[str, Callable], optional): Long-running background coroutines supervised by the core engine.\n• lexicon (dict[str, dict[str, str]], optional): Localization dictionary supporting 'en', 'ru', 'uk', 'ja', 'kz', and 'zh'.\n\n### Reserved Kernel Triggers\n\nHotaru reserves all command triggers utilized by built-in constellation modules. A third-party module attempting to bind any of the following triggers will fail validation at load time:\naccounts, acl, backups, catalyst, executor, genesis, help, info, logger, power, settings, shield, singularity, translations, updater, ping, dash, restart, config, backup." - }, - { - "id": "capabilities", - "title": "3. Capability System & RPC Firewall", - "summary": "Fine-grained capability gating, MTProto RPC validation, and denylist enforcement.", - "content": "Hotaru adheres to the principle of least privilege. By default, an isolated module has zero permissions: no network egress, no filesystem read or write outside its tmpfs mount, and no direct MTProto invocation.\n\n### Available Capabilities\n\n1. mt:\nGrants mediated access to Telegram MTProto RPC calls via ctx.mt(method, **kwargs) and high-level messaging helpers. All RPC calls are intercepted by relay/firewall.py and verified against relay/denylist.py.\n\n2. net:\nEnables the network namespace egress interface. Allows outgoing HTTP, HTTPS, and TCP socket requests through ctx.net(url) and ctx.stream(host, port). Modules lacking this capability cannot communicate over the Internet.\n\n3. state:\nProvides persistent key-value storage scoped strictly to the module id. Backed by SQLite in a secured namespace. Modules cannot inspect or modify state entries belonging to other modules.\n\n4. files:\nGrants read and write access inside the module's ephemeral tmpfs scratch directory. Path traversal attempts (such as ../../sanctuary) are trapped and terminated with a security exception.\n\n5. accounts:\nAllows read-only introspection of configured userbot accounts via ctx.accounts.\n\n6. screens:\nEnables the interactive UI screen rendering engine (ctx.screens) for terminal and message-based navigation.\n\n### The RPC Denylist\n\nWhen a module with the 'mt' capability issues raw RPC calls, relay/denylist.py evaluates the method name against destructive Telegram operations. The following methods are strictly forbidden:\n\n• Authentication and session revocation:\nauth.logOut, auth.resetAuthorizations, auth.dropTempAuthKeys\n\n• Account destruction:\naccount.deleteAccount\n\n• Two-factor password modification:\naccount.updatePasswordSettings\n\nIf a module attempts to invoke a denylisted method, the relay immediately intercepts the packet, drops the worker process, logs the violation, and revokes all module capabilities." - }, - { - "id": "ctx-properties", - "title": "4. ModuleContext: Complete Properties Catalog", - "summary": "Exhaustive documentation of all properties exposed on ctx, with types, descriptions, and examples.", - "content": "The ModuleContext instance passed to command handlers and background tasks provides real-time event metadata and execution state.\n\n### Properties Reference Table\n\n• ctx.module_id -> str\nReturns the unique identifier of the executing module.\nExample:\nassert ctx.module_id == \"qr_tool\"\n\n• ctx.chat_id -> int\nTelegram ID of the dialog, group, or channel where the command was triggered.\nExample:\nchat = ctx.chat_id\n\n• ctx.sender_id / ctx.user_id -> int | None\nTelegram user ID of the individual who sent the triggering message. Returns None if the message originated from an anonymous channel.\nExample:\nsender = ctx.sender_id or 0\n\n• ctx.topic_id -> int | None\nThread ID when the message is posted inside a forum supergroup topic. Returns None in regular chats.\nExample:\nif ctx.topic_id is not None:\n await ctx.respond(f\"Executed in topic {ctx.topic_id}\")\n\n• ctx.is_me / ctx.out -> bool\nBoolean indicating whether the triggering message was sent by the userbot account itself.\nExample:\nif not ctx.is_me:\n return\n\n• ctx.message -> ModuleMessage\nThe underlying message object containing text, entities, reply references, and raw flags.\nExample:\nraw_id = ctx.message.id\n\n• ctx.has_media -> bool\nEvaluates to True if the triggering message contains an attached photo, video, document, audio, sticker, voice note, or animation.\nExample:\nif not ctx.has_media:\n await ctx.respond(\"Please attach a file.\")\n return\n\n• ctx.media / ctx.attachment -> Attachment | None\nRepresents the media payload attached to the current message. Exposes .file_id, .size, .mime_type, and .filename.\nExample:\nif ctx.attachment:\n size_mb = ctx.attachment.size / (1024 * 1024)\n\n• ctx.reply_message -> ModuleMessage | None\nIf the command was executed in reply to another message, returns that referenced message. Otherwise returns None.\nExample:\nif ctx.reply_message:\n target_author = ctx.reply_message.sender_id\n\n• ctx.reply_attachment -> Attachment | None\nThe media attachment present on the replied-to message.\nExample:\nif ctx.reply_attachment:\n data = await ctx.download(ctx.reply_attachment)\n\n• ctx.args -> list[str]\nList of command arguments split by whitespace, excluding the prefix and command trigger.\nExample:\nif len(ctx.args) < 2:\n await ctx.respond(\"Usage: .calc \")\n\n• ctx.raw_args -> str\nThe complete, unparsed string following the command trigger. Preserves leading and trailing whitespace.\nExample:\nquery = ctx.raw_args.strip()\n\n• ctx.prefix -> str\nThe specific prefix character used to trigger the command (e.g. '.' or '!').\nExample:\npfx = ctx.prefix\n\n• ctx.uptime -> float\nThe uptime of the Hotaru supervisor process in seconds.\nExample:\nup_hours = ctx.uptime / 3600.0\n\n• ctx.memory / ctx.ram -> int\nThe resident set size (RSS) memory consumption of the worker process in bytes.\nExample:\nmb_used = ctx.memory / (1024 * 1024)\n\n• ctx.version -> str\nThe Hotaru core version string.\nExample:\ncurrent_ver = ctx.version\n\n• ctx.is_stopping -> bool\nFlag indicating whether the userbot has initiated shutdown. Checked by background tasks to perform graceful cleanup.\nExample:\nwhile not ctx.is_stopping:\n await asyncio.sleep(1)" - }, - { - "id": "ctx-messaging", - "title": "5. ModuleContext: Messaging & Editing Methods", - "summary": "Every single messaging method: exact parameters, types, defaults, returns, errors, and snippets.", - "content": "ModuleContext provides methods to create, edit, forward, react to, and delete messages.\n\n### ctx.reply\nSignature:\n`await ctx.reply(text: str, *, parse_mode: str = \"html\", link_preview: bool = False, silent: bool = False, schedule_date: int | None = None) -> ModuleMessage`\nDescription:\nSends a message into the current chat in explicit reply to the triggering message.\nParameters:\n• text (str): The body text to transmit.\n• parse_mode (str): Entity parser ('html', 'md', or None). Defaults to 'html'.\n• link_preview (bool): Enables or disables rich URL preview cards.\n• silent (bool): Delivers the notification without sound.\n• schedule_date (int | None): Unix timestamp for scheduled delivery.\nReturns:\nModuleMessage instance of the sent message.\nExceptions:\nRaises TelegramError on flood wait or chat restrictions.\nExample:\n```python\nawait ctx.reply(\"Calculation result: 42\", parse_mode=\"html\")\n```\n\n### ctx.respond\nSignature:\n`await ctx.respond(text: str, *, parse_mode: str = \"html\", link_preview: bool = False) -> ModuleMessage`\nDescription:\nIf the triggering message was sent by the userbot account (ctx.is_me is True), edits that message in place. If the message was sent by another user, sends a fresh reply.\nReturns:\nModuleMessage instance.\nExample:\n```python\nmsg = await ctx.respond(\"Processing dataset...\")\nawait msg.edit(\"Processing complete.\")\n```\n\n### ctx.edit\nSignature:\n`await ctx.edit(text: str, *, parse_mode: str = \"html\", link_preview: bool = False) -> ModuleMessage`\nDescription:\nEdits the content of the triggering message. Fails if the message was not authored by the userbot.\nExceptions:\nRaises PermissionError if ctx.is_me is False.\nExample:\n```python\nawait ctx.edit(\"Status: Updated\")\n```\n\n### ctx.delete\nSignature:\n`await ctx.delete(*, revoke: bool = True) -> bool`\nDescription:\nDeletes the triggering message.\nParameters:\n• revoke (bool): When True, deletes the message for all chat participants.\nReturns:\nbool indicating success.\nExample:\n```python\nawait ctx.delete(revoke=True)\n```\n\n### ctx.pin\nSignature:\n`await ctx.pin(*, silent: bool = False, unpin_both: bool = False) -> bool`\nDescription:\nPins the triggering message in the current chat.\nExample:\n```python\nawait ctx.pin(silent=True)\n```\n\n### ctx.unpin\nSignature:\n`await ctx.unpin() -> bool`\nDescription:\nUnpins the triggering message.\nExample:\n```python\nawait ctx.unpin()\n```\n\n### ctx.react\nSignature:\n`await ctx.react(emoji: str, *, big: bool = False) -> bool`\nDescription:\nApplies an emoji reaction to the triggering message.\nParameters:\n• emoji (str): Unicode emoji character (e.g. '🔥', '👍', '❤️').\n• big (bool): Displays full-screen reaction animation.\nExample:\n```python\nawait ctx.react(\"🔥\", big=True)\n```\n\n### ctx.unreact\nSignature:\n`await ctx.unreact() -> bool`\nDescription:\nRemoves any previously set reaction by the userbot on the current message.\nExample:\n```python\nawait ctx.unreact()\n```\n\n### ctx.forward_to\nSignature:\n`await ctx.forward_to(target_chat_id: int, *, silent: bool = False) -> ModuleMessage`\nDescription:\nForwards the triggering message to the specified target chat or user.\nExample:\n```python\nawait ctx.forward_to(123456789, silent=True)\n```\n\n### ctx.copy_to\nSignature:\n`await ctx.copy_to(target_chat_id: int, *, caption: str | None = None) -> ModuleMessage`\nDescription:\nSends a duplicate copy of the triggering message without the forwarded header.\nExample:\n```python\nawait ctx.copy_to(123456789, caption=\"Copied snippet\")\n```\n\n### ctx.save\nSignature:\n`await ctx.save() -> ModuleMessage`\nDescription:\nForwards the message directly to Saved Messages ('me').\nExample:\n```python\nawait ctx.save()\n```\n\n### ctx.typing\nSignature:\n`await ctx.typing(action: str = \"typing\") -> None`\nDescription:\nSends a chat action notification to indicate activity.\nSupported actions: 'typing', 'upload_photo', 'record_video', 'upload_video', 'record_audio', 'upload_audio', 'upload_document', 'choose_sticker'.\nExample:\n```python\nawait ctx.typing(\"upload_document\")\n```\n\n### ctx.read & ctx.mark_read\nSignature:\n`await ctx.read() -> bool`\nDescription:\nMarks all incoming messages in the current dialog up to the current message as read.\nExample:\n```python\nawait ctx.read()\n```" - }, - { - "id": "ctx-media", - "title": "6. ModuleContext: Media & File Operations", - "summary": "Complete signatures, parameters, return types, error cases, and examples for media transmission.", - "content": "Hotaru handles media upload, transmission, and download through high-level streaming helpers that bypass disk storage when operating with memory buffers.\n\n### ctx.send_file & ctx.reply_file\nSignature:\n`await ctx.reply_file(file: bytes | str | BinaryIO, *, caption: str | None = None, force_document: bool = False, filename: str | None = None) -> ModuleMessage`\nDescription:\nTransmits an arbitrary binary payload, local file, or memory stream as a file attachment.\nParameters:\n• file: Raw bytes, string path, or file-like object.\n• caption: Optional descriptive text.\n• force_document: Forces document delivery even for photos or audio.\n• filename: Explicit filename when transmitting raw bytes.\nExample:\n```python\ndata = b\"ID,Name\\n1,Alpha\\n2,Beta\"\nawait ctx.reply_file(data, filename=\"report.csv\", caption=\"Weekly Export\")\n```\n\n### ctx.send_photo & ctx.reply_photo\nSignature:\n`await ctx.reply_photo(photo: bytes | str | BinaryIO, *, caption: str | None = None, parse_mode: str = \"html\") -> ModuleMessage`\nDescription:\nSends a JPEG, PNG, or WEBP image formatted as a compressed Telegram photo.\nExample:\n```python\nwith open(\"chart.png\", \"rb\") as f:\n await ctx.reply_photo(f.read(), caption=\"System Metrics\")\n```\n\n### ctx.send_video & ctx.reply_video\nSignature:\n`await ctx.reply_video(video: bytes | str | BinaryIO, *, caption: str | None = None, duration: int | None = None, width: int | None = None, height: int | None = None) -> ModuleMessage`\nDescription:\nTransmits an MP4 or MOV video container with dimensions and playback duration metadata.\nExample:\n```python\nawait ctx.reply_video(\"capture.mp4\", duration=14, caption=\"Recorded stream\")\n```\n\n### ctx.send_audio & ctx.reply_audio\nSignature:\n`await ctx.reply_audio(audio: bytes | str | BinaryIO, *, caption: str | None = None, duration: int | None = None, performer: str | None = None, title: str | None = None) -> ModuleMessage`\nDescription:\nTransmits an MP3, FLAC, or OGG music track with track title and performer tags.\nExample:\n```python\nawait ctx.reply_audio(audio_data, title=\"Synthesized Wave\", performer=\"Hotaru\")\n```\n\n### ctx.send_voice & ctx.reply_voice\nSignature:\n`await ctx.reply_voice(voice: bytes | str | BinaryIO, *, caption: str | None = None, duration: int | None = None) -> ModuleMessage`\nDescription:\nTransmits an Opus-encoded audio stream as a voice waveform note.\nExample:\n```python\nawait ctx.reply_voice(opus_bytes, duration=5)\n```\n\n### ctx.send_animation & ctx.reply_animation\nSignature:\n`await ctx.reply_animation(animation: bytes | str | BinaryIO, *, caption: str | None = None) -> ModuleMessage`\nDescription:\nTransmits a silent looping MP4 or GIF file as an in-chat animated sticker.\nExample:\n```python\nawait ctx.reply_animation(\"radar.mp4\")\n```\n\n### ctx.send_dice & ctx.reply_dice\nSignature:\n`await ctx.reply_dice(emoji: str = \"🎲\") -> ModuleMessage`\nDescription:\nRolls an animated Telegram dice. Supported emojis: '🎲', '🎯', '🏀', '⚽', '🎳', '🎰'.\nExample:\n```python\nawait ctx.reply_dice(\"🎯\")\n```\n\n### ctx.edit_media\nSignature:\n`await ctx.edit_media(media: bytes | str | BinaryIO, *, caption: str | None = None, parse_mode: str = \"html\") -> ModuleMessage`\nDescription:\nReplaces the media attachment of an existing message without re-sending the message entity.\nExample:\n```python\nawait ctx.edit_media(updated_chart_bytes, caption=\"Updated at 12:00 UTC\")\n```\n\n### ctx.edit_caption\nSignature:\n`await ctx.edit_caption(caption: str, *, parse_mode: str = \"html\") -> ModuleMessage`\nDescription:\nUpdates the text caption of an existing media message without re-uploading the underlying file.\nExample:\n```python\nawait ctx.edit_caption(\"Archived capture\")\n```\n\n### ctx.download & ctx.download_media\nSignature:\n`await ctx.download(attachment: Attachment | None = None, destination: str | None = None) -> bytes | str`\nDescription:\nDownloads the attachment associated with the triggering message or replied message. If destination is provided, streams the file to disk and returns the string path. If destination is None, buffers the complete file into memory and returns bytes.\nExample:\n```python\nif ctx.reply_attachment:\n file_bytes = await ctx.download(ctx.reply_attachment)\n assert isinstance(file_bytes, bytes)\n```" - }, - { - "id": "ctx-buttons-polls", - "title": "7. ModuleContext: Buttons, Polls & Checklists", - "summary": "Declarative inline buttons, interactive polls, checklists, and vote inspection.", - "content": "Hotaru enables deep interaction with inline buttons, Telegram polls, and native checklists.\n\n### Inline Button Operations\n\n• ctx.buttons -> list[list[MessageButton]]\nMatrix of inline buttons present on the triggering message. Each button exposes .text, .data, and .url.\n\n• ctx.button_count -> int\nTotal count of inline buttons on the message.\n\n• await ctx.click(row: int, col: int) -> Any\nSimulates tapping an inline button at the specified matrix coordinate.\n\n• await ctx.click_button(text: str | None = None, data: bytes | None = None) -> Any\nSearches for an inline button matching the label or callback payload and triggers it.\nExample:\n```python\nawait ctx.click_button(text=\"Confirm\")\n```\n\n• await ctx.edit_buttons(buttons: list[list[dict[str, str]]]) -> None\nUpdates or replaces the inline keyboard markup of the current message.\nExample:\n```python\nmarkup = [\n [{\"text\": \"Refresh\", \"data\": \"ref_1\"}, {\"text\": \"Dismiss\", \"data\": \"dis_1\"}]\n]\nawait ctx.edit_buttons(markup)\n```\n\n• await ctx.remove_buttons() -> None\nStrips all inline keyboard buttons from the message while keeping its text intact.\nExample:\n```python\nawait ctx.remove_buttons()\n```\n\n### Native Poll Operations\n\n• await ctx.send_poll(question: str, answers: list[str], *, multiple_choice: bool = False, quiz: bool = False, correct_id: int | None = None) -> ModuleMessage\nSends an interactive poll into the chat.\nParameters:\n• question: The inquiry heading (up to 255 characters).\n• answers: List of 2 to 10 option strings.\n• multiple_choice: Permits selecting multiple answers.\n• quiz: Sets quiz mode requiring a single correct answer.\n• correct_id: Zero-indexed position of the correct answer in quiz mode.\nExample:\n```python\nawait ctx.send_poll(\n \"Choose target deployment region:\",\n [\"Frankfurt\", \"Tokyo\", \"Virginia\"],\n multiple_choice=False,\n)\n```\n\n• await ctx.close_poll() -> Any\nCloses voting on the poll contained in the current message.\nExample:\n```python\nawait ctx.close_poll()\n```\n\n• await ctx.vote(answers: list[int]) -> Any\nCasts a vote on the poll for the specified answer indices.\nExample:\n```python\nawait ctx.vote([0])\n```\n\n• await ctx.retract_vote() -> Any\nRetracts the userbot's cast vote from the poll.\nExample:\n```python\nawait ctx.retract_vote()\n```\n\n• await ctx.get_poll_results() -> dict[str, Any]\nRetrieves aggregated vote totals and percentages for the poll.\n\n### Native Telegram Checklists\n\n• await ctx.send_todo(title: str, items: list[str], *, others_can_append: bool = False, others_can_complete: bool = False) -> ModuleMessage\nTransmits a native Telegram checklist with checkable boxes.\nExample:\n```python\nawait ctx.send_todo(\n \"Deployment Checklist\",\n [\"Run migrations\", \"Flush cache\", \"Verify health check\"],\n others_can_complete=True,\n)\n```\n\n• await ctx.append_todo(items: list[str]) -> Any\nAppends additional task items to an existing checklist message.\nExample:\n```python\nawait ctx.append_todo([\"Verify DNS propagation\"])\n```\n\n• await ctx.set_checklist_completed(completed: list[int], incompleted: list[int]) -> Any\nToggles the checked state of checklist items by index." - }, - { - "id": "ctx-catalog", - "title": "8. Extended Telegram Subsystem Catalog", - "summary": "Deep reference for over 290 wrapped MTProto catalog operations on ctx.", - "content": "The Hotaru relay provides direct access to over 290 granular Telegram methods through ctx. These methods are type-checked, sanitized, and bound to the current peer.\n\n### Forum Topics Management\n\n• await ctx.create_forum_topic(title: str, icon_color: int | None = None, icon_emoji_id: int | None = None) -> Any\nCreates a discussion thread inside a forum supergroup.\nExample:\n```python\ntopic = await ctx.create_forum_topic(\"Incident #402\", icon_color=0x6FB9F0)\n```\n\n• await ctx.edit_forum_topic(topic_id: int, title: str | None = None, closed: bool | None = None) -> Any\nModifies topic title or toggles closed status.\n\n• await ctx.set_forum_topic_pinned(topic_id: int, pinned: bool) -> Any\nPins or unpins a topic in the forum index.\n\n• await ctx.remove_forum_topic(topic_id: int) -> Any\nDeletes a forum topic and its complete message history.\n\n• await ctx.forum_topics(offset_date: int = 0, limit: int = 50) -> Any\nLists forum topics in the current channel.\n\n### Channel Administration\n\n• await ctx.channel_details() -> Any\nFetches metadata, participant count, and description for the current channel.\n\n• await ctx.channel_members(limit: int = 50) -> Any\nRetrieves participant records for the channel.\n\n• await ctx.set_channel_admin(user_id: int, is_admin: bool, rank: str = \"\") -> Any\nPromotes or demotes an administrator with a custom badge title.\n\n• await ctx.restrict_channel_member(user_id: int, send_messages: bool = False) -> Any\nRestricts specific permissions of a member.\n\n• await ctx.channel_admin_log(limit: int = 50) -> Any\nExtracts audit log events including member bans, message deletions, and role changes.\n\n• await ctx.set_slow_mode(seconds: int) -> Any\nConfigures slow mode interval in seconds (0 to disable).\n\n• await ctx.set_antispam(enabled: bool) -> Any\nToggles Telegram native aggressive anti-spam protection.\n\n### Reactions & Scheduled History\n\n• await ctx.configure_chat_reactions(available_reactions: list[str]) -> Any\nRestricts allowed reaction emojis in a group or channel.\n\n• await ctx.scheduled_messages() -> list[Any]\nRetrieves pending scheduled messages in the current chat.\n\n• await ctx.cancel_scheduled(ids: list[int]) -> Any\nCancels and removes scheduled messages by their identifier." - }, - { - "id": "ctx-state-net", - "title": "9. State Storage & Network Stream Engine", - "summary": "Key-value persistent state, sandboxed HTTP client, and raw TCP streaming.", - "content": "Hotaru isolates persistence and network I/O behind dedicated capability proxies.\n\n### Persistent Key-Value State (ctx.state)\n\nRequires capability: 'state'\nState is backed by an encrypted SQLite engine. Keys are scoped strictly to the calling module ID, guaranteeing isolation between modules.\n\nMethods:\n• await ctx.state.get(key: str, default: Any = None) -> Any\nRetrieves the value associated with key. If absent, returns default.\n\n• await ctx.state.set(key: str, value: Any) -> None\nPersists a JSON-serializable value (dict, list, int, float, str, bool).\n\n• await ctx.state.delete(key: str) -> bool\nRemoves key from storage. Returns True if the key existed.\n\n• await ctx.state.clear() -> None\nPurges all key-value entries belonging to this module.\n\n• await ctx.state.all() -> dict[str, Any]\nDumps the entire key-value space of the module.\n\nUsage Example:\n```python\nasync def counter_command(ctx: ModuleContext) -> None:\n current = await ctx.state.get(\"invocations\", 0)\n current += 1\n await ctx.state.set(\"invocations\", current)\n await ctx.respond(f\"Command executed {current} times.\")\n```\n\n### Network Client & TCP Streaming (ctx.net & ctx.stream)\n\nRequires capability: 'net'\nAll egress traffic passes through a proxy gateway enforcing TLS validation and connection rate limiting.\n\n1. HTTP Requests (ctx.net):\nSignature:\n`await ctx.net(url: str, *, method: str = \"GET\", headers: dict[str, str] | None = None, data: bytes | None = None, json: Any | None = None, timeout: float = 10.0) -> HttpResponse`\nProperties on HttpResponse:\n• .status_code (int): HTTP response status code (e.g. 200, 404).\n• .text (str): Decoded unicode response body.\n• .content (bytes): Raw binary response body.\n• .headers (dict[str, str]): HTTP response headers.\n\nUsage Example:\n```python\nasync def weather_command(ctx: ModuleContext) -> None:\n city = ctx.raw_args.strip() or \"London\"\n url = f\"https://wttr.in/{city}?format=j1\"\n response = await ctx.net(url)\n if response.status_code == 200:\n data = json.loads(response.text)\n temp = data[\"current_condition\"][0][\"temp_C\"]\n await ctx.respond(f\"Temperature in {city}: {temp}°C\")\n```\n\n2. Raw TCP Streaming (ctx.stream):\nSignature:\n`stream = await ctx.stream(host: str, port: int, *, ssl: bool = True) -> NetStream`\nMethods on NetStream:\n• await stream.send(data: bytes) -> None\n• await stream.recv(size: int = 4096) -> bytes\n• await stream.close() -> None" - }, - { - "id": "screens", - "title": "10. Interactive Screens, Navigation & Form Engine", - "summary": "Building stateful, interactive menus with buttons, tables, pagers, and input forms.", - "content": "The Hotaru Screens engine (ctx.screens) enables developers to create stateful interactive menus and terminal screens within Telegram messages.\n\n### Screen Components Reference\n\n• await ctx.screens.show(title: str, body: str, *, buttons: list[list[Any]] | None = None, pager: Any | None = None) -> FormHandle\nRenders a structured message screen with header, content body, and inline keyboard controls.\n\n• ctx.screens.button(text: str, callback: Callable[[FormHandle], Awaitable[None]], style: str = \"default\")\nCreates an interactive button bound to an asynchronous callback coroutine.\n\n• ctx.screens.primary(text: str, callback: Callable)\nCreates a visually highlighted primary action button.\n\n• ctx.screens.danger(text: str, callback: Callable)\nCreates a destructive warning button (red accent).\n\n• ctx.screens.success(text: str, callback: Callable)\nCreates an affirmative action button (green accent).\n\n• ctx.screens.pager(current_page: int, total_pages: int, on_page_change: Callable[[int], Awaitable[None]])\nConstructs a pagination bar with previous, index, and next triggers.\n\n• ctx.screens.table(headers: list[str], rows: list[list[str]], page: int = 1, page_size: int = 5) -> str\nRenders an aligned ASCII table formatted for mobile monospaced display.\n\n• ctx.screens.close()\nCreates a dismissal button that cleanly tears down the interactive screen.\n\n### Stateful Navigation Example\n\n```python\nasync def notes_menu(ctx: ModuleContext) -> None:\n notes = await ctx.state.get(\"notes_list\", [])\n\n async def render_view(page: int = 0) -> None:\n items_per_page = 3\n total = max(1, (len(notes) + items_per_page - 1) // items_per_page)\n slice_items = notes[page * items_per_page:(page + 1) * items_per_page]\n \n body_lines = [f\"{i+1}. {item}\" for i, item in enumerate(slice_items)]\n body = \"\\n\".join(body_lines) or \"No notes saved yet.\"\n\n rows = []\n if total > 1:\n pager_row = []\n if page > 0:\n pager_row.append(ctx.screens.button(\"Prev\", lambda h: render_view(page - 1)))\n pager_row.append(ctx.screens.button(f\"{page + 1}/{total}\", lambda h: None))\n if page < total - 1:\n pager_row.append(ctx.screens.button(\"Next\", lambda h: render_view(page + 1)))\n rows.append(pager_row)\n\n rows.append([\n ctx.screens.success(\"Add Note\", add_note_flow),\n ctx.screens.danger(\"Clear All\", clear_notes_flow),\n ])\n\n await ctx.screens.show(\"Notes Manager\", body, buttons=rows)\n\n async def add_note_flow(handle: FormHandle) -> None:\n notes.append(f\"Note recorded at {int(ctx.uptime)}s\")\n await ctx.state.set(\"notes_list\", notes)\n await render_view(0)\n\n async def clear_notes_flow(handle: FormHandle) -> None:\n notes.clear()\n await ctx.state.set(\"notes_list\", [])\n await render_view(0)\n\n await render_view(0)\n```" - }, - { - "id": "tasks", - "title": "11. Background Supervisor Tasks & Lifecycle", - "summary": "Declaring long-running background workers, health monitoring, and graceful shutdown.", - "content": "Modules can run background tasks that persist throughout the userbot runtime. Declare tasks in the tasks mapping of the HOTARU dictionary.\n\n### Background Task Lifecycle\n\n1. Registration:\nDuring module startup, Hotaru registers every coroutine declared in HOTARU['tasks'].\n\n2. Supervisor Monitoring:\nTasks run inside the module's sandboxed worker process. If a task crashes due to an unhandled exception, the Hotaru supervisor restarts it with exponential backoff (up to 5 attempts).\n\n3. Graceful Termination:\nDuring bot shutdown or module unloading, ctx.is_stopping is set to True. The task is given a 5-second grace period to flush buffers, close open files, and exit cleanly before SIGKILL.\n\n### Background Worker Pattern\n\n```python\nimport asyncio\nfrom typing import TYPE_CHECKING\n\nif TYPE_CHECKING:\n from hotaru.response import ModuleContext\n\nasync def reminder_worker(ctx: ModuleContext) -> None:\n while not ctx.is_stopping:\n try:\n reminders = await ctx.state.get(\"pending_reminders\", [])\n now = int(asyncio.get_event_loop().time())\n active = []\n for r in reminders:\n if r[\"timestamp\"] <= now:\n await ctx.tg.send_message(r[\"chat_id\"], f\"Reminder: {r['text']}\")\n else:\n active.append(r)\n if len(active) != len(reminders):\n await ctx.state.set(\"pending_reminders\", active)\n except Exception:\n pass\n \n for _ in range(10):\n if ctx.is_stopping:\n break\n await asyncio.sleep(1)\n\nHOTARU = {\n \"id\": \"reminders\",\n \"name\": \"Background Reminder\",\n \"version\": \"1.0.0\",\n \"capabilities\": [\"mt\", \"state\"],\n \"commands\": {},\n \"tasks\": {\n \"checker\": reminder_worker,\n },\n}\n```" - }, - { - "id": "i18n", - "title": "12. Internationalization & Lexicons", - "summary": "Localizing module responses across English, Russian, Ukrainian, Japanese, Kazakh, and Chinese.", - "content": "Hotaru user interfaces adapt dynamically to the user's configured language. Hardcoding user-facing strings in command handlers is strictly prohibited.\n\n### Lexicon Schema\n\nDeclare a lexicon dictionary in the module manifest containing language sub-dictionaries:\n\n```python\n\"lexicon\": {\n \"en\": {\n \"welcome\": \"Welcome back, {user}!\",\n \"error_empty\": \"Query cannot be empty.\",\n },\n \"ru\": {\n \"welcome\": \"С возвращением, {user}!\",\n \"error_empty\": \"Запрос не может быть пустым.\",\n },\n \"uk\": {\n \"welcome\": \"З поверненням, {user}!\",\n \"error_empty\": \"Запит не може бути порожнім.\",\n },\n}\n```\n\n### Retrieving Localized Strings: ctx.t\n\nSignature:\n`ctx.t(key: str, **kwargs) -> str`\n\nBehavior:\n1. Checks the user's active language setting.\n2. If the key exists in that language, returns the translated string formatted with **kwargs.\n3. If absent, falls back to the English ('en') translation.\n4. If missing from English, returns the raw key literal as a safety measure.\n\nUsage Example:\n```python\ngreeting = ctx.t(\"welcome\", user=\"Alice\")\nawait ctx.respond(greeting)\n```" - }, - { - "id": "security-rules", - "title": "13. Security Audit Checklist & Semgrep Rules", - "summary": "Mandatory security rules, static analysis checks, and automated sandbox validation.", - "content": "Before any module is distributed or loaded into Hotaru, it must satisfy strict static security requirements.\n\n### Semgrep Security Verification\n\nThe repository enforces Semgrep rules located in .semgrep/hotaru-security.yml:\n\n1. No Credentials Leakage (hotaru-no-vault-leak):\nModules must never attempt to open, read, or transmit files located in sanctuary/, including hotaru.vault, runtime.db, or session files.\n\n2. No Private Namespace Access (hotaru-no-private-escape):\nModules must never inspect or modify private attributes of the core engine (__class__, __subclasses__, __globals__, or sys.modules).\n\n3. No Unsandboxed Network Sockets (hotaru-no-raw-socket):\nDirect import of socket, urllib, or requests is blocked by the runtime. All network traffic must use ctx.net or ctx.stream with the 'net' capability declared.\n\n4. No System Shell Execution (hotaru-no-shell-exec):\nCalls to os.system, subprocess.Popen, os.popen, or pty.spawn are trapped by seccomp filters and result in immediate worker SIGKILL.\n\n5. Zero Comments in Production Code:\nIn accordance with Hotaru code purity standards, production .hmod files contain zero comment lines. Code must be self-documenting through precise type annotations and explicit naming." - }, - { - "id": "complete-examples", - "title": "14. Complete Production Module Blueprints", - "summary": "Fully functional, production-ready .hmod modules demonstrating safe development patterns.", - "content": "The following production blueprints demonstrate real-world, secure module design. Notice that neither ping nor any kernel command is used.\n\n### Blueprint 1: Text Encryption Tool (.cipher)\n\n```python\nfrom __future__ import annotations\nimport base64\nfrom typing import TYPE_CHECKING\n\nif TYPE_CHECKING:\n from hotaru.response import ModuleContext\n\nasync def cipher_command(ctx: ModuleContext) -> None:\n text = ctx.raw_args.strip()\n if not text:\n await ctx.respond(ctx.t(\"missing_input\"))\n return\n encoded = base64.b64encode(text.encode(\"utf-8\")).decode(\"ascii\")\n await ctx.respond(f\"{encoded}\", parse_mode=\"html\")\n\nHOTARU = {\n \"id\": \"b64_cipher\",\n \"name\": \"Base64 Cipher\",\n \"version\": \"1.0.0\",\n \"capabilities\": [\"mt\"],\n \"commands\": {\n \"cipher\": cipher_command,\n },\n \"lexicon\": {\n \"en\": {\n \"missing_input\": \"Usage: .cipher \",\n },\n \"ru\": {\n \"missing_input\": \"Использование: .cipher <текст для кодирования>\",\n },\n },\n}\n```\n\n### Blueprint 2: Persistent Paste Bin (.paste)\n\n```python\nfrom __future__ import annotations\nimport json\nfrom typing import TYPE_CHECKING\n\nif TYPE_CHECKING:\n from hotaru.response import ModuleContext\n\nasync def paste_command(ctx: ModuleContext) -> None:\n content = ctx.raw_args.strip()\n if not content and ctx.reply_message:\n content = ctx.reply_message.message.text\n if not content:\n await ctx.respond(ctx.t(\"empty_paste\"))\n return\n await ctx.typing(\"upload_document\")\n payload = json.dumps({\"content\": content, \"extension\": \"txt\"}).encode(\"utf-8\")\n res = await ctx.net(\n \"https://paste.rs\",\n method=\"POST\",\n headers={\"Content-Type\": \"text/plain\"},\n data=content.encode(\"utf-8\"),\n )\n if res.status_code in (200, 201):\n url = res.text.strip()\n await ctx.respond(ctx.t(\"paste_success\", url=url))\n else:\n await ctx.respond(ctx.t(\"paste_error\"))\n\nHOTARU = {\n \"id\": \"paste_bin\",\n \"name\": \"Paste Bin Uploader\",\n \"version\": \"1.0.0\",\n \"capabilities\": [\"mt\", \"net\"],\n \"commands\": {\n \"paste\": paste_command,\n },\n \"lexicon\": {\n \"en\": {\n \"empty_paste\": \"Provide text or reply to a message with .paste\",\n \"paste_success\": \"Uploaded to pastebin: {url}\",\n \"paste_error\": \"Failed to upload snippet.\",\n },\n \"ru\": {\n \"empty_paste\": \"Укажите текст или ответьте на сообщение через .paste\",\n \"paste_success\": \"Сниппет опубликован: {url}\",\n \"paste_error\": \"Ошибка при публикации сниппета.\",\n },\n },\n}\n```" - } -]; - -export const DOCS_RU = [ - { - "id": "architecture", - "title": "1. Архитектура и изоляция ядра", - "summary": "Архитектурная спецификация Hotaru, ядра GoyGram MTProto и песочницы пространств имён Linux.", - "content": "Hotaru представляет собой ориентированный на безопасность Telegram юзербот, функционирующий от лица основного пользовательского аккаунта. В отличие от устаревших юзерботов, выполняющих сторонние скрипты прямо в основном процессе рядом с сессиями авторизации Telegram, Hotaru изолирует каждый модуль в отдельном процессе с контролем разрешений.\n\n### Архитектурные уровни системы\n\nРепозиторий Hotaru разделен на четыре уровня безопасности:\n\n1. hotaru/ (Привилегированное ядро):\nСупервизор управления аккаунтами, зашифрованное хранилище master vault (AES-GCM), диспетчеризация событий, реестры команд и отрисовка интерактивных экранов. Ядро никогда не исполняет сторонний код в собственном процессе.\n\n2. relay/ (Сетевой экран и шлюз разрешений):\nДоверенная граница, фильтрующая любые обращения сторонних модулей к транспорту Telegram MTProto. Слой содержит спецификации разрешений (relay/caps.py), прокси сетевого выхода (relay/proxies.py), изоляцию файловой системы (relay/files.py) и денилист RPC (relay/denylist.py).\n\n3. constellations/ (Встроенные модули ядра):\nСистемные модули расширения в формате .hmod (accounts, acl, backups, catalyst, executor, genesis, help, info, logger, power, settings, shield, singularity, translations, updater). Их триггеры зарезервированы ядром.\n\n4. sanctuary/ (Хранилище приватных данных):\nЗашифрованная рабочая директория пользователя, содержащая ключи сессий (sanctuary/hotaru.vault), локальные базы SQLite и журнал аудита. Сторонние модули не имеют доступа к этой директории.\n\n### Модель изоляции через Linux Namespaces\n\nПри загрузке стороннего модуля .hmod Hotaru запускает изолированный дочерний процесс в четырёх пространствах имён Linux:\n\n• CLONE_NEWNS (Изоляция файловой системы):\nПроцесс модуля получает персональную таблицу монтирования. Директории /root, /home, /etc, /proc/keys и sanctuary/ скрыты или доступны строго на чтение. Запись разрешена только во временную директорию tmpfs, уничтожаемую при выходе.\n\n• CLONE_NEWIPC (Изоляция очередей сообщений):\nИзолирует IPC System V и очереди POSIX, предотвращая перехват сигналов или чтение общей памяти между модулями.\n\n• CLONE_NEWUTS (Изоляция системных идентификаторов):\nИзолирует имя хоста и доменные идентификаторы системы.\n\n• CLONE_NEWNET (Изоляция сети):\nИзолирует сетевой стек. Если модуль не запросил разрешение 'net', его сетевое пространство содержит только отключенный loopback-интерфейс. Попытки создать сокет завершаются системной ошибкой ENETUNREACH или EPERM.\n\n### Сброс привилегий и контроль системных вызовов\n\nПеред запуском кода модуля воркер сбрасывает права:\n• UID переключается на nobody (65534), GID на nogroup (65534).\n• Устанавливается флаг prctl(PR_SET_NO_NEW_PRIVS, 1), исключающий эскалацию прав через setuid-бинарники.\n• Обмен данными с ядром происходит через однонаправленные UNIX-пайпы и типизированный протокол RPC." - }, - { - "id": "hmod-specification", - "title": "2. Спецификация модулей .hmod и жизненный цикл", - "summary": "Схема манифеста HOTARU, жизненный цикл, обработка команд и фоновые задачи.", - "content": "Модуль Hotaru является автономным файлом исходного кода Python с расширением .hmod. Среда выполнения загружает модули динамически через изолированный раннер.\n\n### Схема манифеста: словарь HOTARU\n\nКаждый модуль .hmod обязан объявлять на уровне модуля словарь HOTARU:\n\n```python\nfrom __future__ import annotations\nfrom typing import TYPE_CHECKING\n\nif TYPE_CHECKING:\n from hotaru.response import ModuleContext\n\nasync def qr_command(ctx: ModuleContext) -> None:\n text = ctx.raw_args.strip()\n if not text:\n await ctx.respond(ctx.t(\"missing_text\"))\n return\n url = f\"https://api.qrserver.com/v1/create-qr-code/?size=300x300&data={text}\"\n response = await ctx.net(url)\n await ctx.reply_photo(response.content, caption=ctx.t(\"generated\"))\n\nHOTARU = {\n \"id\": \"qr_tool\",\n \"name\": \"QR Generator\",\n \"version\": \"1.0.0\",\n \"author\": \"Security Engineering\",\n \"description\": \"Генерация QR-кодов прямо в чате.\",\n \"capabilities\": [\"mt\", \"net\"],\n \"commands\": {\n \"qr\": qr_command,\n },\n \"lexicon\": {\n \"en\": {\n \"missing_text\": \"Please provide text or a URL after .qr\",\n \"generated\": \"Here is your generated QR code.\",\n },\n \"ru\": {\n \"missing_text\": \"Укажите текст или ссылку после .qr\",\n \"generated\": \"Ваш QR-код успешно сгенерирован.\",\n },\n },\n}\n```\n\n### Поля манифеста\n\n• id (str, обязательно): Уникальный идентификатор в нижнем регистре (только латиница, цифры и подчеркивание).\n• name (str, обязательно): Человекочитаемое название модуля.\n• version (str, обязательно): Версия модуля по стандарту SemVer (MAJOR.MINOR.PATCH).\n• author (str, опционально): Имя автора или организации.\n• description (str, опционально): Краткое описание возможностей.\n• capabilities (list[str], обязательно): Список запрашиваемых разрешений ядра.\n• commands (dict[str, Callable], обязательно): Словарь привязки триггеров к асинхронным функциям-обработчикам.\n• tasks (dict[str, Callable], опционально): Словарь долгоживущих фоновых задач, контролируемых супервизором.\n• lexicon (dict[str, dict[str, str]], опционально): Локализованные строки интерфейса (en, ru, uk, ja, kz, zh).\n\n### Зарезервированные системные команды\n\nHotaru резервирует команды встроенных модулей ядра. Сторонний модуль, объявляющий один из следующих триггеров, будет отклонен при загрузке:\naccounts, acl, backups, catalyst, executor, genesis, help, info, logger, power, settings, shield, singularity, translations, updater, ping, dash, restart, config, backup." - }, - { - "id": "capabilities", - "title": "3. Система прав и денилист RPC", - "summary": "Контроль доступа, проверка MTProto RPC и блокировка деструктивных вызовов.", - "content": "Hotaru следует принципу минимальных привилегий. По умолчанию сторонний модуль не имеет прав: нет доступа к сети, нет записи на диск вне tmpfs и нет вызова MTProto API.\n\n### Доступные разрешения (capabilities)\n\n1. mt:\nПредоставляет контролируемый доступ к Telegram MTProto RPC через вызовы ctx.mt(method, **kwargs) и высокоуровневые методы сообщений. Любой вызов RPC фильтруется relay/firewall.py и проверяется по relay/denylist.py.\n\n2. net:\nАктивирует сетевой интерфейс воркера. Позволяет отправлять HTTP, HTTPS и TCP запросы через ctx.net(url) и ctx.stream(host, port). Без этого разрешения модуль не может выходить в интернет.\n\n3. state:\nПредоставляет постоянное хранилище ключ-значение, изолированное строго внутри идентификатора модуля. Работает поверх защищенной SQLite. Модули не могут читать чужие ключи.\n\n4. files:\nРазрешает запись во временную директорию tmpfs воркера. Попытки выхода за пределы рабочей директории блокируются ядром.\n\n5. accounts:\nПредоставляет безопасный доступ только на чтение к списку подключенных аккаунтов.\n\n6. screens:\nВключает движок интерактивных экранов ctx.screens для терминала и Telegram.\n\n### Денилист запрещенных RPC\n\nПри использовании разрешения 'mt' ядро блокирует любые деструктивные методы Telegram:\n\n• Сброс сессий и авторизации:\nauth.logOut, auth.resetAuthorizations, auth.dropTempAuthKeys\n\n• Удаление учетной записи:\naccount.deleteAccount\n\n• Изменение облачного пароля:\naccount.updatePasswordSettings\n\nПри попытке вызова любого из этих методов процесс модуля немедленно завершается, факт попытки заносится в журнал аудита, а разрешения аннулируются." - }, - { - "id": "ctx-properties", - "title": "4. ModuleContext: Свойства контекста", - "summary": "Подробный справочник всех свойств ctx: типы данных, назначение и примеры использования.", - "content": "Объект ModuleContext передается единственным аргументом в обработчики команд и фоновые задачи.\n\n### Свойства контекста\n\n• ctx.module_id -> str\nУникальный строковый идентификатор выполняющегося модуля.\nПример:\nassert ctx.module_id == \"qr_tool\"\n\n• ctx.chat_id -> int\nИдентификатор чата, канала или диалога, где вызвана команда.\nПример:\ncurrent_chat = ctx.chat_id\n\n• ctx.sender_id / ctx.user_id -> int | None\nИдентификатор пользователя, отправившего сообщение. Возвращает None для анонимных каналов.\nПример:\nuser = ctx.sender_id or 0\n\n• ctx.topic_id -> int | None\nИдентификатор ветки форума в супергруппе с включенными топиками. В обычных чатах равен None.\nПример:\nif ctx.topic_id is not None:\n await ctx.respond(f\"Команда вызвана в ветке {ctx.topic_id}\")\n\n• ctx.is_me / ctx.out -> bool\nЛогический флаг, указывающий, отправлено ли сообщение текущим юзерботом.\nПример:\nif not ctx.is_me:\n return\n\n• ctx.message -> ModuleMessage\nИсходный объект сообщения с текстом, сущностями разметки и системными метками.\nПример:\nmsg_id = ctx.message.id\n\n• ctx.has_media -> bool\nTrue, если сообщение содержит фото, видео, аудио, документ, стикер или голосовое сообщение.\nПример:\nif not ctx.has_media:\n await ctx.respond(\"Прикрепите медиафайл.\")\n return\n\n• ctx.media / ctx.attachment -> Attachment | None\nОбъект вложенного файла. Предоставляет поля .file_id, .size, .mime_type и .filename.\nПример:\nif ctx.attachment:\n size_mb = ctx.attachment.size / (1024 * 1024)\n\n• ctx.reply_message -> ModuleMessage | None\nСообщение, на которое ответили командой. Если ответа не было, содержит None.\nПример:\nif ctx.reply_message:\n target_user = ctx.reply_message.sender_id\n\n• ctx.reply_attachment -> Attachment | None\nВложение из сообщения, на которое ответили.\nПример:\nif ctx.reply_attachment:\n raw = await ctx.download(ctx.reply_attachment)\n\n• ctx.args -> list[str]\nСписок строковых аргументов, разбитых по пробелам (без префикса и имени команды).\nПример:\nif len(ctx.args) < 2:\n await ctx.respond(\"Использование: .calc <число> <оператор>\")\n\n• ctx.raw_args -> str\nНеобработанная строка параметров команды с сохранением пробелов.\nПример:\nquery = ctx.raw_args.strip()\n\n• ctx.prefix -> str\nСимвол префикса, которым была вызвана команда (например '.' или '!').\nПример:\npfx = ctx.prefix\n\n• ctx.uptime -> float\nВремя непрерывной работы ядра Hotaru в секундах.\nПример:\nhours = ctx.uptime / 3600.0\n\n• ctx.memory / ctx.ram -> int\nОбъем оперативной памяти, занятый процессом воркера в байтах.\nПример:\nmb = ctx.memory / (1024 * 1024)\n\n• ctx.version -> str\nВерсия сборки ядра Hotaru.\nПример:\nver = ctx.version\n\n• ctx.is_stopping -> bool\nФлаг плановой остановки ядра. Используется фоновыми задачами для корректного выхода.\nПример:\nwhile not ctx.is_stopping:\n await asyncio.sleep(1)" - }, - { - "id": "ctx-messaging", - "title": "5. ModuleContext: Методы сообщений", - "summary": "Каждый метод отправки и редактирования: сигнатура, параметры, возвращаемые значения и примеры.", - "content": "ModuleContext предоставляет методы для отправки, редактирования, пересылки, реакций и удаления сообщений.\n\n### ctx.reply\nСигнатура:\n`await ctx.reply(text: str, *, parse_mode: str = \"html\", link_preview: bool = False, silent: bool = False, schedule_date: int | None = None) -> ModuleMessage`\nОписание:\nОтправляет сообщение в текущий чат в виде ответа на команду.\nПараметры:\n• text: Текст ответа.\n• parse_mode: Формат разметки ('html', 'md' или None).\n• link_preview: Флаг предпросмотра веб-ссылок.\n• silent: Отправка без звукового уведомления.\n• schedule_date: Время отложенной отправки (Unix timestamp).\nВозвращает:\nОбъект отправленного сообщения ModuleMessage.\nПример:\n```python\nawait ctx.reply(\"Результат: 42\", parse_mode=\"html\")\n```\n\n### ctx.respond\nСигнатура:\n`await ctx.respond(text: str, *, parse_mode: str = \"html\", link_preview: bool = False) -> ModuleMessage`\nОписание:\nЕсли команда отправлена самим юзерботом (ctx.is_me is True), редактирует исходное сообщение на месте. Если чужим пользователем, отправляет новый ответ.\nВозвращает:\nОбъект ModuleMessage.\nПример:\n```python\nmsg = await ctx.respond(\"Выполняю расчет...\")\nawait msg.edit(\"Расчет завершен.\")\n```\n\n### ctx.edit\nСигнатура:\n`await ctx.edit(text: str, *, parse_mode: str = \"html\", link_preview: bool = False) -> ModuleMessage`\nОписание:\nРедактирует текст исходного сообщения.\nОшибки:\nВызывает PermissionError, если сообщение создано другим пользователем.\nПример:\n```python\nawait ctx.edit(\"Статус: Готово\")\n```\n\n### ctx.delete\nСигнатура:\n`await ctx.delete(*, revoke: bool = True) -> bool`\nОписание:\nУдаляет текущее сообщение.\nПараметры:\n• revoke: При значении True удаляет сообщение для всех участников беседы.\nПример:\n```python\nawait ctx.delete(revoke=True)\n```\n\n### ctx.pin\nСигнатура:\n`await ctx.pin(*, silent: bool = False, unpin_both: bool = False) -> bool`\nОписание:\nЗакрепляет текущее сообщение в чате.\nПример:\n```python\nawait ctx.pin(silent=True)\n```\n\n### ctx.unpin\nСигнатура:\n`await ctx.unpin() -> bool`\nОписание:\nСнимает закрепление с текущего сообщения.\nПример:\n```python\nawait ctx.unpin()\n```\n\n### ctx.react\nСигнатура:\n`await ctx.react(emoji: str, *, big: bool = False) -> bool`\nОписание:\nСтавит реакцию-эмодзи на текущее сообщение.\nПараметры:\n• emoji: Символ эмодзи (например '🔥', '👍', '❤️').\n• big: Воспроизведение анимации на весь экран.\nПример:\n```python\nawait ctx.react(\"🔥\", big=True)\n```\n\n### ctx.unreact\nСигнатура:\n`await ctx.unreact() -> bool`\nОписание:\nСнимает ранее установленную реакцию юзербота с сообщения.\nПример:\n```python\nawait ctx.unreact()\n```\n\n### ctx.forward_to\nСигнатура:\n`await ctx.forward_to(target_chat_id: int, *, silent: bool = False) -> ModuleMessage`\nОписание:\nПересылает сообщение в указанный чат.\nПример:\n```python\nawait ctx.forward_to(123456789, silent=True)\n```\n\n### ctx.copy_to\nСигнатура:\n`await ctx.copy_to(target_chat_id: int, *, caption: str | None = None) -> ModuleMessage`\nОписание:\nКопирует сообщение без плашки автора пересылки.\nПример:\n```python\nawait ctx.copy_to(123456789, caption=\"Копия данных\")\n```\n\n### ctx.save\nСигнатура:\n`await ctx.save() -> ModuleMessage`\nОписание:\nОтправляет копию сообщения в Избранное ('me').\nПример:\n```python\nawait ctx.save()\n```\n\n### ctx.typing\nСигнатура:\n`await ctx.typing(action: str = \"typing\") -> None`\nОписание:\nОтправляет статус активности в чат ('typing', 'upload_photo', 'upload_document').\nПример:\n```python\nawait ctx.typing(\"upload_document\")\n```\n\n### ctx.read & ctx.mark_read\nСигнатура:\n`await ctx.read() -> bool`\nОписание:\nПомечает все входящие сообщения диалога до текущего как прочитанные.\nПример:\n```python\nawait ctx.read()\n```" - }, - { - "id": "ctx-media", - "title": "6. ModuleContext: Файлы и медиа", - "summary": "Полные сигнатуры, типы аргументов, скачивание и загрузка файлов в потоковом режиме.", - "content": "Hotaru поддерживает передачу медиафайлов через байтовые потоки в оперативной памяти без обязательной записи на диск.\n\n### ctx.send_file & ctx.reply_file\nСигнатура:\n`await ctx.reply_file(file: bytes | str | BinaryIO, *, caption: str | None = None, force_document: bool = False, filename: str | None = None) -> ModuleMessage`\nОписание:\nОтправляет бинарный файл, локальный путь или файловый объект как документ.\nПример:\n```python\ndata = b\"ID,Value\\n1,Alpha\\n2,Beta\"\nawait ctx.reply_file(data, filename=\"metrics.csv\", caption=\"Выгрузка метрик\")\n```\n\n### ctx.send_photo & ctx.reply_photo\nСигнатура:\n`await ctx.reply_photo(photo: bytes | str | BinaryIO, *, caption: str | None = None, parse_mode: str = \"html\") -> ModuleMessage`\nОписание:\nОтправляет изображение JPEG, PNG или WEBP как сжатую фотографию Telegram.\nПример:\n```python\nwith open(\"plot.png\", \"rb\") as f:\n await ctx.reply_photo(f.read(), caption=\"График нагрузки\")\n```\n\n### ctx.send_video & ctx.reply_video\nСигнатура:\n`await ctx.reply_video(video: bytes | str | BinaryIO, *, caption: str | None = None, duration: int | None = None, width: int | None = None, height: int | None = None) -> ModuleMessage`\nОписание:\nОтправляет видео MP4 или MOV с метаданными длительности и разрешения.\nПример:\n```python\nawait ctx.reply_video(\"capture.mp4\", duration=15, caption=\"Запись экрана\")\n```\n\n### ctx.send_audio & ctx.reply_audio\nСигнатура:\n`await ctx.reply_audio(audio: bytes | str | BinaryIO, *, caption: str | None = None, duration: int | None = None, performer: str | None = None, title: str | None = None) -> ModuleMessage`\nОписание:\nОтправляет аудиофайл MP3 или FLAC с указанием автора и названия трека.\nПример:\n```python\nawait ctx.reply_audio(raw_audio, title=\"Синтез речи\", performer=\"Hotaru\")\n```\n\n### ctx.send_voice & ctx.reply_voice\nСигнатура:\n`await ctx.reply_voice(voice: bytes | str | BinaryIO, *, caption: str | None = None, duration: int | None = None) -> ModuleMessage`\nОписание:\nОтправляет звуковую дорожку Opus в виде голосовой заметки.\nПример:\n```python\nawait ctx.reply_voice(opus_data, duration=4)\n```\n\n### ctx.send_animation & ctx.reply_animation\nСигнатура:\n`await ctx.reply_animation(animation: bytes | str | BinaryIO, *, caption: str | None = None) -> ModuleMessage`\nОписание:\nОтправляет зацикленное беззвучное видео MP4 или GIF как анимацию.\nПример:\n```python\nawait ctx.reply_animation(\"indicator.mp4\")\n```\n\n### ctx.send_dice & ctx.reply_dice\nСигнатура:\n`await ctx.reply_dice(emoji: str = \"🎲\") -> ModuleMessage`\nОписание:\nБросает интерактивную кость Telegram ('🎲', '🎯', '🏀', '⚽', '🎳', '🎰').\nПример:\n```python\nawait ctx.reply_dice(\"🎯\")\n```\n\n### ctx.edit_media\nСигнатура:\n`await ctx.edit_media(media: bytes | str | BinaryIO, *, caption: str | None = None, parse_mode: str = \"html\") -> ModuleMessage`\nОписание:\nЗаменяет медиафайл в существующем сообщении без отправки нового сообщения.\nПример:\n```python\nawait ctx.edit_media(new_image_bytes, caption=\"Обновлено в 12:00\")\n```\n\n### ctx.edit_caption\nСигнатура:\n`await ctx.edit_caption(caption: str, *, parse_mode: str = \"html\") -> ModuleMessage`\nОписание:\nИзменяет текстовую подпись под медиафайлом без повторной загрузки самого файла.\nПример:\n```python\nawait ctx.edit_caption(\"Архивная запись\")\n```\n\n### ctx.download & ctx.download_media\nСигнатура:\n`await ctx.download(attachment: Attachment | None = None, destination: str | None = None) -> bytes | str`\nОписание:\nСкачивает вложение текущего или цитируемого сообщения. Если указан destination, сохраняет файл по пути и возвращает строку. Если destination не указан, возвращает байты из памяти.\nПример:\n```python\nif ctx.reply_attachment:\n file_bytes = await ctx.download(ctx.reply_attachment)\n assert isinstance(file_bytes, bytes)\n```" - }, - { - "id": "ctx-buttons-polls", - "title": "7. ModuleContext: Кнопки, опросы и чек-листы", - "summary": "Инлайн-кнопки, интерактивные опросы, нативные чек-листы и считывание результатов.", - "content": "Hotaru поддерживает работу с кнопками, интерактивными опросами и чек-листами Telegram.\n\n### Инлайн-кнопки\n\n• ctx.buttons -> list[list[MessageButton]]\nДвумерная матрица инлайн-кнопок текущего сообщения.\n\n• ctx.button_count -> int\nОбщее число кнопок на сообщении.\n\n• await ctx.click(row: int, col: int) -> Any\nСимулирует нажатие кнопки по ее координатам в сетке.\n\n• await ctx.click_button(text: str | None = None, data: bytes | None = None) -> Any\nНаходит кнопку по тексту или данным обратного вызова и нажимает ее.\nПример:\n```python\nawait ctx.click_button(text=\"Подтвердить\")\n```\n\n• await ctx.edit_buttons(buttons: list[list[dict[str, str]]]) -> None\nЗаменяет раскладку инлайн-кнопок на сообщении.\nПример:\n```python\ngrid = [\n [{\"text\": \"Обновить\", \"data\": \"r_1\"}, {\"text\": \"Закрыть\", \"data\": \"c_1\"}]\n]\nawait ctx.edit_buttons(grid)\n```\n\n• await ctx.remove_buttons() -> None\nУдаляет клавиатуру инлайн-кнопок, сохраняя текст сообщения.\nПример:\n```python\nawait ctx.remove_buttons()\n```\n\n### Нативные опросы\n\n• await ctx.send_poll(question: str, answers: list[str], *, multiple_choice: bool = False, quiz: bool = False, correct_id: int | None = None) -> ModuleMessage\nОтправляет нативный опрос в чат.\nПример:\n```python\nawait ctx.send_poll(\n \"Выберите сервер для развертывания:\",\n [\"Франкфурт\", \"Токио\", \"Вирджиния\"],\n multiple_choice=False,\n)\n```\n\n• await ctx.close_poll() -> Any\nЗакрывает голосование в текущем опросе.\nПример:\n```python\nawait ctx.close_poll()\n```\n\n• await ctx.vote(answers: list[int]) -> Any\nГолосует в опросе за указанные варианты ответа.\nПример:\n```python\nawait ctx.vote([0])\n```\n\n• await ctx.retract_vote() -> Any\nОтзывает голос текущего пользователя из опроса.\nПример:\n```python\nawait ctx.retract_vote()\n```\n\n### Чек-листы Telegram\n\n• await ctx.send_todo(title: str, items: list[str], *, others_can_append: bool = False, others_can_complete: bool = False) -> ModuleMessage\nОтправляет интерактивный список задач с возможностью отметки.\nПример:\n```python\nawait ctx.send_todo(\n \"Чек-лист релиза\",\n [\"Применить миграции\", \"Очистить кэш\", \"Проверить статус сервисов\"],\n others_can_complete=True,\n)\n```\n\n• await ctx.append_todo(items: list[str]) -> Any\nДобавляет новые пункты в существующий чек-лист.\nПример:\n```python\nawait ctx.append_todo([\"Проверить записи DNS\"])\n```\n\n• await ctx.set_checklist_completed(completed: list[int], incompleted: list[int]) -> Any\nПереключает статус выполнения пунктов чек-листа." - }, - { - "id": "ctx-catalog", - "title": "8. Расширенный каталог операций Telegram", - "summary": "Глубокий справочник по более чем 290 обернутым методам MTProto в ctx.", - "content": "Шлюз Hotaru предоставляет прямой доступ к более чем 290 специализированным методам Telegram прямо через ctx. Все методы типизированы, проверены и привязаны к текущему чату.\n\n### Управление ветками форумов\n\n• await ctx.create_forum_topic(title: str, icon_color: int | None = None, icon_emoji_id: int | None = None) -> Any\nСоздает новую ветку в супергруппе с форумом.\nПример:\n```python\ntopic = await ctx.create_forum_topic(\"Инцидент #402\", icon_color=0x6FB9F0)\n```\n\n• await ctx.edit_forum_topic(topic_id: int, title: str | None = None, closed: bool | None = None) -> Any\nИзменяет название ветки или закрывает ее.\n\n• await ctx.set_forum_topic_pinned(topic_id: int, pinned: bool) -> Any\nЗакрепляет ветку в списке тем форума.\n\n• await ctx.remove_forum_topic(topic_id: int) -> Any\nУдаляет тему форума и всю историю сообщений в ней.\n\n### Администрирование каналов\n\n• await ctx.channel_details() -> Any\nВозвращает полную информацию о канале, описание и счетчик участников.\n\n• await ctx.channel_members(limit: int = 50) -> Any\nЗапрашивает список участников канала.\n\n• await ctx.set_channel_admin(user_id: int, is_admin: bool, rank: str = \"\") -> Any\nНазначает администратора и устанавливает персональную плашку роли.\n\n• await ctx.restrict_channel_member(user_id: int, send_messages: bool = False) -> Any\nОграничивает права участника в группе.\n\n• await ctx.channel_admin_log(limit: int = 50) -> Any\nПолучает журнал действий администраторов (баны, удаления сообщений, смены ролей).\n\n• await ctx.set_slow_mode(seconds: int) -> Any\nУстанавливает интервал медленного режима в секундах (0 для отключения).\n\n• await ctx.set_antispam(enabled: bool) -> Any\nВключает или выключает агрессивный антиспам Telegram.\n\n### Реакции и отложенные сообщения\n\n• await ctx.configure_chat_reactions(available_reactions: list[str]) -> Any\nОграничивает список разрешенных реакций в чате.\n\n• await ctx.scheduled_messages() -> list[Any]\nВозвращает список отложенных сообщений в чате.\n\n• await ctx.cancel_scheduled(ids: list[int]) -> Any\nОтменяет отложенные сообщения по их номерам." - }, - { - "id": "ctx-state-net", - "title": "9. Хранилище State и сетевой шлюз", - "summary": "Изолированная база ключ-значение, HTTP-клиент и прямое потоковое TCP-соединение.", - "content": "Hotaru изолирует хранилище данных и сетевой ввод-вывод через специализированные прокси ядра.\n\n### Постоянное хранилище (ctx.state)\n\nТребует разрешение: 'state'\nХранилище работает поверх SQLite. Ключи изолированы внутри идентификатора модуля, исключая пересечение данных.\n\nМетоды:\n• await ctx.state.get(key: str, default: Any = None) -> Any\nВозвращает сохраненное значение по ключу. Если ключ отсутствует, возвращает default.\n\n• await ctx.state.set(key: str, value: Any) -> None\nСохраняет сериализуемое значение (dict, list, int, float, str, bool).\n\n• await ctx.state.delete(key: str) -> bool\nУдаляет ключ из базы данных. Возвращает True, если ключ существовал.\n\n• await ctx.state.clear() -> None\nПолностью очищает все данные текущего модуля.\n\n• await ctx.state.all() -> dict[str, Any]\nВозвращает словарь всех ключей модуля.\n\nПример использования:\n```python\nasync def counter_command(ctx: ModuleContext) -> None:\n current = await ctx.state.get(\"invocations\", 0)\n current += 1\n await ctx.state.set(\"invocations\", current)\n await ctx.respond(f\"Команда выполнена {current} раз.\")\n```\n\n### Сетевой клиент и TCP-стриминг (ctx.net и ctx.stream)\n\nТребует разрешение: 'net'\nТрафик проходит через защищенный шлюз с проверкой сертификатов TLS.\n\n1. HTTP-запросы (ctx.net):\nСигнатура:\n`await ctx.net(url: str, *, method: str = \"GET\", headers: dict[str, str] | None = None, data: bytes | None = None, json: Any | None = None, timeout: float = 10.0) -> HttpResponse`\nСвойства объекта ответа:\n• .status_code (int): Код ответа HTTP (например 200, 404).\n• .text (str): Текстовое тело ответа.\n• .content (bytes): Бинарные данные ответа.\n• .headers (dict[str, str]): Заголовки ответа.\n\nПример использования:\n```python\nasync def weather_command(ctx: ModuleContext) -> None:\n city = ctx.raw_args.strip() or \"Moscow\"\n url = f\"https://wttr.in/{city}?format=j1\"\n response = await ctx.net(url)\n if response.status_code == 200:\n data = json.loads(response.text)\n temp = data[\"current_condition\"][0][\"temp_C\"]\n await ctx.respond(f\"Температура в {city}: {temp}°C\")\n```\n\n2. Прямой TCP-стриминг (ctx.stream):\nСигнатура:\n`stream = await ctx.stream(host: str, port: int, *, ssl: bool = True) -> NetStream`\nМетоды:\n• await stream.send(data: bytes) -> None\n• await stream.recv(size: int = 4096) -> bytes\n• await stream.close() -> None" - }, - { - "id": "screens", - "title": "10. Движок интерактивных экранов и форм", - "summary": "Создание многостраничных меню с кнопками, таблицами, пейджером и формами ввода.", - "content": "Движок экранов Hotaru (ctx.screens) позволяет строить интерактивные меню прямо в сообщениях Telegram.\n\n### Компоненты экранов\n\n• await ctx.screens.show(title: str, body: str, *, buttons: list[list[Any]] | None = None, pager: Any | None = None) -> FormHandle\nОтрисовывает экран с заголовком, текстом и инлайн-клавиатурой.\n\n• ctx.screens.button(text: str, callback: Callable[[FormHandle], Awaitable[None]], style: str = \"default\")\nСоздает интерактивную кнопку, привязанную к асинхронному обработчику.\n\n• ctx.screens.primary(text: str, callback: Callable)\nСоздает визуально выделенную кнопку главного действия.\n\n• ctx.screens.danger(text: str, callback: Callable)\nСоздает кнопку опасного действия (красный акцент).\n\n• ctx.screens.success(text: str, callback: Callable)\nСоздает кнопку успешного подтверждения (зеленый акцент).\n\n• ctx.screens.pager(current_page: int, total_pages: int, on_page_change: Callable[[int], Awaitable[None]])\nСтроит блок пагинации со стрелками вперед и назад.\n\n• ctx.screens.table(headers: list[str], rows: list[list[str]], page: int = 1, page_size: int = 5) -> str\nФорматирует аккуратную моноширинную ASCII-таблицу.\n\n• ctx.screens.close()\nКнопка закрытия, корректно удаляющая экран.\n\n### Пример интерактивного списка заметок\n\n```python\nasync def notes_menu(ctx: ModuleContext) -> None:\n notes = await ctx.state.get(\"notes_list\", [])\n\n async def render_view(page: int = 0) -> None:\n items_per_page = 3\n total = max(1, (len(notes) + items_per_page - 1) // items_per_page)\n slice_items = notes[page * items_per_page:(page + 1) * items_per_page]\n \n body_lines = [f\"{i+1}. {item}\" for i, item in enumerate(slice_items)]\n body = \"\\n\".join(body_lines) or \"Заметок пока нет.\"\n\n rows = []\n if total > 1:\n pager_row = []\n if page > 0:\n pager_row.append(ctx.screens.button(\"Назад\", lambda h: render_view(page - 1)))\n pager_row.append(ctx.screens.button(f\"{page + 1}/{total}\", lambda h: None))\n if page < total - 1:\n pager_row.append(ctx.screens.button(\"Вперед\", lambda h: render_view(page + 1)))\n rows.append(pager_row)\n\n rows.append([\n ctx.screens.success(\"Добавить\", add_note_flow),\n ctx.screens.danger(\"Очистить\", clear_notes_flow),\n ])\n\n await ctx.screens.show(\"Менеджер заметок\", body, buttons=rows)\n\n async def add_note_flow(handle: FormHandle) -> None:\n notes.append(f\"Заметка создана в {int(ctx.uptime)}с\")\n await ctx.state.set(\"notes_list\", notes)\n await render_view(0)\n\n async def clear_notes_flow(handle: FormHandle) -> None:\n notes.clear()\n await ctx.state.set(\"notes_list\", [])\n await render_view(0)\n\n await render_view(0)\n```" - }, - { - "id": "tasks", - "title": "11. Фоновые задачи супервизора", - "summary": "Объявление долгоживущих воркеров, мониторинг состояния и корректная остановка.", - "content": "Модули могут запускать фоновые процессы, непрерывно выполняющиеся во время работы юзербота. Задачи объявляются в секции tasks словаря HOTARU.\n\n### Жизненный цикл фоновой задачи\n\n1. Регистрация:\nПри запуске модуля Hotaru регистрирует все функции из HOTARU['tasks'].\n\n2. Мониторинг супервизором:\nЕсли задача аварийно падает из-за необработанного исключения, супервизор Hotaru перезапускает ее с экспоненциальной задержкой (до 5 попыток).\n\n3. Корректная остановка:\nПри остановке юзербота флаг ctx.is_stopping переходит в True. Задаче дается 5 секунд на завершение операций перед отправкой SIGKILL.\n\n### Паттерн создания воркера\n\n```python\nimport asyncio\nfrom typing import TYPE_CHECKING\n\nif TYPE_CHECKING:\n from hotaru.response import ModuleContext\n\nasync def reminder_worker(ctx: ModuleContext) -> None:\n while not ctx.is_stopping:\n try:\n reminders = await ctx.state.get(\"pending_reminders\", [])\n now = int(asyncio.get_event_loop().time())\n active = []\n for r in reminders:\n if r[\"timestamp\"] <= now:\n await ctx.tg.send_message(r[\"chat_id\"], f\"Напоминание: {r['text']}\")\n else:\n active.append(r)\n if len(active) != len(reminders):\n await ctx.state.set(\"pending_reminders\", active)\n except Exception:\n pass\n \n for _ in range(10):\n if ctx.is_stopping:\n break\n await asyncio.sleep(1)\n\nHOTARU = {\n \"id\": \"reminders\",\n \"name\": \"Фоновые напоминания\",\n \"version\": \"1.0.0\",\n \"capabilities\": [\"mt\", \"state\"],\n \"commands\": {},\n \"tasks\": {\n \"checker\": reminder_worker,\n },\n}\n```" - }, - { - "id": "i18n", - "title": "12. Интернационализация и лексикон", - "summary": "Локализация интерфейсов модулей на русский, английский, украинский, японский, казахский и китайский языки.", - "content": "Интерфейс Hotaru автоматически адаптируется под выбранный пользователем язык. Использование жестко закодированных строк в коде обработчиков запрещено.\n\n### Схема словаря lexicon\n\nОбъявите словарь lexicon в манифесте модуля с поддержкой необходимых языков:\n\n```python\n\"lexicon\": {\n \"en\": {\n \"welcome\": \"Welcome back, {user}!\",\n \"error_empty\": \"Query cannot be empty.\",\n },\n \"ru\": {\n \"welcome\": \"С возвращением, {user}!\",\n \"error_empty\": \"Запрос не может быть пустым.\",\n },\n \"uk\": {\n \"welcome\": \"З поверненням, {user}!\",\n \"error_empty\": \"Запит не може бути порожнім.\",\n },\n}\n```\n\n### Получение перевода: ctx.t\n\nСигнатура:\n`ctx.t(key: str, **kwargs) -> str`\n\nАлгоритм выбора строки:\n1. Проверяется текущий язык интерфейса пользователя.\n2. Если ключ присутствует в этом языке, возвращается строка с подстановкой **kwargs.\n3. Если строка отсутствует, происходит откат к английской версии ('en').\n4. Если отсутствует и в английской, возвращается сам ключ.\n\nПример:\n```python\ngreeting = ctx.t(\"welcome\", user=\"Алиса\")\nawait ctx.respond(greeting)\n```" - }, - { - "id": "security-rules", - "title": "13. Правила качества и безопасности", - "summary": "Обязательные требования безопасности, статический анализ Semgrep и проверка песочницы.", - "content": "Перед публикацией и установкой модули Hotaru проходят строгий статический аудит безопасности.\n\n### Правила проверки Semgrep (.semgrep/hotaru-security.yml)\n\n1. Запрет утечки учетных данных (hotaru-no-vault-leak):\nМодулям запрещено читать файлы из директории sanctuary/, включая hotaru.vault, runtime.db и сессионные данные.\n\n2. Запрет выхода из песочницы (hotaru-no-private-escape):\nЗапрещен доступ к служебным атрибутам ядра Python (__class__, __subclasses__, __globals__, sys.modules).\n\n3. Запрет прямых сокетов (hotaru-no-raw-socket):\nПрямой импорт socket, urllib или requests блокируется. Сетевой трафик обязан использовать ctx.net или ctx.stream с объявленным разрешением 'net'.\n\n4. Запрет системных оболочек (hotaru-no-shell-exec):\nВызовы os.system, subprocess.Popen, os.popen или pty.spawn блокируются фильтрами seccomp и приводят к SIGKILL воркера.\n\n5. Политика нулевых комментариев:\nВ соответствии со стандартами чистоты кода Hotaru рабочие файлы .hmod не содержат строковых комментариев. Код документируется через строгую типизацию." - }, - { - "id": "complete-examples", - "title": "14. Готовые шаблоны модулей", - "summary": "Полные, проверенные и готовые к установке модули .hmod без использования системных команд ядра.", - "content": "Приведенные ниже примеры демонстрируют правильное проектирование модулей. Обратите внимание, что системные команды ядра вроде ping не используются.\n\n### Шаблон 1: Кодирование текста (.cipher)\n\n```python\nfrom __future__ import annotations\nimport base64\nfrom typing import TYPE_CHECKING\n\nif TYPE_CHECKING:\n from hotaru.response import ModuleContext\n\nasync def cipher_command(ctx: ModuleContext) -> None:\n text = ctx.raw_args.strip()\n if not text:\n await ctx.respond(ctx.t(\"missing_input\"))\n return\n encoded = base64.b64encode(text.encode(\"utf-8\")).decode(\"ascii\")\n await ctx.respond(f\"{encoded}\", parse_mode=\"html\")\n\nHOTARU = {\n \"id\": \"b64_cipher\",\n \"name\": \"Base64 Cipher\",\n \"version\": \"1.0.0\",\n \"capabilities\": [\"mt\"],\n \"commands\": {\n \"cipher\": cipher_command,\n },\n \"lexicon\": {\n \"en\": {\n \"missing_input\": \"Usage: .cipher \",\n },\n \"ru\": {\n \"missing_input\": \"Использование: .cipher <текст для кодирования>\",\n },\n },\n}\n```\n\n### Шаблон 2: Публикация сниппетов (.paste)\n\n```python\nfrom __future__ import annotations\nimport json\nfrom typing import TYPE_CHECKING\n\nif TYPE_CHECKING:\n from hotaru.response import ModuleContext\n\nasync def paste_command(ctx: ModuleContext) -> None:\n content = ctx.raw_args.strip()\n if not content and ctx.reply_message:\n content = ctx.reply_message.message.text\n if not content:\n await ctx.respond(ctx.t(\"empty_paste\"))\n return\n await ctx.typing(\"upload_document\")\n res = await ctx.net(\n \"https://paste.rs\",\n method=\"POST\",\n headers={\"Content-Type\": \"text/plain\"},\n data=content.encode(\"utf-8\"),\n )\n if res.status_code in (200, 201):\n url = res.text.strip()\n await ctx.respond(ctx.t(\"paste_success\", url=url))\n else:\n await ctx.respond(ctx.t(\"paste_error\"))\n\nHOTARU = {\n \"id\": \"paste_bin\",\n \"name\": \"Paste Bin Uploader\",\n \"version\": \"1.0.0\",\n \"capabilities\": [\"mt\", \"net\"],\n \"commands\": {\n \"paste\": paste_command,\n },\n \"lexicon\": {\n \"en\": {\n \"empty_paste\": \"Provide text or reply to a message with .paste\",\n \"paste_success\": \"Uploaded to pastebin: {url}\",\n \"paste_error\": \"Failed to upload snippet.\",\n },\n \"ru\": {\n \"empty_paste\": \"Укажите текст или ответьте на сообщение через .paste\",\n \"paste_success\": \"Сниппет опубликован: {url}\",\n \"paste_error\": \"Ошибка при публикации сниппета.\",\n },\n },\n}\n```" - } -]; diff --git a/src/data/docs.jsx b/src/data/docs.jsx new file mode 100644 index 0000000..ade0bd5 --- /dev/null +++ b/src/data/docs.jsx @@ -0,0 +1,819 @@ +export const DOCS_EN = [ + { + id: 'overview', + title: 'Overview', + summary: 'Hotaru is a Telegram userbot runtime that loads .hmod modules into isolated sandboxes.', + content: `![The Hotaru userbot banner from the upstream project](media/hotaru-banner.png) + +Hotaru is a Telegram userbot built on GoyGram, an asynchronous Python MTProto client with native Rust cryptography. The runtime owns the account session; modules are third-party code that the runtime loads, supervises and confines. + +### What the runtime provides + +- **Namespace isolation.** Every module runs in its own Linux namespaces (\`CLONE_NEWNS\`, \`CLONE_NEWIPC\`, \`CLONE_NEWUTS\`, \`CLONE_NEWNET\`), on a private tmpfs, as uid 65534 (\`nobody\`). Modules talk to the kernel over a UNIX pipe, never over a socket. +- **Explicit capabilities.** A module declares what it needs in its manifest: \`mt\`, \`state\`, \`net\`, \`files\`, \`shell\`, \`inline\`, \`modules\`, \`assets\`. \`logs\` and \`fetch\` are always granted. +- **Encrypted storage.** Session strings, database entries and authorization keys live in \`sanctuary/hotaru.vault\`, encrypted with AES-GCM. The kernel is the only reader. +- **FloodWait protection.** The \`shield\` module samples API call rates and pauses calls locally before Telegram applies a floodwait. +- **Multi-account supervisor.** One instance runs several accounts concurrently, each with its own MTProto session and isolated state. +- **Web dashboard.** Singularity runs on Node.js and Vite, serving system metrics, logs and module management on port 8787. It can also open as a Telegram Mini App through a Cloudflare Horizon tunnel. + +### Runtime shape + +The kernel boots, activates modules from the \`constellations/\` directory, and hands each one a context object. The context is the only surface a module sees: messaging helpers, state storage, screens, and the contextual Telegram operations. + +### The core underneath + +Hotaru inherits the transport and the cryptography from GoyGram. + +![The GoyGram mark](media/goygram-mark.png) + +The chart below is the upstream GoyGram TL codec benchmark. + +![GoyGram TL codec benchmark: 351270 operations per second for serialize sendMessage](media/goygram-codec.png)`, + }, + { + id: 'install', + title: 'Install', + summary: 'Requirements, the installer script, and the manual and container setups.', + content: `### Requirements + +- Linux on x86_64 or aarch64 +- Python 3.13 or newer +- A Telegram API ID and API Hash from my.telegram.org +- A bot token from @BotFather, for inline UI and Mini App access +- The \`uv\` package manager, installed by the setup script + +### Interactive installer + +\`\`\`bash +curl -fsSL https://raw.githubusercontent.com/HotaruProject/Hotaru/main/install.sh | bash +\`\`\` + +The script installs system packages, prompts for your Telegram credentials, and offers a deployment: a host systemd service, Docker Compose, or a Proxmox LXC container. + +### Docker Compose + +\`\`\`bash +git clone -b develop https://github.com/HotaruProject/Hotaru.git +cd Hotaru +docker compose run --rm hotaru +docker compose up -d +\`\`\` + +### Proxmox VE and LXC + +\`\`\`bash +git clone -b develop https://github.com/HotaruProject/Hotaru.git +cd Hotaru +bash lxc/create.sh +\`\`\` + +### Manual setup with uv + +\`\`\`bash +git clone -b develop https://github.com/HotaruProject/Hotaru.git +cd Hotaru +uv sync +uv run python -m hotaru +\`\`\` + +Keep \`sanctuary/\` and the \`hotaru.vault\` key private. They hold your active sessions and master encryption secrets.`, + }, + { + id: 'manifest', + title: 'Module manifest', + summary: 'The HOTARU dictionary, the first-statement rule, and every supported field.', + content: `A module is a Python file with the \`.hmod\` extension. The loader parses it with \`ast\` before any bytecode runs, so the manifest is read without executing the module. + +### The first-statement rule + +The file must begin with an assignment to \`HOTARU\` holding a literal mapping. Any statement before it, a non-literal value, or a mapping that is not a dictionary is a \`ModuleValidationError\`. + +\`\`\`python +HOTARU = { + "id": "clock", + "version": "1.0.0", + "commands": ["utc"], + "capabilities": [], +} +\`\`\` + +### Required fields + +| Field | Type | Rule | +| --- | --- | --- | +| \`id\` | string | Canonical module ID and default name. Non-empty, at most 128 characters, no slash or NUL. | +| \`version\` | string | Non-empty. | +| \`commands\` | list of strings | No empty entries and no whitespace inside a command. | +| \`capabilities\` | list of strings | Names from the capability registry. | + +### Optional fields + +| Field | Type | Meaning | +| --- | --- | --- | +| \`name\` | string | Optional display label; the runtime uses \`id\` when omitted. | +| \`watchers\` | list of strings | Watcher entry points the runtime subscribes. | +| \`tasks\` | dict | Background tasks. Each entry may set \`interval\` (seconds, default 60) and \`autostart\`. | +| \`aliases\` | dict | Alternative command names mapped to existing commands. | +| \`config_schema\` | dict | Settings the module exposes to the runtime settings editor. | +| \`lexicon\` | dict | Localized strings per language code, with \`description\` and \`commands\`. | +| \`requires\` | list of strings | Modules that must be present. | +| \`after\` | list of strings | Modules to activate after this one. | +| \`inline_commands\` | list of strings | Inline query entry points. | +| \`rise\` | string | Handler called right after activation. | +| \`fade\` | string | Handler called before unload, reload, or shutdown. | +| \`template_fields\` | dict | Fields published to other modules. At most 64. | +| \`banner\` | string | URL of a banner image, http or https. | +| \`bot_commands\` | list of strings | Commands registered with the auxiliary bot. | + +### Validation + +The loader checks identifiers, versions, command lists, configuration schemas, translation tables, published template fields, banner URLs, and dependency lists. A translation may only describe commands and inline commands that the module actually declares. The \`hotaru\` template namespace is reserved.`, + }, + { + id: 'capabilities', + title: 'Capabilities and security', + summary: 'The eight capability gates, the firewall rules, and the denylist.', + content: `A module receives only what its manifest asks for. + +### The capability gates + +| Capability | Grants | +| --- | --- | +| \`mt\` | Raw MTProto calls through \`ctx.tg.call\`. | +| \`state\` | Persistent key-value storage in the module namespace. | +| \`net\` | Outbound network access over http, https, ws, wss, tcp, tls and udp. | +| \`files\` | Read and write inside the module workspace. | +| \`shell\` | Command execution in the workspace. | +| \`inline\` | Query and drive inline bots. | +| \`modules\` | Load, unload, reload and inspect installed modules. | +| \`assets\` | The hidden assets storage. | + +\`logs\` and \`fetch\` are always granted: \`logs\` writes to the observatory log, \`fetch\` reads messages, entities and reply resolution. + +### The firewall + +While a module is running, an audit hook blocks three things: + +- Opening a path that resolves inside the protected storage, or any file ending in \`.vault\` or \`.session\`. The error is \`PermissionError: module access to Telegram session storage is denied\`. +- Importing \`goygram\`, \`hotaru\` or \`relay\` directly. Modules use the context proxies instead. +- Opening a socket directly. Network access goes through the \`net\` capability, or Telegram through the \`mt\` capability. + +### The denylist + +\`my.telegram.org\` is denied and read-only. Peer \`777000\` is protected and read-only: read calls return an empty result, and write calls are refused. Payload inspection walks nested structures, including encoded blobs, up to a complexity limit. + +### What the mt gate still refuses + +Even with \`mt\`, the \`auth.\` and \`phone.\` namespaces are blocked, every \`payments.\` and \`wallet.\` method is blocked, and account-security operations such as \`account.deleteAccount\`, \`account.resetAuthorizations\` and \`account.getPassword\` are refused. Modules cannot interact with Telegram consent screens.`, + }, + { + id: 'context', + title: 'The module context', + summary: 'What ctx exposes: messaging, state, files, screens, templates and diagnostics.', + content: `The context is the only object a module receives. It is created per command invocation. + +### Messaging + +| Member | Purpose | +| --- | --- | +| \`ctx.respond(content)\` | Send a reply to the current chat. | +| \`ctx.smart_respond(content)\` | Reply, splitting long text and falling back to a file when needed. | +| \`ctx.send_file(file, caption)\` | Send a file by path or bytes. | +| \`ctx.upload_file(source)\` | Upload a file and return its Telegram reference. | +| \`ctx.read_attachment_text(reply=True)\` | Read the text of the replied-to attachment. | +| \`ctx.download(attachment, destination)\` | Download an attachment to disk. | +| \`ctx.edit(text)\` | Edit the message that triggered the command. | +| \`ctx.paginate(content, page, limit)\` | Send a page of long content with navigation. | + +### State and configuration + +\`ctx.state\` is a namespace over SQLite. \`get\`, \`set\`, \`delete\`, \`keys\` and \`pointer\` work on values scoped to the module. \`ctx.config\` exposes the runtime settings editor, and \`ctx.modules\` lists the installed modules. + +### Templates and language + +\`ctx.render_template(key, **values)\` renders a published template field. \`ctx.t(key, default, **params)\` resolves a string from the active lexicon, falling back to the supplied default. + +### Diagnostics + +\`ctx.check_restrictions()\` reports what the current account may not do, such as premium-only features. \`ctx.classify_error(exc)\` turns an exception into a structured diagnosis. \`ctx.premium()\` and \`ctx.is_premium()\` report the premium state. + +### Module management + +\`ctx.load_module(source)\` and \`ctx.unload_module(module_id, purge=True)\` manage other modules. Both require the \`modules\` capability.`, + }, + { + id: 'screens', + title: 'Screens and forms', + summary: 'The Kit primitives that build interactive menus, pagers and input forms.', + content: `\`ctx.screens\` builds interactive screens: a message with inline buttons, a paginator, or an input request. A press is routed back to the handler that created it. + +### Primitives + +| Call | Result | +| --- | --- | +| \`ctx.screens.button(text, fn)\` | Neutral button. | +| \`ctx.screens.primary(text, fn)\` | Accent button for the main action. | +| \`ctx.screens.success(text, fn)\` | Confirmation button. | +| \`ctx.screens.danger(text, fn)\` | Destructive button. | +| \`ctx.screens.input(text, fn, placeholder)\` | Button that asks for text. | +| \`ctx.screens.copy(text, value)\` | Button that copies a value. | +| \`ctx.screens.url(text, link)\` | External link. | +| \`ctx.screens.webapp(text, link)\` | Telegram Mini App link. | +| \`ctx.screens.close()\` | Button that removes the screen. | +| \`ctx.screens.back(fn, text)\` | Button that returns to the previous screen. | + +### Showing a screen + +\`\`\`python +async def panel_cmd(ctx, invocation): + k = ctx.screens + + async def on_refresh(ctx, nav): + await render() + + async def render(): + rows = [[k.primary("Refresh", on_refresh), k.close()]] + await ctx.screens.show(k.screen("Gateway online", rows)) + + await render() +\`\`\` + +\`ctx.screens.screen(text, rows)\` builds the screen, and \`await ctx.screens.show(screen)\` sends it. A button handler receives the context and a navigation object; \`nav.answer(text)\` replies to the press and \`nav.ref().edit(screen)\` replaces the screen in place. + +### Paging and layout + +\`ctx.screens.pager(fn, page, pages)\` builds the page controls, \`ctx.screens.grid(items, columns)\` arranges buttons, and \`ctx.screens.footer(back)\` closes the row. \`ctx.screens.table(rows)\` renders a monospaced table, \`ctx.screens.radio\` and \`ctx.screens.check\` mark choices, and \`ctx.screens.icon\` and \`ctx.screens.module_icon\` resolve icons.`, + }, + { + id: 'tasks', + title: 'Tasks and lifecycle', + summary: 'rise and fade, supervised background tasks, and the limits the runtime enforces.', + content: `### rise and fade + +\`rise\` runs immediately after activation and capability binding. \`fade\` runs before an unload, a reload, or a shutdown. Both name a coroutine in the module. + +### Supervised tasks + +A task is declared in the manifest and its handler is named \`task_\`. + +\`\`\`python +HOTARU = { + "id": "metrics_exporter", + "version": "1.0.0", + "capabilities": ["state", "net"], + "commands": [], + "tasks": { + "sync_metrics": { + "interval": 60.0, + "autostart": True, + }, + }, +} + +async def task_sync_metrics(ctx): + pulse = await ctx.state.get("pulse", 0) + await ctx.state.set("pulse", pulse + 1) +\`\`\` + +The supervisor calls the handler, waits for it, then sleeps for \`interval\`. If the handler raises, the failure is logged once, the loop continues, and the runtime keeps running. + +### Limits + +The task supervisor allows 128 tasks in total and 16 per module. Exceeding either limit raises \`TaskLimitError\` and the coroutine is closed. Unloading a module cancels its tasks and waits up to five seconds for them to finish. Shutdown cancels everything and closes the supervisor. + +### Long-running work + +Work that does not fit the interval model can start a coroutine inside \`rise\`. The \`fade\` handler is the place to cancel it: the runtime calls \`fade\` before an unload, a reload or a shutdown.`, + }, + { + id: 'methods', + title: 'The 292 contextual methods', + summary: 'How the contextual Telegram operations resolve their arguments and where the boundary sits.', + content: `The context exposes 292 Telegram operations that need no capability at all. They are the contextual routes: the runtime fills in the current peer, the current message and the account, so a module writes one line instead of assembling a raw request. + +\`\`\`python +await ctx.set_checklist_completed(completed=[1], incompleted=[]) +\`\`\` + +### Argument resolution + +The gateway substitutes three values before the call reaches Telegram: + +| Placeholder | Resolves to | +| --- | --- | +| \`$peer\` | The current dialog. | +| \`$message\` | The current message. | +| \`$self\` | The account running the module. | + +A parameter marked required has no kernel default, so the module must pass it. + +### The boundary + +The contextual route does not bypass the rest of the system. Telegram's own ACL applies, the denylist applies, premium-only features still need premium, media and assets still need their capabilities, and outbound network still needs \`net\`. The \`mt\` capability is only needed for raw calls through \`ctx.tg.call\`, and even then the policy in the capabilities chapter applies. + +The full list, with signatures, parameter types and required flags, is in the Methods tab.`, + }, + { + id: 'modules', + title: 'The shipped modules', + summary: 'The fifteen modules in the constellations directory, with their commands and capabilities.', + content: `Each module is a manifest in \`constellations/\`. The commands and capability lists below are read from those manifests. + +| Module | Version | Commands | Capabilities | +| --- | --- | --- | --- | +| accounts | 2.0.0 | account, addaccount, accounts | mt | +| acl | 3.0.0 | perms, perm, whois, owadd, owrm, owls, sgls, sg, sgnew, sgdel, sgadd, sgrm, rule, rulerm, ruleclr | mt | +| backups | 1.2.0 | backup, restore | mt, state, files, modules | +| catalyst | 1.3.0 | ld, ul, rl, ex, resetdb | modules | +| executor | 3.4.0 | sh, py, kill | mt, files, net, state, assets | +| genesis | 1.1.0 | none, bot commands only | mt, state | +| help | 2.0.0 | help | mt | +| info | 2.2.0 | info, ping | mt, state | +| logger | 1.2.0 | logs, loglevel | mt, state | +| power | 1.5.0 | restart, stop, resume | mt | +| settings | 3.1.0 | config, alias, rmalias, lsalias, prefix | mt, state | +| shield | 1.0.0 | shield, suspend_api | mt, state | +| singularity | 2.0.1 | dash | mt | +| translations | 2.2.0 | language, translate, loadlex, rmlex | mt, net, files, state | +| updater | 2.0.0 | upd, updlog, updoff, updon | net, mt | + +### Lifecycle details worth knowing + +- \`power\` aliases \`unpause\` to \`resume\`. +- \`backups\` autostarts the \`send\` task every 60 seconds. +- \`logger\` autostarts the \`pump\` task every 2 seconds and hooks up on rise, unhooks on fade. +- \`updater\` autostarts the \`poller\` task every 300 seconds and calls \`afterglow\` on rise. +- \`genesis\` registers the bot commands \`start\` and \`github\`. +- \`shield\` describes itself as API flood and rate limit protection. + +### The daily commands + +| Command | Action | +| --- | --- | +| \`.help\` | Open the interactive module catalog and help cards. | +| \`.ping\` | Check MTProto gateway latency and connection health. | +| \`.dash\` | Generate the Singularity panel link and open the Mini App. | +| \`.addaccount\` | Add another account to the supervisor pool. | +| \`.shield\` | View API call rates and adjust the flood protection. | +| \`.config\` | Open the interactive runtime settings editor. | +| \`.backup\` | Create an encrypted archive of state and sessions. | +| \`.restart\` | Reload the kernel processes and active modules. |`, + }, + { + id: 'dashboard', + title: 'The dashboard', + summary: 'Singularity, the web panel and the Telegram Mini App.', + content: `Singularity is the embedded interface. The frontend is a Vite and React app that renders a live black hole and lets you fly the camera to four points of interest: the event horizon, the accretion disk, the photon ring and the Einstein ring. + +### Running it + +The panel serves on port 8787 and exposes system metrics, the observatory log tail, and module management. The bundle is rebuilt on every start, so a stale backend never serves an old panel. + +### Opening it in Telegram + +Hotaru can open a Cloudflare Horizon tunnel and register the panel with BotFather. From there the dashboard opens as a native Mini App inside Telegram. + +### Access + +The dashboard is owner-only. A request carries the Telegram \`initData\`, and the backend validates its HMAC-SHA256 signature against the bot token before any data is returned. Secrets are never logged. + +### The captured panel + +The image below is the running Singularity frontend, captured from the upstream build. + +![The Singularity panel: a ray-marched black hole with its accretion disk](media/singularity-panel.png)`, + }, + { + id: 'skill', + title: 'Module-writing reference', + summary: 'SKILL.md documents the Hotaru module contract and runtime API.', + content: `\`SKILL.md\` is the reference for Hotaru's module contract and runtime API. It is available as a single-file download. + +### What it contains + +- The contract for a module and the boundary between an external module and a built-in one. +- The manifest and its entry points, with the exact source file map. +- The catalogue of the 292 contextual operations, with signatures, positional order, parameter types and required flags. +- The 76 exports of the tools helper, grouped by purpose. +- The security model, the capability delegation rules, and the checks a module must pass. +- A minimal template for an external module and a final acceptance list. + +### Where it comes from + +The method cards are generated from the upstream sources rather than written by hand, and each card carries the SHA-256 of the file it was derived from. When the snapshot changes, the hashes change with it, so the reader can tell whether the reference still matches the code. + +### Language + +The guide is written in Russian, the language of the upstream project.`, + }, +]; + +export const DOCS_RU = [ + { + id: 'overview', + title: 'Обзор', + summary: 'Hotaru — среда выполнения Telegram-юзербота, которая загружает модули .hmod в изолированные песочницы.', + content: `![Баннер юзербота Hotaru из upstream-проекта](media/hotaru-banner.png) + +Hotaru — Telegram-юзербот на базе GoyGram, асинхронного Python-клиента MTProto с нативной криптографией на Rust. Среда выполнения владеет сессией аккаунта; модули — это сторонний код, который среда загружает, контролирует и изолирует. + +### Что даёт среда выполнения + +- **Изоляция namespaces.** Каждый модуль работает в собственных namespaces Linux (\`CLONE_NEWNS\`, \`CLONE_NEWIPC\`, \`CLONE_NEWUTS\`, \`CLONE_NEWNET\`), на личной tmpfs, под uid 65534 (\`nobody\`). С ядром модуль говорит через UNIX pipe, а не через сокет. +- **Явные владения.** Модуль объявляет нужное в манифесте: \`mt\`, \`state\`, \`net\`, \`files\`, \`shell\`, \`inline\`, \`modules\`, \`assets\`. \`logs\` и \`fetch\` выдаются всегда. +- **Зашифрованное хранилище.** Строки сессии, записи баз и ключи авторизации лежат в \`sanctuary/hotaru.vault\`, зашифрованные AES-GCM. Единственный читатель — ядро. +- **Защита от флудвейта.** Модуль \`shield\` снимает частоту вызовов API и приостанавливает их до того, как Telegram применит флудвейт. +- **Супервизор нескольких аккаунтов.** Один экземпляр ведёт несколько аккаунтов одновременно, у каждого своя сессия MTProto и изолированное состояние. +- **Веб-панель.** Singularity работает на Node.js и Vite, отдаёт метрики системы, логи и управление модулями на порту 8787. Панель также открывается как Mini App в Telegram через туннель Cloudflare Horizon. + +### Устройство среды + +Ядро стартует, активирует модули из каталога \`constellations/\` и передаёт каждому объект контекста. Контекст — единственная поверхность, которую видит модуль: помощники для сообщений, хранилище состояния, экраны и контекстные операции Telegram. + +### Основа + +Hotaru наследует транспорт и криптографию от GoyGram. + +![Знак GoyGram](media/goygram-mark.png) + +На графике ниже — бенчмарк TL-кодек GoyGram из upstream-репозитория. + +![Бенчмарк TL-кодек GoyGram: 351270 операций в секунду на serialize sendMessage](media/goygram-codec.png)`, + }, + { + id: 'install', + title: 'Установка', + summary: 'Требования, скрипт установки, ручная сборка и контейнеры.', + content: `### Требования + +- Linux на x86_64 или aarch64 +- Python 3.13 или новее +- Telegram API ID и API Hash с my.telegram.org +- Токен бота от @BotFather — для inline-интерфейса и Mini App +- Пакетный менеджер \`uv\`, который ставит установочный скрипт + +### Интерактивная установка + +\`\`\`bash +curl -fsSL https://raw.githubusercontent.com/HotaruProject/Hotaru/main/install.sh | bash +\`\`\` + +Скрипт ставит системные пакеты, спрашивает учётные данные Telegram и предлагает способ развёртывания: systemd-сервис на хосте, Docker Compose или контейнер Proxmox LXC. + +### Docker Compose + +\`\`\`bash +git clone -b develop https://github.com/HotaruProject/Hotaru.git +cd Hotaru +docker compose run --rm hotaru +docker compose up -d +\`\`\` + +### Proxmox VE и LXC + +\`\`\`bash +git clone -b develop https://github.com/HotaruProject/Hotaru.git +cd Hotaru +bash lxc/create.sh +\`\`\` + +### Ручная сборка через uv + +\`\`\`bash +git clone -b develop https://github.com/HotaruProject/Hotaru.git +cd Hotaru +uv sync +uv run python -m hotaru +\`\`\` + +Держите \`sanctuary/\` и ключ \`hotaru.vault\` в тайне: в них активные сессии и главные секреты шифрования.`, + }, + { + id: 'manifest', + title: 'Манифест модуля', + summary: 'Словарь HOTARU, правило первого оператора и все поддерживаемые поля.', + content: `Модуль — это Python-файл с расширением \`.hmod\`. Загрузчик разбирает его через \`ast\` до запуска байткода, поэтому манифест читается без исполнения модуля. + +### Правило первого оператора + +Файл должен начинаться с присваивания \`HOTARU\`, которому задаётся литеральный словарь. Любой оператор до него, нелитеральное значение или не словарь приводят к \`ModuleValidationError\`. + +\`\`\`python +HOTARU = { + "id": "clock", + "version": "1.0.0", + "commands": ["utc"], + "capabilities": [], +} +\`\`\` + +### Обязательные поля + +| Поле | Тип | Правило | +| --- | --- | --- | +| \`id\` | строка | Канонический ID и имя модуля по умолчанию. Не пусто, не длиннее 128 символов, без слэша и NUL. | +| \`version\` | строка | Не пусто. | +| \`commands\` | список строк | Без пустых записей и без пробелов внутри команды. | +| \`capabilities\` | список строк | Имена из реестра владений. | + +### Необязательные поля + +| Поле | Тип | Значение | +| --- | --- | --- | +| \`name\` | строка | Необязательная подпись для отображения; если её нет, среда использует \`id\`. | +| \`watchers\` | список строк | Точки входа наблюдателей, на которые подписывается среда. | +| \`tasks\` | словарь | Фоновые задачи. У каждой можно задать \`interval\` (секунды, по умолчанию 60) и \`autostart\`. | +| \`aliases\` | словарь | Другие имена команд, отображаемые на существующие. | +| \`config_schema\` | словарь | Настройки модуля для редактора настроек среды. | +| \`lexicon\` | словарь | Локализованные строки по кодам языков, с \`description\` и \`commands\`. | +| \`requires\` | список строк | Модули, которые должны быть на месте. | +| \`after\` | список строк | Модули, активируемые после этого. | +| \`inline_commands\` | список строк | Точки входа inline-запросов. | +| \`rise\` | строка | Обработчик, вызываемый сразу после активации. | +| \`fade\` | строка | Обработчик перед выгрузкой, перезагрузкой или остановкой. | +| \`template_fields\` | словарь | Поля, публикуемые другим модулям. Не больше 64. | +| \`banner\` | строка | URL баннера, http или https. | +| \`bot_commands\` | список строк | Команды, регистрируемые у вспомогательного бота. | + +### Проверки + +Загрузчик проверяет идентификаторы, версии, списки команд, схемы конфигурации, таблицы переводов, публикуемые поля шаблонов, URL баннеров и списки зависимостей. Перевод может описывать только те команды и inline-команды, которые модуль действительно объявляет. Пространство шаблонов \`hotaru\` зарезервировано.`, + }, + { + id: 'capabilities', + title: 'Владения и безопасность', + summary: 'Восемь ворот доступа, правила файрвола и список запрещённых целей.', + content: `Модуль получает только то, что запросил в манифесте. + +### Ворота доступа + +| Владение | Что даёт | +| --- | --- | +| \`mt\` | Прямые вызовы MTProto через \`ctx.tg.call\`. | +| \`state\` | Постоянное хранилище «ключ — значение» в пространстве модуля. | +| \`net\` | Исходящая сеть по http, https, ws, wss, tcp, tls и udp. | +| \`files\` | Чтение и запись внутри рабочего каталога модуля. | +| \`shell\` | Выполнение команд в рабочем каталоге. | +| \`inline\` | Запрос и управление inline-ботами. | +| \`modules\` | Загрузка, выгрузка, перезагрузка и просмотр модулей. | +| \`assets\` | Скрытое хранилище ресурсов. | + +\`logs\` и \`fetch\` выдаются всегда: \`logs\` пишет в журнал обсерватории, \`fetch\` читает сообщения, сущности и разрешает ответы. + +### Файрвол + +Пока модуль работает, аудит-хук блокирует три вещи: + +- Открытие пути, который попадает в защищённое хранилище, или любого файла с окончанием \`.vault\` или \`.session\`. Ошибка: \`PermissionError: module access to Telegram session storage is denied\`. +- Прямой импорт \`goygram\`, \`hotaru\` или \`relay\`. Вместо них модуль использует прокси контекста. +- Прямое открытие сокета. Сеть идёт через владение \`net\`, Telegram — через \`mt\`. + +### Список запрещённых целей + +\`my.telegram.org\` запрещён и доступен только для чтения. Peer \`777000\` защищён и доступен только для чтения: чтение возвращает пустой результат, запись отклоняется. Проверка payload обходит вложенные структуры, включая закодированные блобы, с ограничением на сложность. + +### Что \`mt\` всё равно не пропускает + +Даже с \`mt\` пространства имён \`auth.\` и \`phone.\` заблокированы, все методы \`payments.\` и \`wallet.\` заблокированы, а операции безопасности аккаунта — \`account.deleteAccount\`, \`account.resetAuthorizations\`, \`account.getPassword\` — отклоняются. Модули не могут взаимодействовать с экранами согласия Telegram.`, + }, + { + id: 'context', + title: 'Контекст модуля', + summary: 'Что доступно в ctx: сообщения, состояние, файлы, экраны, шаблоны и диагностика.', + content: `Контекст — единственный объект, который получает модуль. Он создаётся на каждый вызов команды. + +### Сообщения + +| Член | Назначение | +| --- | --- | +| \`ctx.respond(content)\` | Ответить в текущий чат. | +| \`ctx.smart_respond(content)\` | Ответить, разбив длинный текст и при необходимости отдав файл. | +| \`ctx.send_file(file, caption)\` | Отправить файл по пути или байтам. | +| \`ctx.upload_file(source)\` | Загрузить файл и вернуть ссылку Telegram. | +| \`ctx.read_attachment_text(reply)\` | Прочитать текст вложения, на которое вы ответили. | +| \`ctx.download(attachment, destination)\` | Скачать вложение на диск. | +| \`ctx.edit(text)\` | Отредактировать сообщение, вызвавшее команду. | +| \`ctx.paginate(content, page, limit)\` | Отправить страницу длинного содержимого с навигацией. | + +### Состояние и конфигурация + +\`ctx.state\` — пространство имён поверх SQLite. Методы \`get\`, \`set\`, \`delete\`, \`keys\` и \`pointer\` работают со значениями в области модуля. \`ctx.config\` открывает редактор настроек среды, \`ctx.modules\` показывает установленные модули. + +### Шаблоны и язык + +\`ctx.render_template(key, **values)\` отрисовывает опубликованное поле шаблона. \`ctx.t(key, default, **params)\` берёт строку из активного лексикона, а при отсутствии — переданное значение по умолчанию. + +### Диагностика + +\`ctx.check_restrictions()\` сообщает, что текущий аккаунт делать не может, например функции только для Premium. \`ctx.classify_error(exc)\` превращает исключение в структурированный разбор. \`ctx.premium()\` и \`ctx.is_premium()\` отвечают про состояние Premium. + +### Управление модулями + +\`ctx.load_module(source)\` и \`ctx.unload_module(module_id, purge=True)\` управляют другими модулями. Для обоих нужно владение \`modules\`.`, + }, + { + id: 'screens', + title: 'Экраны и формы', + summary: 'Примитивы Kit для интерактивных меню, пагинаторов и запросов ввода.', + content: `\`ctx.screens\` собирает интерактивные экраны: сообщение с inline-кнопками, пагинатор или запрос ввода. Нажатие возвращается в обработчик, который создал экран. + +### Примитивы + +| Вызов | Результат | +| --- | --- | +| \`ctx.screens.button(text, fn)\` | Нейтральная кнопка. | +| \`ctx.screens.primary(text, fn)\` | Акцентная кнопка главного действия. | +| \`ctx.screens.success(text, fn)\` | Кнопка подтверждения. | +| \`ctx.screens.danger(text, fn)\` | Кнопка разрушительного действия. | +| \`ctx.screens.input(text, fn, placeholder)\` | Кнопка, запрашивающая текст. | +| \`ctx.screens.copy(text, value)\` | Кнопка, копирующая значение. | +| \`ctx.screens.url(text, link)\` | Внешняя ссылка. | +| \`ctx.screens.webapp(text, link)\` | Ссылка на Mini App. | +| \`ctx.screens.close()\` | Кнопка, удаляющая экран. | +| \`ctx.screens.back(fn, text)\` | Кнопка возврата к предыдущему экрану. | + +### Показ экрана + +\`\`\`python +async def panel_cmd(ctx, invocation): + k = ctx.screens + + async def on_refresh(ctx, nav): + await render() + + async def render(): + rows = [[k.primary("Refresh", on_refresh), k.close()]] + await ctx.screens.show(k.screen("Gateway online", rows)) + + await render() +\`\`\` + +\`ctx.screens.screen(text, rows)\` собирает экран, а \`await ctx.screens.show(screen)\` отправляет его. Обработчик кнопки получает контекст и объект навигации: \`nav.answer(text)\` отвечает на нажатие, а \`nav.ref().edit(screen)\` перерисовывает экран на месте. + +### Пагинация и вёрстка + +\`ctx.screens.pager(fn, page, pages)\` собирает переключатель страниц, \`ctx.screens.grid(items, columns)\` раскладывает кнопки, \`ctx.screens.footer(back)\` закрывает ряд. \`ctx.screens.table(rows)\` рисует моноширинную таблицу, \`ctx.screens.radio\` и \`ctx.screens.check\` отмечают выбор, \`ctx.screens.icon\` и \`ctx.screens.module_icon\` возвращают иконки.`, + }, + { + id: 'tasks', + title: 'Задачи и жизненный цикл', + summary: 'rise и fade, фоновые задачи под надзором и пределы, которые держит среда.', + content: `### rise и fade + +\`rise\` выполняется сразу после активации и привязки владений. \`fade\` — перед выгрузкой, перезагрузкой или остановкой. Оба имени называют корутину модуля. + +### Задачи под надзором + +Задача объявляется в манифесте, а её обработчик называется \`task_\`. + +\`\`\`python +HOTARU = { + "id": "metrics_exporter", + "version": "1.0.0", + "capabilities": ["state", "net"], + "commands": [], + "tasks": { + "sync_metrics": { + "interval": 60.0, + "autostart": True, + }, + }, +} + +async def task_sync_metrics(ctx): + pulse = await ctx.state.get("pulse", 0) + await ctx.state.set("pulse", pulse + 1) +\`\`\` + +Супервизор вызывает обработчик, ждёт его и затем спит \`interval\` секунд. Если обработчик бросает исключение, ошибка пишется в журнал один раз, цикл продолжается, а среда выполнения остаётся рабочей. + +### Пределы + +Супервизор допускает 128 задач всего и 16 на модуль. Превышение любого предела поднимает \`TaskLimitError\`, а корутина закрывается. При выгрузке модуля его задачи отменяются, и супервизор ждёт их до пяти секунд. При остановке отменяется всё, супервизор закрывается. + +### Долгая работа + +Работа, которая не укладывается в интервальную модель, запускается корутиной внутри \`rise\`. Отменять её нужно в обработчике \`fade\`: среда вызывает его перед выгрузкой, перезагрузкой или остановкой.`, + }, + { + id: 'methods', + title: '292 контекстных метода', + summary: 'Как контекстные операции Telegram подставляют аргументы и где проходит граница.', + content: `В контексте доступны 292 операции Telegram, которым не нужно ни одного владения. Это контекстные маршруты: среда подставляет текущий диалог, текущее сообщение и аккаунт, поэтому модуль пишет одну строку вместо сборки сырого запроса. + +\`\`\`python +await ctx.set_checklist_completed(completed=[1], incompleted=[]) +\`\`\` + +### Подстановка аргументов + +Шлюз подставляет три значения до того, как вызов уйдёт в Telegram: + +| Подстановка | Что означает | +| --- | --- | +| \`$peer\` | Текущий диалог. | +| \`$message\` | Текущее сообщение. | +| \`$self\` | Аккаунт, от имени которого работает модуль. | + +Параметр, помеченный обязательным, не имеет умолчания ядра, поэтому модуль обязан передать его сам. + +### Граница + +Контекстный маршрут не обходит остальную систему. Действуют собственные права Telegram, список запрещённых целей, функции только для Premium по-прежнему требуют Premium, медиа и ресурсы требуют своих владений, а исходящая сеть — владения \`net\`. Владение \`mt\` нужно только для сырых вызовов через \`ctx.tg.call\`, и даже там действует политика из главы о владениях. + +Полный список с сигнатурами, типами параметров и отметками обязательности — во вкладке «Методы».`, + }, + { + id: 'modules', + title: 'Штатные модули', + summary: 'Пятнадцать модулей каталога constellations с их командами и владениями.', + content: `Каждый модуль — это манифест в каталоге \`constellations/\`. Команды и списки владений ниже прочитаны прямо из этих манифестов. + +| Модуль | Версия | Команды | Владения | +| --- | --- | --- | --- | +| accounts | 2.0.0 | account, addaccount, accounts | mt | +| acl | 3.0.0 | perms, perm, whois, owadd, owrm, owls, sgls, sg, sgnew, sgdel, sgadd, sgrm, rule, rulerm, ruleclr | mt | +| backups | 1.2.0 | backup, restore | mt, state, files, modules | +| catalyst | 1.3.0 | ld, ul, rl, ex, resetdb | modules | +| executor | 3.4.0 | sh, py, kill | mt, files, net, state, assets | +| genesis | 1.1.0 | none, bot commands only | mt, state | +| help | 2.0.0 | help | mt | +| info | 2.2.0 | info, ping | mt, state | +| logger | 1.2.0 | logs, loglevel | mt, state | +| power | 1.5.0 | restart, stop, resume | mt | +| settings | 3.1.0 | config, alias, rmalias, lsalias, prefix | mt, state | +| shield | 1.0.0 | shield, suspend_api | mt, state | +| singularity | 2.0.1 | dash | mt | +| translations | 2.2.0 | language, translate, loadlex, rmlex | mt, net, files, state | +| updater | 2.0.0 | upd, updlog, updoff, updon | net, mt | + +### Детали жизненного цикла, о которых стоит знать + +- \`power\` связывает \`unpause\` с \`resume\`. +- \`backups\` сам запускает задачу \`send\` каждые 60 секунд. +- \`logger\` сам запускает задачу \`pump\` каждые 2 секунды, подписывается на rise и отписывается на fade. +- \`updater\` сам запускает задачу \`poller\` каждые 300 секунд и вызывает \`afterglow\` на rise. +- \`genesis\` регистрирует команды бота \`start\` и \`github\`. +- \`shield\` описывает себя как защиту от флудвейта и перегрузки API. + +### Ежедневные команды + +| Команда | Действие | +| --- | --- | +| \`.help\` | Открыть интерактивный каталог модулей и карточки помощи. | +| \`.ping\` | Проверить задержку шлюза MTProto и состояние соединения. | +| \`.dash\` | Получить ссылку на панель Singularity и открыть Mini App. | +| \`.addaccount\` | Добавить ещё один аккаунт в пул супервизора. | +| \`.shield\` | Посмотреть частоту вызовов API и настроить защиту от флуда. | +| \`.config\` | Открыть интерактивный редактор настроек среды. | +| \`.backup\` | Создать зашифрованный архив состояния и сессий. | +| \`.restart\` | Перезагрузить процессы ядра и активные модули. |`, + }, + { + id: 'dashboard', + title: 'Панель управления', + summary: 'Singularity: веб-панель и Mini App в Telegram.', + content: `Singularity — встроенный интерфейс. Фронтенд на Vite и React рисует живую чёрную дыру и позволяет подвести камеру к четырём точкам: горизонт событий, аккреционный диск, фотонное кольцо и кольцо Эйнштейна. + +### Как запускается + +Панель отдаёт метрики системы, хвост журнала обсерватории и управление модулями на порту 8787. Бандл пересобирается при каждом старте, поэтому устаревший бэкенд не отдаёт старую панель. + +### Открытие в Telegram + +Hotaru может поднять туннель Cloudflare Horizon и зарегистрировать панель у BotFather. После этого дашборд открывается как нативное Mini App внутри Telegram. + +### Доступ + +Панель доступна только владельцу. Запрос несёт Telegram \`initData\`, а бэкенд проверяет его подпись HMAC-SHA256 токеном бота, прежде чем вернуть хоть какие-то данные. Секреты не пишутся в журнал. + +### Захваченная панель + +На изображении ниже — работающий фронтенд Singularity, снятый с upstream-сборки. + +![Панель Singularity: чёрная дыра с аккреционным диском, отрисованная реймарчем](media/singularity-panel.png)`, + }, + { + id: 'skill', + title: 'Справочник по разработке модулей', + summary: 'SKILL.md описывает контракт модулей Hotaru и API среды выполнения.', + content: `\`SKILL.md\` — справочник по контракту модулей и реальному API Hotaru. Он доступен для скачивания одним файлом. + +### Что внутри + +- Контракт модуля и граница между внешним модулем и встроенным. +- Манифест и точки входа с точной картой исходников. +- Каталог 292 контекстных операций с сигнатурами, порядком позиционных аргументов, типами параметров и отметками обязательности. +- 76 экспортов помощника tools, сгруппированных по назначению. +- Модель безопасности, правила делегирования владений и проверки, которые модуль обязан пройти. +- Минимальный шаблон внешнего модуля и финальный список приёмки. + +### Откуда это взято + +Карточки методов генерируются из исходников upstream, а не пишутся вручную, и каждая карточка несёт SHA-256 файла, из которого получена. Когда снимок меняется, меняются и хеши, поэтому читатель понимает, совпадает ли справочник с кодом. + +### Язык + +Руководство написано по-русски, как и сам проект.`, + }, +]; diff --git a/src/data/modules.jsx b/src/data/modules.jsx new file mode 100644 index 0000000..aa8fc7c --- /dev/null +++ b/src/data/modules.jsx @@ -0,0 +1,165 @@ +export const MODULES = [ + { + id: 'accounts', + version: '2.0.0', + commands: ['account', 'addaccount', 'accounts'], + caps: ['mt'], + role: { + en: 'Several accounts, each with its own session.', + ru: 'Несколько аккаунтов, у каждого своя сессия.', + }, + }, + { + id: 'acl', + version: '3.0.0', + commands: ['perms', 'whois', 'rule', 'sg', 'ruleclr'], + caps: ['mt'], + role: { + en: 'Owners, permission rules and security groups.', + ru: 'Владельцы, правила прав и группы безопасности.', + }, + }, + { + id: 'backups', + version: '1.2.0', + commands: ['backup', 'restore'], + caps: ['mt', 'state', 'files', 'modules'], + role: { + en: 'Encrypted archives of state and sessions.', + ru: 'Зашифрованные архивы состояния и сессий.', + }, + }, + { + id: 'catalyst', + version: '1.3.0', + commands: ['ld', 'ul', 'rl', 'ex', 'resetdb'], + caps: ['modules'], + role: { + en: 'Loads, unloads and hot reloads modules on the fly.', + ru: 'Загрузка, выгрузка и горячая перезагрузка модулей.', + }, + }, + { + id: 'executor', + version: '3.4.0', + commands: ['sh', 'py', 'kill'], + caps: ['mt', 'files', 'net', 'state', 'assets'], + role: { + en: 'Runs shell and Python in the sandbox, with its own limits.', + ru: 'Запуск shell и Python в песочнице, с собственными лимитами.', + }, + }, + { + id: 'genesis', + version: '1.1.0', + commands: ['start', 'github'], + caps: ['mt', 'state'], + role: { + en: 'The entry point: start, repository links, owner check.', + ru: 'Точка входа: старт, ссылки на репозиторий, проверка владельца.', + }, + }, + { + id: 'help', + version: '2.0.0', + commands: ['help'], + caps: ['mt'], + role: { + en: 'The module catalog and the command cards.', + ru: 'Каталог модулей и карточки команд.', + }, + }, + { + id: 'info', + version: '2.2.0', + commands: ['info', 'ping'], + caps: ['mt', 'state'], + role: { + en: 'Gateway latency, uptime and a status card.', + ru: 'Задержка шлюза, аптайм и статусная карточка.', + }, + }, + { + id: 'logger', + version: '1.2.0', + commands: ['logs', 'loglevel'], + caps: ['mt', 'state'], + role: { + en: 'A live log pump with a level switch per module.', + ru: 'Живая лента логов с переключателем уровня на модуль.', + }, + }, + { + id: 'power', + version: '1.5.0', + commands: ['restart', 'stop', 'resume'], + caps: ['mt'], + role: { + en: 'Restarts, stops and resumes the kernel with its modules.', + ru: 'Перезапуск, остановка и возобновление ядра с модулями.', + }, + }, + { + id: 'settings', + version: '3.1.0', + commands: ['config', 'alias', 'rmalias', 'lsalias', 'prefix'], + caps: ['mt', 'state'], + role: { + en: 'Runtime settings, aliases and the command prefix.', + ru: 'Настройки, алиасы и префикс команд.', + }, + }, + { + id: 'shield', + version: '1.0.0', + commands: ['shield', 'suspend_api'], + caps: ['mt', 'state'], + role: { + en: 'Flood and rate limit protection.', + ru: 'Защита от флуда и лимитов API.', + }, + }, + { + id: 'singularity', + version: '2.0.1', + commands: ['dash'], + caps: ['mt'], + role: { + en: 'Opens the control panel: dashboard and Telegram Mini App.', + ru: 'Открывает панель: дашборд и Mini App в Telegram.', + }, + }, + { + id: 'translations', + version: '2.2.0', + commands: ['language', 'translate', 'loadlex', 'rmlex'], + caps: ['mt', 'net', 'files', 'state'], + role: { + en: 'Interface languages and lexicons, loaded on demand.', + ru: 'Языки интерфейса и лексионы, подгружаются по запросу.', + }, + }, + { + id: 'updater', + version: '2.0.0', + commands: ['upd', 'updlog', 'updoff', 'updon'], + caps: ['net', 'mt'], + role: { + en: 'Checks for new releases and applies them on demand.', + ru: 'Проверяет релизы и ставит их по запросу.', + }, + }, +]; + +export function manifestOf(module) { + const commands = module.commands.map((c) => `"${c}"`).join(', '); + const caps = module.caps.map((c) => `"${c}"`).join(', '); + return [ + 'HOTARU = {', + ` "id": "${module.id}",`, + ` "version": "${module.version}",`, + ` "commands": [${commands}],`, + ` "capabilities": [${caps}],`, + '}', + ].join('\n'); +} diff --git a/src/index.css b/src/index.css index a473bce..fea0401 100644 --- a/src/index.css +++ b/src/index.css @@ -1,89 +1,1367 @@ +@import "./tokens.css"; +@import "./base.css" layer(base); + @tailwind base; @tailwind components; @tailwind utilities; -@layer base { - html { - scroll-behavior: smooth; - -webkit-tap-highlight-color: transparent; +@layer components { + + .btn { + position: relative; + isolation: isolate; + display: inline-flex; + align-items: center; + justify-content: center; + gap: var(--space-xs); + min-height: 48px; + padding: 0 var(--space-lg); + border: 1px solid var(--color-rule-2); + border-radius: var(--radius-control); + background: var(--color-paper-2); + color: oklch(93% 0 0); + font: 500 var(--text-md)/1 var(--font-body); + white-space: nowrap; + text-decoration: none; + cursor: pointer; + text-shadow: 0 0 20px oklch(100% 0 0 / 0.34); + box-shadow: var(--glow-md), var(--glow-edge), var(--aura-control); + transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out), text-shadow var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out); } - body { - background-color: #050508; - color: #ffffff; - overflow-x: hidden; + .btn:hover { + background: var(--color-paper-3); + border-color: var(--color-ink-2); + box-shadow: var(--glow-md), var(--glow-edge), var(--aura-control-lit); + color: oklch(95% 0 0); + text-shadow: 0 0 22px oklch(100% 0 0 / 0.4); } -} + .btn:active { transform: translateY(1px); } + .btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; } + .btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; } + .btn--quiet { background: transparent; color: var(--color-ink-2); border-color: var(--color-rule-2); font-weight: 400; box-shadow: var(--aura-control); text-shadow: none; } + .btn--quiet:hover { background: var(--color-paper-3); border-color: var(--color-ink-2); box-shadow: var(--glow-sm), var(--glow-edge), var(--aura-control-lit); color: var(--color-ink); } + .btn--sm { min-height: 40px; padding: 0 var(--space-md); font-size: var(--text-sm); } -::selection { - background-color: #ffffff; - color: #050508; -} + .link { + display: inline-flex; + align-items: center; + gap: var(--space-xs); + min-height: 44px; + color: var(--color-ink-2); + text-decoration: underline; + text-decoration-color: var(--color-rule-2); + text-underline-offset: 0.25em; + transition: color var(--dur-short) var(--ease-out), text-decoration-color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out); + } + .link:hover { color: var(--color-ink); text-decoration-color: var(--color-accent); } + .link:active { transform: scale(0.99); } + .link:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; } -::-webkit-scrollbar { - width: 6px; - height: 6px; -} + .tab { + display: inline-flex; + align-items: center; + gap: var(--space-xs); + min-height: 44px; + padding: 0 var(--space-sm); + border-radius: var(--radius-control); + color: var(--color-muted); + font-size: var(--text-sm); + white-space: nowrap; + transition: background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out); + } + .tab:hover { color: var(--color-ink); background: var(--color-paper-3); box-shadow: var(--glow-xs), var(--aura-control-lit); } + .tab:active { transform: scale(0.96); } + .tab:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; } + .tab[aria-pressed="true"], .tab[aria-current="true"] { + color: var(--color-ink); + background: var(--color-paper-3); + box-shadow: inset 0 -1px 0 oklch(100% 0 0 / 0.38), 0 0 20px oklch(100% 0 0 / 0.10); + text-shadow: 0 0 16px oklch(100% 0 0 / 0.24); + } + .tab:disabled { opacity: 0.55; cursor: not-allowed; } -::-webkit-scrollbar-track { - background: #050508; -} + .lang-switch { + display: inline-flex; + align-items: center; + gap: 2px; + padding: 2px; + border: 1px solid oklch(100% 0 0 / 0.08); + border-radius: var(--radius-control); + background: oklch(0% 0 0 / 0.28); + } + .lang-switch .tab { + min-height: 34px; + padding: 0 var(--space-sm); + border-radius: calc(var(--radius-control) - 4px); + font-size: var(--text-xs); + font-family: var(--font-outlier); + letter-spacing: 0.04em; + } + .lang-switch .tab[aria-pressed="true"] { + background: oklch(100% 0 0 / 0.12); + box-shadow: inset 0 1px 0 oklch(100% 0 0 / 0.22), 0 0 16px oklch(100% 0 0 / 0.14), var(--aura-control-lit); + } + .lang-switch .tab[aria-pressed="true"]:hover { background: oklch(100% 0 0 / 0.14); } -::-webkit-scrollbar-thumb { - background: rgba(255, 255, 255, 0.16); - border-radius: 9999px; -} + .hero__body { position: relative; z-index: var(--z-raised); } -::-webkit-scrollbar-thumb:hover { - background: rgba(255, 255, 255, 0.35); -} + @media (min-width: 48rem) { + .hero { justify-content: flex-end; } + .hero__body { padding-top: 0; } + } -.no-scrollbar::-webkit-scrollbar { - display: none; -} -.no-scrollbar { - -ms-overflow-style: none; - scrollbar-width: none; -} + @media (max-width: 47.99rem) { + .hero { flex: 1 1 auto; } + } -@keyframes floatSlow { - 0%, 100% { - transform: translateY(0px); + .wordmark { + position: relative; + display: inline-block; + text-shadow: + 0 0 4px oklch(100% 0 0 / 0.42), + -4px 0 16px oklch(100% 0 0 / 0.28), + 4px 0 16px oklch(100% 0 0 / 0.28), + 0 0 18px oklch(100% 0 0 / 0.30), + 0 0 44px oklch(100% 0 0 / 0.16), + 0 0 90px oklch(100% 0 0 / 0.08); } - 50% { - transform: translateY(-8px); + .wordmark::after { + content: attr(data-text); + position: absolute; + inset: 0; + display: flex; + align-items: center; + pointer-events: none; + background: linear-gradient( + 102deg, + transparent 18%, + oklch(100% 0 0 / 0.92) 46%, + oklch(100% 0 0 / 0.55) 56%, + transparent 82% + ); + background-size: 320% 100%; + background-position: 150% 0; + -webkit-background-clip: text; + background-clip: text; + color: transparent; + opacity: 0; + animation: wordmark-sweep 7.5s var(--ease-out) infinite; + } + @keyframes wordmark-sweep { + 0% { background-position: 150% 0; opacity: 0; } + 6% { opacity: 1; } + 38% { background-position: -60% 0; opacity: 1; } + 46%, 100% { background-position: -60% 0; opacity: 0; } + } + @media (prefers-reduced-motion: reduce) { + .wordmark::after { animation: none; opacity: 0; } } -} -@keyframes glowPulse { - 0%, 100% { - opacity: 0.35; - transform: scale(1); + .hero__actions { + display: flex; + flex-wrap: wrap; + align-items: center; + gap: var(--space-md) var(--space-lg); } - 50% { - opacity: 0.65; - transform: scale(1.04); + .link-arrow { + display: inline-flex; + align-items: center; + gap: var(--space-xs); + min-height: 48px; + padding: 0 var(--space-md); + border: 1px solid transparent; + border-radius: var(--radius-control); + color: var(--color-ink-2); + font: 500 var(--text-md)/1 var(--font-body); + text-decoration: none; + white-space: nowrap; + transition: color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out), text-shadow var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out); + } + .link-arrow:hover { + color: var(--color-ink); + border-color: oklch(100% 0 0 / 0.14); + background: oklch(100% 0 0 / 0.04); + text-shadow: var(--glow-text); + } + .link-arrow:active { transform: scale(0.98); } + .link-arrow:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; } + .link-arrow__icon { transition: transform var(--dur-short) var(--ease-out); } + .link-arrow:hover .link-arrow__icon { transform: translate(3px, -3px); } + + .hero-scrim { + background: linear-gradient(to top, var(--color-paper) 0%, var(--color-paper) 26%, transparent 64%); + } + @media (max-width: 48rem) { + .hero-scrim { background: linear-gradient(to top, var(--color-paper) 0%, var(--color-paper) 34%, transparent 66%); } + } + @media (max-height: 560px) { + .hero__body.hero__body { padding-top: 62svh; } } -} -@keyframes fadeIn { - from { + .nav-head { + transition: transform 320ms var(--ease-out), opacity 240ms var(--ease-out); + } + .nav-head--hidden { + transform: translateY(calc(-100% - var(--space-sm))); opacity: 0; - transform: translateY(6px); } - to { - opacity: 1; - transform: translateY(0); + .nav-pill { + position: relative; + overflow: hidden; + border: 1px solid oklch(100% 0 0 / 0.12); + border-radius: var(--radius-panel); + background: linear-gradient(180deg, oklch(100% 0 0 / 0.07), oklch(100% 0 0 / 0.015)); + backdrop-filter: blur(16px) saturate(115%); + -webkit-backdrop-filter: blur(16px) saturate(115%); + box-shadow: + 0 26px 52px -32px oklch(0% 0 0 / 0.95), + 0 0 30px oklch(100% 0 0 / 0.06), + inset 0 1px 0 oklch(100% 0 0 / 0.14); + contain: paint; + transform: translateZ(0); + animation: nav-in 520ms var(--ease-out) backwards; } -} + @keyframes nav-in { + from { opacity: 0; transform: translateY(-10px); } + to { opacity: 1; transform: none; } + } + .nav-sheet { + background: + linear-gradient(180deg, oklch(100% 0 0 / 0.10), oklch(100% 0 0 / 0.04)), + oklch(4% 0 0 / 0.46); + backdrop-filter: blur(22px) saturate(130%); + -webkit-backdrop-filter: blur(22px) saturate(130%); + border: 1px solid oklch(100% 0 0 / 0.13); + border-radius: var(--radius-panel); + box-shadow: + 0 22px 44px -18px oklch(0% 0 0 / 0.92), + 0 0 26px oklch(100% 0 0 / 0.06), + inset 0 1px 0 oklch(100% 0 0 / 0.12); -.animate-float-slow { - animation: floatSlow 6s ease-in-out infinite; -} + transform-origin: top right; + animation: sheet-in 380ms var(--ease-out) backwards; + will-change: transform, opacity; + } + @keyframes sheet-in { + 0% { opacity: 0; transform: translateY(-12px) scale(0.84); } + 55% { opacity: 1; } + 78% { transform: translateY(1px) scale(1.014); } + 100% { opacity: 1; transform: translateY(0) scale(1); } + } + .nav-sheet--closing { animation: sheet-out 200ms var(--ease-in) forwards; } + @keyframes sheet-out { + 0% { opacity: 1; transform: translateY(0) scale(1); } + 100% { opacity: 0; transform: translateY(-8px) scale(0.9); } + } + + .nav-sheet > * { + animation: sheet-row-in 320ms var(--ease-out) backwards; + } + .nav-sheet > *:nth-child(1) { animation-delay: 80ms; } + .nav-sheet > *:nth-child(2) { animation-delay: 130ms; } + .nav-sheet > *:nth-child(3) { animation-delay: 180ms; } + @keyframes sheet-row-in { + 0% { opacity: 0; transform: translateX(12px); } + 100% { opacity: 1; transform: translateX(0); } + } + @media (prefers-reduced-motion: reduce) { + .nav-sheet > * { animation: none; } + } + .nav-sheet .tab { width: 100%; } + .nav-progress { + position: absolute; + left: 0; + bottom: 0; + height: 1px; + width: 100%; + transform-origin: left center; + transform: scaleX(0); + background: linear-gradient(90deg, transparent, oklch(100% 0 0 / 0.55), transparent); + pointer-events: none; + } -.animate-glow-pulse { - animation: glowPulse 4s ease-in-out infinite; + .surface-float { + border: 1px solid oklch(100% 0 0 / 0.09); + border-radius: var(--radius-panel); + background: linear-gradient(180deg, oklch(14% 0 0 / 0.92), oklch(9% 0 0 / 0.92)); + box-shadow: + 0 26px 52px -32px oklch(0% 0 0 / 0.95), + inset 0 1px 0 oklch(100% 0 0 / 0.08); + transition: border-color var(--dur-short) var(--ease-out), box-shadow var(--dur-short) var(--ease-out); + } + + .code-inline { + font-family: var(--font-outlier); + font-size: 0.9em; + color: var(--color-ink); + padding: 1px var(--space-2xs); + border-radius: 6px; + background: var(--color-paper-3); + } + + .text-section { color: oklch(93% 0 0); text-shadow: 0 0 40px oklch(100% 0 0 / 0.18); } + .text-title { text-shadow: 0 0 26px oklch(100% 0 0 / 0.08); } } -.animate-fade-in { - animation: fadeIn 0.25s cubic-bezier(0.16, 1, 0.3, 1) forwards; +@layer components { + + .doc-shell { + min-height: 100dvh; + background: + radial-gradient(1200px 620px at 78% -8%, oklch(100% 0 0 / 0.045), transparent 62%), + radial-gradient(900px 520px at 8% 104%, oklch(100% 0 0 / 0.03), transparent 60%), + var(--color-paper); + + text-shadow: var(--halo-whisper); + } + + .doc-header { + position: sticky; + top: 0; + z-index: var(--z-sticky); + background: linear-gradient(180deg, oklch(6% 0 0 / 0.97), oklch(6% 0 0 / 0.9)); + backdrop-filter: blur(14px); + -webkit-backdrop-filter: blur(14px); + box-shadow: 0 1px 0 oklch(100% 0 0 / 0.06); + } + .doc-header__inner { + display: flex; + align-items: center; + gap: var(--space-md); + min-height: var(--doc-head-h); + max-width: var(--container); + margin-inline: auto; + padding: var(--space-xs) var(--gutter); + } + .doc-header__side { + display: flex; + align-items: center; + gap: var(--space-xs); + flex: 1 1 0; + min-width: 0; + } + .doc-header__side--end { justify-content: flex-end; } + .doc-header__brand { + display: flex; + align-items: center; + gap: var(--space-xs); + flex: 0 1 auto; + min-width: 0; + font-family: var(--font-display); + letter-spacing: 0.02em; + } + .doc-header__title { + flex: none; + font-size: var(--text-md); + text-transform: uppercase; + color: var(--color-ink); + text-shadow: 0 0 18px oklch(100% 0 0 / 0.30), 0 0 44px oklch(100% 0 0 / 0.16); + } + .doc-header__sep { + width: 1px; + height: 16px; + background: var(--color-rule-2); + } + .doc-header__crumb { + flex: 0 1 auto; + min-width: 0; + font-family: var(--font-body); + font-size: var(--text-sm); + color: var(--color-muted); + white-space: nowrap; + overflow: hidden; + text-overflow: ellipsis; + } + @media (max-width: 61.99rem) { + .doc-header__sep, .doc-header__crumb { display: none; } + .doc-header .doc-seg { display: none; } + .doc-header__title { font-size: var(--text-sm); } + } + + .doc-ghost { + display: inline-flex; + align-items: center; + gap: var(--space-xs); + min-height: 40px; + padding: 0 var(--space-sm); + border: 1px solid oklch(100% 0 0 / 0.08); + border-radius: var(--radius-control); + background: transparent; + color: var(--color-muted); + font-size: var(--text-sm); + cursor: pointer; + white-space: nowrap; + transition: color var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out); + } + .doc-ghost:hover { color: var(--color-ink); background: oklch(100% 0 0 / 0.05); border-color: oklch(100% 0 0 / 0.10); box-shadow: 0 0 20px oklch(100% 0 0 / 0.10), var(--aura-control-lit); } + .doc-ghost { box-shadow: var(--aura-control); } + .doc-ghost:active { transform: scale(0.97); } + .doc-ghost:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; } + + .doc-btn { + display: inline-flex; + align-items: center; + gap: var(--space-xs); + min-height: 40px; + padding: 0 var(--space-md); + border: 1px solid oklch(100% 0 0 / 0.16); + border-radius: var(--radius-control); + background: oklch(100% 0 0 / 0.04); + color: var(--color-ink-2); + font: 500 var(--text-sm)/1 var(--font-body); + text-decoration: none; + white-space: nowrap; + cursor: pointer; + transition: color var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out), box-shadow var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out); + } + .doc-btn:hover { color: var(--color-ink); background: oklch(100% 0 0 / 0.08); border-color: oklch(100% 0 0 / 0.28); box-shadow: 0 0 22px oklch(100% 0 0 / 0.12); } + .doc-btn { box-shadow: var(--aura-control); } + .doc-btn:hover { box-shadow: 0 0 22px oklch(100% 0 0 / 0.12), var(--aura-control-lit); } + .doc-btn:active { transform: scale(0.97); } + .doc-btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; } + .doc-btn--sm { min-height: 36px; padding: 0 var(--space-sm); font-size: var(--text-xs); } + + .doc-seg { + display: inline-flex; + align-items: center; + gap: 2px; + padding: 3px; + border: 1px solid oklch(100% 0 0 / 0.08); + border-radius: var(--radius-control); + background: oklch(0% 0 0 / 0.32); + box-shadow: inset 0 1px 0 oklch(100% 0 0 / 0.05); + } + .doc-seg__btn { + display: inline-flex; + align-items: center; + gap: 6px; + min-height: 36px; + padding: 0 var(--space-md); + border: 0; + border-radius: calc(var(--radius-control) - 4px); + background: transparent; + color: var(--color-muted); + font-size: var(--text-sm); + white-space: nowrap; + cursor: pointer; + transition: background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out), box-shadow var(--dur-short) var(--ease-out), text-shadow var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out); + } + .doc-seg__btn:hover { color: var(--color-ink-2); background: oklch(100% 0 0 / 0.05); } + .doc-seg__btn:active { transform: scale(0.97); } + .doc-seg__btn:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; } + .doc-seg__btn[aria-pressed="true"] { + color: oklch(96% 0 0); + background: oklch(100% 0 0 / 0.10); + box-shadow: inset 0 1px 0 oklch(100% 0 0 / 0.18), 0 0 18px oklch(100% 0 0 / 0.10); + text-shadow: 0 0 14px oklch(100% 0 0 / 0.26); + } + .doc-seg__num { + font-family: var(--font-outlier); + font-size: var(--text-xs); + color: var(--color-muted); + font-variant-numeric: tabular-nums; + } + .doc-seg__btn[aria-pressed="true"] .doc-seg__num { color: oklch(78% 0 0); } + + @media (max-width: 61.99rem) { + :root { --doc-head-h: 58px; } + } + .doc-toolbar { + position: sticky; + top: var(--doc-head-h); + z-index: calc(var(--z-sticky) - 1); + padding: var(--space-xs) var(--gutter) var(--space-sm); + } + .doc-toolbar::before { + content: ''; + position: absolute; + inset: 0 0 -44px 0; + background: linear-gradient(180deg, + var(--color-paper) 0%, + oklch(6% 0 0 / 0.96) 58%, + oklch(6% 0 0 / 0.72) 78%, + transparent 100%); + pointer-events: none; + z-index: -1; + } + .doc-toolbar__inner { + display: flex; + align-items: center; + gap: var(--space-sm); + max-width: 56rem; + margin-inline: auto; + padding: 6px 6px 6px var(--space-md); + border: 1px solid oklch(100% 0 0 / 0.10); + border-radius: var(--radius-panel); + background: linear-gradient(180deg, oklch(15% 0 0 / 0.88), oklch(9% 0 0 / 0.88)); + box-shadow: + 0 18px 40px -26px oklch(0% 0 0 / 0.92), + 0 0 26px oklch(100% 0 0 / 0.06), + inset 0 1px 0 oklch(100% 0 0 / 0.10); + backdrop-filter: blur(12px); + -webkit-backdrop-filter: blur(12px); + } + .doc-toolbar__search { flex: 1 1 auto; min-width: 0; } + .doc-toolbar__hint { + display: none; + align-items: center; + gap: var(--space-xs); + flex: none; + min-height: 34px; + padding: 0 var(--space-sm); + border: 1px solid oklch(100% 0 0 / 0.10); + border-radius: var(--radius-control); + background: oklch(100% 0 0 / 0.04); + color: var(--color-muted); + font-size: var(--text-xs); + cursor: pointer; + transition: color var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out); + } + .doc-toolbar__hint:hover { color: var(--color-ink-2); background: oklch(100% 0 0 / 0.08); } + .doc-toolbar__hint:active { transform: scale(0.97); } + .doc-toolbar__hint:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; } + .doc-toolbar__hint kbd { + font-family: var(--font-outlier); + font-size: var(--text-xs); + padding: 1px 6px; + border: 1px solid oklch(100% 0 0 / 0.14); + border-radius: 6px; + color: var(--color-ink-2); + } + @media (min-width: 48rem) { + .doc-toolbar__hint { display: inline-flex; } + } + + .doc-search { + position: relative; + display: flex; + align-items: center; + gap: var(--space-xs); + min-width: 0; + } + .doc-search__icon { + width: 16px; + height: 16px; + flex: none; + color: var(--color-muted); + } + .doc-search__input { + width: 100%; + min-width: 0; + min-height: 34px; + border: 0; + background: transparent; + color: var(--color-ink); + font-size: var(--text-sm); + } + .doc-search__input::placeholder { color: var(--color-muted); } + .doc-search__input:focus { outline: none; } + .doc-search__input:focus-visible { + outline: 2px solid var(--color-focus); + outline-offset: 3px; + border-radius: 4px; + } + .doc-search__input::-webkit-search-cancel-button { display: none; } + .doc-search__clear { + display: inline-flex; + align-items: center; + justify-content: center; + flex: none; + width: 30px; + height: 30px; + border: 1px solid oklch(100% 0 0 / 0.10); + border-radius: var(--radius-control); + background: oklch(100% 0 0 / 0.05); + color: var(--color-muted); + cursor: pointer; + transition: color var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out); + } + .doc-search__clear:hover { color: var(--color-ink); background: oklch(100% 0 0 / 0.10); } + .doc-search__clear:active { transform: scale(0.94); } + .doc-search__clear:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; } + + .doc-overlay { + position: fixed; + inset: 0; + z-index: var(--z-modal); + display: flex; + align-items: flex-start; + justify-content: center; + padding: clamp(4rem, 12vh, 9rem) var(--gutter) var(--gutter); + background: var(--color-scrim); + backdrop-filter: blur(6px); + -webkit-backdrop-filter: blur(6px); + animation: overlay-in 180ms var(--ease-out) backwards; + } + @keyframes overlay-in { from { opacity: 0; } to { opacity: 1; } } + .doc-palette { + width: min(42rem, 100%); + max-height: min(30rem, 70dvh); + display: flex; + flex-direction: column; + overflow: hidden; + border: 1px solid oklch(100% 0 0 / 0.14); + border-radius: var(--radius-panel); + background: linear-gradient(180deg, oklch(16% 0 0), oklch(9% 0 0)); + box-shadow: 0 40px 80px -30px oklch(0% 0 0 / 0.95), 0 0 40px oklch(100% 0 0 / 0.10); + animation: palette-in 240ms var(--ease-out) backwards; + } + @keyframes palette-in { + from { opacity: 0; transform: translateY(-10px) scale(0.985); } + to { opacity: 1; transform: none; } + } + .doc-palette__head { + display: flex; + align-items: center; + gap: var(--space-xs); + padding: var(--space-sm) var(--space-md); + border-bottom: 1px solid oklch(100% 0 0 / 0.08); + } + .doc-palette__input { + flex: 1 1 auto; + min-width: 0; + min-height: 34px; + border: 0; + background: transparent; + color: var(--color-ink); + font-size: var(--text-md); + } + .doc-palette__input::placeholder { color: var(--color-muted); } + .doc-palette__input:focus { outline: none; } + .doc-palette__input::-webkit-search-cancel-button { display: none; } + .doc-palette__body { + flex: 1 1 auto; + overflow-y: auto; + padding: var(--space-xs); + } + .doc-palette__list { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; } + .doc-palette__label-row { + padding: var(--space-xs) var(--space-sm); + font-family: var(--font-outlier); + font-size: var(--text-xs); + letter-spacing: 0.14em; + text-transform: uppercase; + color: var(--color-muted); + } + .doc-palette__item { + display: flex; + align-items: center; + gap: var(--space-sm); + width: 100%; + min-height: 46px; + padding: var(--space-xs) var(--space-sm); + border: 1px solid transparent; + border-radius: var(--radius-control); + background: transparent; + color: var(--color-ink-2); + text-align: left; + cursor: pointer; + transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out); + } + .doc-palette__item:hover { background: oklch(100% 0 0 / 0.06); border-color: oklch(100% 0 0 / 0.10); color: var(--color-ink); } + .doc-palette__item:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; } + .doc-palette__kind { display: inline-flex; color: var(--color-muted); flex: none; } + .doc-palette__text { display: flex; flex-direction: column; min-width: 0; flex: 1 1 auto; } + .doc-palette__label { + font-family: var(--font-outlier); + font-size: var(--text-sm); + color: var(--color-ink); + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + .doc-palette__sub { + font-size: var(--text-xs); + color: var(--color-muted); + overflow: hidden; + text-overflow: ellipsis; + white-space: nowrap; + } + .doc-palette__go { flex: none; color: var(--color-muted); opacity: 0; transition: opacity var(--dur-short) var(--ease-out); } + .doc-palette__item:hover .doc-palette__go { opacity: 1; } + .doc-palette__empty { padding: var(--space-lg); text-align: center; color: var(--color-muted); font-size: var(--text-sm); } + + .doc-layout { + display: grid; + grid-template-columns: minmax(0, 1fr); + gap: var(--space-xl); + max-width: var(--container); + margin-inline: auto; + padding: var(--space-lg) var(--gutter) var(--space-2xl); + } + @media (min-width: 62rem) { + .doc-layout { grid-template-columns: 15rem minmax(0, 1fr); gap: var(--space-2xl); } + } + .doc-sidebar { display: none; } + @media (min-width: 62rem) { + .doc-sidebar { + display: block; + position: sticky; + top: 8.5rem; + align-self: start; + max-height: calc(100dvh - 10rem); + overflow-y: auto; + padding-right: var(--space-sm); + scrollbar-width: thin; + } + } + .doc-sidebar__title { + font-family: var(--font-outlier); + font-size: var(--text-xs); + font-weight: 500; + text-transform: uppercase; + letter-spacing: 0.14em; + color: var(--color-muted); + margin-bottom: var(--space-sm); + } + .doc-nav { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; } + .doc-nav__item { + display: flex; + align-items: baseline; + gap: var(--space-sm); + width: 100%; + min-height: 38px; + padding: var(--space-xs) var(--space-sm); + border: 1px solid transparent; + border-radius: var(--radius-control); + background: transparent; + color: var(--color-muted); + font-size: var(--text-sm); + text-align: left; + cursor: pointer; + transition: background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out); + } + .doc-nav__item:hover { color: var(--color-ink-2); background: oklch(100% 0 0 / 0.04); } + .doc-nav__item:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; } + .doc-nav__item[aria-current="true"] { + color: var(--color-ink); + background: oklch(100% 0 0 / 0.07); + border-color: oklch(100% 0 0 / 0.12); + text-shadow: 0 0 14px oklch(100% 0 0 / 0.24); + } + .doc-nav__num { + font-family: var(--font-outlier); + font-size: var(--text-xs); + color: var(--color-muted); + font-variant-numeric: tabular-nums; + flex: none; + } + .doc-nav__label { min-width: 0; overflow: hidden; text-overflow: ellipsis; } + .doc-nav__count { + margin-left: auto; + font-family: var(--font-outlier); + font-size: var(--text-xs); + color: var(--color-muted); + font-variant-numeric: tabular-nums; + } + + .doc-main { min-width: 0; } + + .doc-mobile { display: flex; flex-direction: column; gap: var(--space-sm); margin-bottom: var(--space-lg); } + @media (min-width: 62rem) { .doc-mobile { display: none; } } + .doc-mobile__seg { display: flex; } + .doc-mobile__seg .doc-seg { width: 100%; } + .doc-mobile__seg .doc-seg__btn { flex: 1 1 0; justify-content: center; } + .doc-mobile__chapter { position: relative; } + .doc-mobile__label { + display: flex; + align-items: baseline; + justify-content: space-between; + gap: var(--space-sm); + font-family: var(--font-outlier); + font-size: var(--text-xs); + text-transform: uppercase; + letter-spacing: 0.12em; + color: var(--color-muted); + margin-bottom: var(--space-xs); + } + .doc-select { + display: flex; + align-items: center; + justify-content: space-between; + gap: var(--space-sm); + width: 100%; + min-height: 46px; + padding: 0 var(--space-sm); + border: 1px solid oklch(100% 0 0 / 0.12); + border-radius: var(--radius-control); + background: oklch(0% 0 0 / 0.34); + color: var(--color-ink); + font-size: var(--text-sm); + text-align: left; + cursor: pointer; + transition: background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out), box-shadow var(--dur-short) var(--ease-out); + } + .doc-select:hover { background: var(--color-paper-2); border-color: oklch(100% 0 0 / 0.26); box-shadow: 0 0 24px oklch(100% 0 0 / 0.08), var(--aura-control-lit); } + .doc-select { box-shadow: var(--aura-control); } + .doc-select:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; } + .doc-chevron { transition: transform var(--dur-short) var(--ease-out); flex: none; color: var(--color-muted); } + .doc-chevron.is-open { transform: rotate(180deg); } + .doc-scrim { position: fixed; inset: 0; z-index: var(--z-dropdown); background: oklch(6% 0 0 / 0.5); animation: overlay-in 160ms var(--ease-out) backwards; } + .doc-menu { + list-style: none; + margin: 0; + padding: var(--space-2xs); + border: 1px solid oklch(100% 0 0 / 0.12); + border-radius: var(--radius-control); + background: linear-gradient(180deg, oklch(18% 0 0), oklch(11% 0 0)); + box-shadow: 0 26px 50px -22px oklch(0% 0 0 / 0.92); + animation: sheet-in 200ms var(--ease-out) backwards; + } + .doc-menu--drop { + position: absolute; + z-index: calc(var(--z-dropdown) + 1); + left: 0; + right: 0; + top: calc(100% + var(--space-2xs)); + max-height: 52dvh; + overflow-y: auto; + } + + .doc-article { max-width: 54rem; } + .doc-eyebrow { + display: flex; + align-items: center; + gap: var(--space-sm); + font-family: var(--font-outlier); + font-size: var(--text-xs); + text-transform: uppercase; + letter-spacing: 0.16em; + color: var(--color-muted); + margin-bottom: var(--space-sm); + } + .doc-eyebrow__num { color: var(--color-ink-2); } + .doc-eyebrow__rule { + width: 28px; + height: 1px; + background: linear-gradient(90deg, oklch(100% 0 0 / 0.5), transparent); + } + .doc-title { + font-size: var(--text-section); + max-width: 26ch; + color: var(--color-ink); + text-shadow: var(--halo-doc-title); + } + .doc-lead { + margin-top: var(--space-sm); + max-width: 62ch; + font-size: var(--text-lead); + line-height: 1.5; + color: var(--color-ink-2); + } + .doc-rule { + height: 1px; + margin: var(--space-lg) 0 var(--space-lg); + background: linear-gradient(90deg, oklch(100% 0 0 / 0.22), oklch(100% 0 0 / 0.04) 60%, transparent); + } + + .doc-prose { display: flex; flex-direction: column; gap: var(--space-md); } + .doc-p { color: var(--color-ink-2); max-width: 68ch; } + .doc-p code, .doc-list code { color: var(--color-ink); } + .doc-strong { color: var(--color-ink); font-weight: 600; } + .doc-h2 { + margin-top: var(--space-lg); + font-size: var(--text-lg); + color: var(--color-ink); + text-shadow: var(--halo-doc-head); + } + .doc-h3 { + margin-top: var(--space-md); + font-family: var(--font-body); + font-size: var(--text-md); + font-weight: 600; + color: var(--color-ink); + text-shadow: var(--halo-doc-head); + } + .doc-list { + margin: 0; + padding-left: 1.1rem; + display: flex; + flex-direction: column; + gap: var(--space-xs); + color: var(--color-ink-2); + max-width: 68ch; + } + .doc-list li::marker { color: var(--color-muted); } + .doc-figure { + margin: 0; + overflow: hidden; + border: 1px solid oklch(100% 0 0 / 0.10); + border-radius: var(--radius-control); + background: oklch(9% 0 0 / 0.8); + box-shadow: inset 0 1px 0 oklch(100% 0 0 / 0.06); + } + .doc-figure img { + width: 100%; + height: auto; + display: block; + background: oklch(6% 0 0); + } + .doc-figure--mark { + max-width: 9rem; + padding: var(--space-sm); + } + .doc-figure--mark img { + width: 100%; + max-width: 7rem; + margin-inline: auto; + } + + .doc-table-wrap, .doc-method__table-wrap { overflow-x: auto; }.doc-table, .doc-method__table { + width: 100%; + border-collapse: collapse; + font-size: var(--text-sm); + color: var(--color-ink-2); + } + .doc-table th, .doc-method__table th { + text-align: left; + font-family: var(--font-outlier); + font-size: var(--text-xs); + font-weight: 500; + text-transform: uppercase; + letter-spacing: 0.1em; + color: var(--color-muted); + padding: var(--space-xs) var(--space-sm); + border-bottom: 1px solid var(--color-rule); + white-space: nowrap; + } + .doc-table td, .doc-method__table td { + padding: var(--space-xs) var(--space-sm); + border-bottom: 1px solid oklch(100% 0 0 / 0.05); + vertical-align: top; + } + .doc-table td:first-child, .doc-method__table td:first-child { color: var(--color-ink); } + + .doc-code-block { + margin: 0; + border: 1px solid oklch(100% 0 0 / 0.09); + border-radius: var(--radius-control); + background: linear-gradient(180deg, oklch(13% 0 0 / 0.72), oklch(8% 0 0 / 0.72)); + overflow: hidden; + transition: border-color var(--dur-short) var(--ease-out), box-shadow var(--dur-short) var(--ease-out); + } + .doc-code-block__head { + display: flex; + align-items: center; + justify-content: space-between; + gap: var(--space-sm); + padding: var(--space-xs) var(--space-sm); + border-bottom: 1px solid oklch(100% 0 0 / 0.06); + } + .doc-code-block__lang { + font-family: var(--font-outlier); + font-size: var(--text-xs); + letter-spacing: 0.12em; + text-transform: uppercase; + color: var(--color-muted); + } + .doc-code { + margin: 0; + padding: var(--space-sm); + overflow-x: auto; + font-family: var(--font-outlier); + font-size: 0.8125rem; + line-height: 1.7; + color: oklch(82% 0 0); + cursor: pointer; + transition: color var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out); + } + .doc-code code { font: inherit; white-space: pre-wrap; overflow-wrap: anywhere; } + .doc-code:hover { color: var(--color-ink); } + .doc-code:focus-visible { outline: 2px solid var(--color-focus); outline-offset: -2px; } + .doc-code--done { color: var(--color-ink); background: oklch(100% 0 0 / 0.035); } + .doc-state { + display: inline-flex; + align-items: center; + gap: 6px; + font-family: var(--font-outlier); + font-size: var(--text-xs); + color: var(--color-muted); + white-space: nowrap; + } + .doc-state--on { color: var(--color-ink); text-shadow: 0 0 14px var(--color-glow); } + + .doc-catalog { display: flex; flex-direction: column; gap: var(--space-lg); } + .doc-catalog__bar { + display: flex; + flex-direction: column; + gap: var(--space-sm); + padding-bottom: var(--space-sm); + border-bottom: 1px solid var(--color-rule); + } + @media (min-width: 48rem) { + .doc-catalog__bar { flex-direction: row; align-items: center; justify-content: space-between; } + } + .doc-catalog__count { font-family: var(--font-outlier); font-size: var(--text-xs); color: var(--color-muted); } + .doc-catalog__chips { display: flex; flex-wrap: wrap; gap: var(--space-2xs); } + .doc-chip { + display: inline-flex; + align-items: center; + min-height: 30px; + padding: 0 var(--space-sm); + border: 1px solid oklch(100% 0 0 / 0.10); + border-radius: var(--radius-control); + background: oklch(100% 0 0 / 0.03); + color: var(--color-muted); + font-family: var(--font-outlier); + font-size: var(--text-xs); + cursor: pointer; + transition: color var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out), box-shadow var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out); + } + .doc-chip:hover { color: var(--color-ink-2); background: oklch(100% 0 0 / 0.06); box-shadow: 0 0 18px oklch(100% 0 0 / 0.10), var(--aura-control-lit); } + .doc-chip { box-shadow: var(--aura-control); } + .doc-chip:active { transform: scale(0.97); } + .doc-chip:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; } + .doc-chip[aria-pressed="true"] { + color: var(--color-ink); + background: oklch(100% 0 0 / 0.12); + border-color: oklch(100% 0 0 / 0.26); + text-shadow: 0 0 12px oklch(100% 0 0 / 0.22); + } + .doc-catalog__list { display: flex; flex-direction: column; gap: var(--space-md); } + .doc-empty { padding: var(--space-xl) 0; color: var(--color-muted); } + + .doc-method { + padding: var(--space-md); + border: 1px solid oklch(100% 0 0 / 0.07); + border-radius: var(--radius-control); + background: linear-gradient(180deg, oklch(11% 0 0 / 0.55), oklch(7% 0 0 / 0.55)); + transition: border-color var(--dur-short) var(--ease-out), box-shadow var(--dur-short) var(--ease-out); + } + .doc-method:hover { + border-color: oklch(100% 0 0 / 0.14); + box-shadow: 0 0 30px oklch(100% 0 0 / 0.07); + } + .doc-method__title { + display: flex; + align-items: baseline; + gap: 2px; + margin: 0; + font-family: var(--font-outlier); + font-size: clamp(1rem, 0.4vw + 0.9rem, 1.1875rem); + font-weight: 500; + line-height: 1.3; + max-width: none; + overflow-wrap: anywhere; + } + .doc-method__prefix { color: var(--color-muted); opacity: 0.75; } + + .doc-method__name { + color: transparent; + background-image: linear-gradient( + 180deg, + oklch(100% 0 0 / 0.92) 0%, + oklch(100% 0 0 / 1) 34%, + oklch(100% 0 0 / 0.88) 62%, + oklch(86% 0 0 / 0.72) 100% + ); + -webkit-background-clip: text; + background-clip: text; + text-shadow: var(--halo-method); + } + .doc-method__rpc { + margin-top: var(--space-2xs); + font-family: var(--font-outlier); + font-size: var(--text-xs); + color: var(--color-muted); + overflow-wrap: anywhere; + } + .doc-method__desc { + margin-top: var(--space-xs); + color: var(--color-ink-2); + font-size: var(--text-sm); + line-height: 1.55; + max-width: 72ch; + } + .doc-method__table { margin-top: var(--space-sm); } + .doc-method__param { font-family: var(--font-outlier); } + .doc-method__type { font-family: var(--font-outlier); color: var(--color-ink); } + .doc-method__req { color: oklch(88% 0 0); } + .doc-method__opt { color: var(--color-muted); } + .doc-method__default { font-family: var(--font-outlier); color: var(--color-muted); } + + .doc-pager { + display: grid; + grid-template-columns: 1fr 1fr; + gap: var(--space-sm); + margin-top: var(--space-2xl); + padding-top: var(--space-lg); + border-top: 1px solid var(--color-rule); + } + .doc-pager__item { + display: flex; + flex-direction: column; + gap: 2px; + min-height: 64px; + padding: var(--space-sm) var(--space-md); + border: 1px solid oklch(100% 0 0 / 0.08); + border-radius: var(--radius-control); + background: oklch(100% 0 0 / 0.02); + color: var(--color-ink-2); + text-align: left; + cursor: pointer; + transition: border-color var(--dur-short) var(--ease-out), background-color var(--dur-short) var(--ease-out), color var(--dur-short) var(--ease-out), transform var(--dur-micro) var(--ease-out); + } + .doc-pager__item:hover { border-color: oklch(100% 0 0 / 0.20); background: oklch(100% 0 0 / 0.05); color: var(--color-ink); } + .doc-pager__item:active { transform: scale(0.99); } + .doc-pager__item:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; } + .doc-pager__item--next { text-align: right; align-items: flex-end; } + .doc-pager__dir { + font-family: var(--font-outlier); + font-size: var(--text-xs); + text-transform: uppercase; + letter-spacing: 0.12em; + color: var(--color-muted); + } + .doc-pager__title { + font-family: var(--font-display); + font-size: var(--text-sm); + color: var(--color-ink); + text-shadow: 0 0 16px oklch(100% 0 0 / 0.18); + } + + .doc-footer { + border-top: 1px solid var(--color-rule); + background: oklch(0% 0 0 / 0.4); + } + .doc-footer__inner { + display: flex; + align-items: center; + justify-content: space-between; + gap: var(--space-md); + max-width: var(--container); + margin-inline: auto; + padding: var(--space-lg) var(--gutter); + font-size: var(--text-sm); + color: var(--color-muted); + } + .doc-footer__link { + display: inline-flex; + align-items: center; + gap: var(--space-xs); + color: var(--color-ink-2); + text-decoration: none; + transition: color var(--dur-short) var(--ease-out), text-shadow var(--dur-short) var(--ease-out); + } + .doc-footer__link:hover { color: var(--color-ink); text-shadow: 0 0 16px oklch(100% 0 0 / 0.22); } + .doc-footer__link:focus-visible { outline: 2px solid var(--color-focus); outline-offset: 2px; } + + @property --press { + syntax: ''; + inherits: true; + initial-value: 0; + } + @keyframes press-light { + 0% { --press: 0; animation-timing-function: cubic-bezier(0.12, 0.9, 0.24, 1); } + 4% { --press: 1; animation-timing-function: cubic-bezier(0.5, 0, 0.7, 1); } + 18% { --press: 0.52; animation-timing-function: cubic-bezier(0.4, 0, 0.6, 1); } + 46% { --press: 0.3; } + 74% { --press: 0.15; } + 100% { --press: 0; } + } + @keyframes press-ink { + 0% { text-shadow: 0 0 12px oklch(100% 0 0 / 0), 0 0 26px oklch(100% 0 0 / 0); } + 4% { text-shadow: 0 0 13px oklch(100% 0 0 / 0.50), 0 0 30px oklch(100% 0 0 / 0.32); } + 18% { text-shadow: 0 0 11px oklch(100% 0 0 / 0.26), 0 0 26px oklch(100% 0 0 / 0.17); } + 46% { text-shadow: 0 0 9px oklch(100% 0 0 / 0.15), 0 0 22px oklch(100% 0 0 / 0.10); } + 74% { text-shadow: 0 0 8px oklch(100% 0 0 / 0.07), 0 0 18px oklch(100% 0 0 / 0.05); } + 100% { text-shadow: 0 0 6px oklch(100% 0 0 / 0), 0 0 14px oklch(100% 0 0 / 0); } + } + @keyframes press-ink-dim { + 0% { text-shadow: 0 0 10px oklch(100% 0 0 / 0), 0 0 22px oklch(100% 0 0 / 0); } + 4% { text-shadow: 0 0 11px oklch(100% 0 0 / 0.38), 0 0 26px oklch(100% 0 0 / 0.22); } + 18% { text-shadow: 0 0 10px oklch(100% 0 0 / 0.20), 0 0 22px oklch(100% 0 0 / 0.12); } + 46% { text-shadow: 0 0 8px oklch(100% 0 0 / 0.11), 0 0 18px oklch(100% 0 0 / 0.07); } + 74% { text-shadow: 0 0 7px oklch(100% 0 0 / 0.05), 0 0 15px oklch(100% 0 0 / 0.03); } + 100% { text-shadow: 0 0 6px oklch(100% 0 0 / 0), 0 0 12px oklch(100% 0 0 / 0); } + } + :is( + .btn, + .link, + .link-arrow, + .tab, + .doc-seg__btn, + .doc-chip, + .doc-ghost, + .doc-btn, + .doc-select, + .doc-nav__item, + .doc-pager__item, + .doc-palette__item, + .doc-toolbar__hint, + .doc-search__clear, + .doc-code + ) { + position: relative; + isolation: isolate; + } + :is( + .btn, + .link, + .link-arrow, + .tab, + .doc-seg__btn, + .doc-chip, + .doc-ghost, + .doc-btn, + .doc-select, + .doc-nav__item, + .doc-pager__item, + .doc-palette__item, + .doc-toolbar__hint, + .doc-search__clear, + .doc-code + )::after { + content: ''; + position: absolute; + inset: 0; + border-radius: inherit; + pointer-events: none; + z-index: -1; + } + :is( + .btn, + .link, + .link-arrow, + .tab, + .doc-seg__btn, + .doc-chip, + .doc-ghost, + .doc-btn, + .doc-select, + .doc-nav__item, + .doc-pager__item, + .doc-palette__item, + .doc-toolbar__hint, + .doc-search__clear + )::after { + background: oklch(100% 0 0 / calc(var(--press) * 0.26)); + box-shadow: + 0 0 24px 3px oklch(100% 0 0 / calc(var(--press) * 0.46)), + 0 0 72px 18px oklch(100% 0 0 / calc(var(--press) * 0.2)), + inset 0 0 12px 1px oklch(100% 0 0 / calc(var(--press) * 0.28)), + inset 0 0 22px 2px oklch(100% 0 0 / calc(var(--press) * 0.18)); + } + + :is( + .btn, + .link, + .link-arrow, + .tab, + .doc-seg__btn, + .doc-chip, + .doc-ghost, + .doc-btn, + .doc-select, + .doc-nav__item, + .doc-pager__item, + .doc-palette__item, + .doc-toolbar__hint, + .doc-search__clear, + .doc-code + )::before { + content: ''; + position: absolute; + inset: -1px; + border-radius: inherit; + pointer-events: none; + z-index: -1; + opacity: var(--press); + box-shadow: + 0 0 12px 1px oklch(100% 0 0 / 0.62), + 0 0 34px 6px oklch(100% 0 0 / 0.30), + 0 0 84px 20px oklch(100% 0 0 / 0.13); + } + .doc-code::before { + opacity: calc(var(--press) * 0.62); + box-shadow: + 0 0 10px 1px oklch(100% 0 0 / 0.40), + 0 0 30px 5px oklch(100% 0 0 / 0.18); + } + .doc-code::after { + background: oklch(100% 0 0 / calc(var(--press) * 0.20)); + box-shadow: + 0 0 16px 2px oklch(100% 0 0 / calc(var(--press) * 0.30)), + 0 0 46px 10px oklch(100% 0 0 / calc(var(--press) * 0.13)), + inset 0 0 10px 1px oklch(100% 0 0 / calc(var(--press) * 0.20)); + } + [data-lit]:is( + .btn, + .link, + .link-arrow, + .tab, + .doc-seg__btn, + .doc-chip, + .doc-ghost, + .doc-btn, + .doc-select, + .doc-nav__item, + .doc-pager__item, + .doc-palette__item, + .doc-toolbar__hint, + .doc-search__clear + ) { + animation: press-light 1500ms linear forwards, press-ink 1500ms linear forwards; + border-color: oklch(100% 0 0 / 0.55); + } + [data-lit].doc-code { + animation: press-light 1500ms linear forwards, press-ink-dim 1500ms linear forwards; + border-color: oklch(100% 0 0 / 0.38); + } + .doc-code-block:has([data-lit]) { + border-color: oklch(100% 0 0 / 0.40); + box-shadow: + 0 0 28px 2px oklch(100% 0 0 / 0.20), + inset 0 0 60px oklch(100% 0 0 / 0.05); + } + @media (prefers-reduced-motion: reduce) { + [data-lit]:is( + .btn, + .link, + .link-arrow, + .tab, + .doc-seg__btn, + .doc-chip, + .doc-ghost, + .doc-btn, + .doc-select, + .doc-nav__item, + .doc-pager__item, + .doc-palette__item, + .doc-toolbar__hint, + .doc-search__clear + ) { + animation: none !important; + --press: 1; + text-shadow: + 0 0 13px oklch(100% 0 0 / 0.50), + 0 0 30px oklch(100% 0 0 / 0.32); + } + [data-lit].doc-code { + animation: none !important; + --press: 1; + text-shadow: + 0 0 11px oklch(100% 0 0 / 0.38), + 0 0 26px oklch(100% 0 0 / 0.22); + } + } + + .btn:focus-visible, + .tab:focus-visible, + .link:focus-visible, + .link-arrow:focus-visible, + .doc-code:focus-visible, + .doc-seg__btn:focus-visible, + .doc-chip:focus-visible, + .doc-ghost:focus-visible, + .doc-btn:focus-visible, + .doc-select:focus-visible, + .doc-nav__item:focus-visible, + .doc-pager__item:focus-visible, + .doc-palette__item:focus-visible { + outline: 2px solid var(--color-focus); + outline-offset: 2px; + } + .doc-nav__item:focus-visible, + .doc-palette__item:focus-visible { outline-offset: -2px; } } diff --git a/src/lib/codeText.jsx b/src/lib/codeText.jsx new file mode 100644 index 0000000..3dd9efb --- /dev/null +++ b/src/lib/codeText.jsx @@ -0,0 +1,23 @@ +import { Fragment } from 'react'; + +const BREAK_AFTER = '/.,:;()[]{}<>'; + +export function codeText(text) { + if (!text) return null; + const chunks = []; + let current = ''; + for (const ch of text) { + current += ch; + if (BREAK_AFTER.includes(ch)) { + chunks.push(current); + current = ''; + } + } + if (current) chunks.push(current); + return chunks.map((chunk, index) => ( + + {chunk} + {index < chunks.length - 1 ? : null} + + )); +} diff --git a/src/lib/useCopy.jsx b/src/lib/useCopy.jsx new file mode 100644 index 0000000..6e2bec0 --- /dev/null +++ b/src/lib/useCopy.jsx @@ -0,0 +1,53 @@ +import { useCallback, useEffect, useRef, useState } from 'react'; + +function fallbackCopy(text) { + const field = document.createElement('textarea'); + field.value = text; + field.setAttribute('readonly', ''); + field.style.position = 'fixed'; + field.style.top = '0'; + field.style.opacity = '0'; + document.body.appendChild(field); + field.select(); + let done = false; + try { + done = document.execCommand('copy'); + } catch { + done = false; + } + document.body.removeChild(field); + return done; +} + +export function useCopy(timeout = 2400) { + const [state, setState] = useState('idle'); + const timer = useRef(0); + + useEffect(() => () => window.clearTimeout(timer.current), []); + + const copy = useCallback( + (text) => { + const fallback = () => fallbackCopy(text); + const request = + navigator.clipboard && navigator.clipboard.writeText + ? navigator.clipboard.writeText(text).catch(fallback) + : Promise.resolve(fallback()); + + request.then( + (result) => { + setState(result === false ? 'failed' : 'copied'); + window.clearTimeout(timer.current); + timer.current = window.setTimeout(() => setState('idle'), timeout); + }, + () => { + setState('failed'); + window.clearTimeout(timer.current); + timer.current = window.setTimeout(() => setState('idle'), timeout); + } + ); + }, + [timeout] + ); + + return [state, copy]; +} diff --git a/src/tokens.css b/src/tokens.css new file mode 100644 index 0000000..43afcb1 --- /dev/null +++ b/src/tokens.css @@ -0,0 +1,66 @@ +:root { + --space-3xs: 2px; --space-2xs: 4px; --space-xs: 8px; --space-sm: 12px; --space-md: 16px; --space-lg: 24px; --space-xl: 40px; --space-2xl: 64px; --space-3xl: 96px; --space-4xl: 144px; + --text-xs: 0.8125rem; --text-sm: 0.875rem; --text-md: 1rem; --text-lg: 1.25rem; --text-xl: 1.5625rem; --text-2xl: 1.953rem; --text-3xl: 2.441rem; + --text-display-s: clamp(2.25rem, 4vw + 0.5rem, 3.75rem); --text-display: clamp(2.75rem, 5vw + 1rem, 5.25rem); + --text-section: clamp(1.875rem, 2.2vw + 0.9rem, 3.25rem); --text-title: clamp(1.1875rem, 0.65vw + 0.85rem, 1.5rem); --text-lead: clamp(1.0625rem, 0.3vw + 1rem, 1.3125rem); + --ease-out: cubic-bezier(0.16, 1, 0.3, 1); --ease-glow: cubic-bezier(0.3, 0, 0.2, 1); --ease-in: cubic-bezier(0.7, 0, 0.84, 0); --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1); --ease-reveal: cubic-bezier(0.32, 0.08, 0.24, 1); + --dur-micro: 120ms; --dur-short: 220ms; --dur-long: 420ms; --dur-glow: 760ms; --dur-glow-soft: 1100ms; + --container: 1440px; --gutter: 64px; --gap-columns: 32px; --section-gap-s: 44px; --section-gap: 56px; --section-gap-l: 72px; + --z-base: 1; --z-raised: 10; --z-dropdown: 100; --z-sticky: 200; --z-sticky-nav: 300; --z-modal: 400; --z-toast: 500; --z-tooltip: 600; + --color-paper: oklch(6% 0 0); --color-paper-2: oklch(10.5% 0 0); --color-paper-3: oklch(16% 0 0); + --color-ink: oklch(98% 0 0); --color-ink-2: oklch(80% 0 0); --color-muted: oklch(60% 0 0); + --color-rule: oklch(22% 0 0); --color-rule-2: oklch(36% 0 0); + --color-accent: oklch(98% 0 0); --color-accent-ink: oklch(6% 0 0); --color-focus: oklch(98% 0 0); + --color-scrim: oklch(6% 0 0 / 0.86); + --color-signal: oklch(98% 0 0); + --color-signal-dim: oklch(98% 0 0 / 0.22); + --color-glow: oklch(100% 0 0 / 0.16); --color-glow-soft: oklch(100% 0 0 / 0.07); --color-glow-hard: oklch(100% 0 0 / 0.34); + --glow-xs: 0 0 10px oklch(100% 0 0 / 0.09); + --glow-sm: 0 0 16px oklch(100% 0 0 / 0.14); + --glow-md: 0 0 26px oklch(100% 0 0 / 0.20), 0 0 6px oklch(100% 0 0 / 0.12); + --glow-lg: 0 0 44px oklch(100% 0 0 / 0.26), 0 0 10px oklch(100% 0 0 / 0.16); + --glow-edge: inset 0 1px 0 oklch(100% 0 0 / 0.12); + + --aura-control: 0 0 0 1px oklch(100% 0 0 / 0.11), 0 0 9px 0 oklch(100% 0 0 / 0.15); + --aura-control-lit: 0 0 0 1px oklch(100% 0 0 / 0.22), 0 0 14px 1px oklch(100% 0 0 / 0.24); + --glow-text: 0 0 18px oklch(100% 0 0 / 0.32); + + --halo-faint: 0 0 10px oklch(100% 0 0 / 0.05); + --halo-whisper: 0 0 8px oklch(100% 0 0 / 0.028); + --halo-title: + 0 0 4px oklch(100% 0 0 / 0.46), + -3px 0 15px oklch(100% 0 0 / 0.30), + 3px 0 15px oklch(100% 0 0 / 0.30), + 0 0 40px oklch(100% 0 0 / 0.17), + 0 0 96px oklch(100% 0 0 / 0.07); + --halo-doc-title: + 0 0 4px oklch(100% 0 0 / 0.42), + -3px 0 15px oklch(100% 0 0 / 0.28), + 3px 0 15px oklch(100% 0 0 / 0.28), + 0 0 34px oklch(100% 0 0 / 0.16), + 0 0 80px oklch(100% 0 0 / 0.07); + --halo-doc-head: + 0 0 3px oklch(100% 0 0 / 0.30), + -2px 0 10px oklch(100% 0 0 / 0.16), + 2px 0 10px oklch(100% 0 0 / 0.16), + 0 0 24px oklch(100% 0 0 / 0.08); + --halo-method: + 0 0 4px oklch(100% 0 0 / 0.62), + -2px 0 12px oklch(100% 0 0 / 0.34), + 2px 0 12px oklch(100% 0 0 / 0.34), + 0 0 30px oklch(100% 0 0 / 0.20), + 0 0 70px oklch(100% 0 0 / 0.08); + --font-display: "Tektur", "Onest", ui-sans-serif, sans-serif; --font-body: "Onest", ui-sans-serif, system-ui, sans-serif; --font-outlier: "JetBrains Mono", ui-monospace, monospace; + --text-poster: clamp(4rem, 9vw, 8.5rem); + --radius-card: 12px; --radius-input: 12px; --radius-control: 12px; --radius-panel: 16px; --radius-pill: 999px; --rule-hair: 1px; --shadow-card: none; + --doc-head-h: 68px; + --tracking-display: 0em; +} + +@media (max-width: 48rem) { + :root { + --gutter: 20px; --gap-columns: 20px; + --section-gap-s: 34px; --section-gap: 44px; --section-gap-l: 56px; + --space-2xl: 40px; --space-3xl: 56px; --space-4xl: 72px; --space-xl: 32px; + } +} diff --git a/tailwind.config.js b/tailwind.config.js index 533c714..7e24732 100644 --- a/tailwind.config.js +++ b/tailwind.config.js @@ -1,3 +1,5 @@ +const token = (name) => `var(--${name})`; + export default { content: [ "./index.html", @@ -6,19 +8,53 @@ export default { theme: { extend: { colors: { - background: "#050508", - surface: "#0c0d12", - "surface-card": "#12141c", - "surface-border": "rgba(255, 255, 255, 0.08)", - "surface-hover": "rgba(255, 255, 255, 0.04)", - primary: "#ffffff", - secondary: "#94a3b8", - muted: "#64748b", - accent: "#38bdf8", + paper: token('color-paper'), + 'paper-2': token('color-paper-2'), + 'paper-3': token('color-paper-3'), + ink: token('color-ink'), + 'ink-2': token('color-ink-2'), + muted: token('color-muted'), + rule: token('color-rule'), + 'rule-2': token('color-rule-2'), + accent: token('color-accent'), + 'accent-ink': token('color-accent-ink'), + focus: token('color-focus'), + scrim: token('color-scrim'), + success: token('color-success'), }, fontFamily: { - sans: ['Inter', 'system-ui', '-apple-system', 'sans-serif'], - mono: ['JetBrains Mono', 'Fira Code', 'monospace'], + display: token('font-display'), + sans: token('font-body'), + mono: token('font-outlier'), + }, + fontSize: { + poster: [token('text-poster'), { lineHeight: '0.92' }], + display: [token('text-display'), { lineHeight: '1.02' }], + section: [token('text-section'), { lineHeight: '1.05' }], + title: [token('text-title'), { lineHeight: '1.2' }], + lead: [token('text-lead'), { lineHeight: '1.45' }], + }, + maxWidth: { + container: token('container'), + }, + borderRadius: { + card: token('radius-card'), + input: token('radius-input'), + pill: token('radius-pill'), + }, + transitionTimingFunction: { + out: token('ease-out'), + }, + transitionDuration: { + micro: '120ms', + short: '220ms', + }, + zIndex: { + base: '1', + raised: '10', + dropdown: '100', + sticky: '200', + 'sticky-nav': '300', }, }, }, diff --git a/vite.config.js b/vite.config.js index 2a52cc9..64252e6 100644 --- a/vite.config.js +++ b/vite.config.js @@ -3,6 +3,12 @@ import react from '@vitejs/plugin-react'; export default defineConfig({ plugins: [react()], + server: { + allowedHosts: true + }, + preview: { + allowedHosts: true + }, base: './', build: { outDir: 'dist',