@telegram.ts/documentation v0.1.2
A lightweight TypeScript and JavaScript library for searching the Telegram API documentation.
📖 Installation
To install the library, run the following command:
npm install @telegram.ts/documentation
⭐️ Usage
Here's an example of how to use the library:
import { Search } from '@telegram.ts/documentation';
const search = new Search('https://raw.githubusercontent.com/Sempai-07/Telegramsjs/main/src/BaseClient.d.ts');
(async () => {
// Get the function declaration
const functionDeclaration = await search.getFunction('sendPhoto');
console.log(functionDeclaration);
// Get the documentation link for the function
const functionLink = await search.getFunctionLink('sendPhoto');
console.log(functionLink);
// Get the documentation link for an object
const objectLink = await search.getObject('Message');
console.log(objectLink);
})();
🔥 API
Search
The main class of the library.
🫡 Constructor
constructor(fileUrl: string)
: Creates a new instance of theSearch
class with the specified file URL.
🎮 Methods
getContent(): Promise<string | null>
: Retrieves the content of the file from the specified URL.getFunction(functionName: string): Promise<string | null>
: Searches for a function in the file by its name and returns the function declaration.getFunctionLink(functionName: string): Promise<string | null>
: Returns the documentation link for the specified function.getObject(objectName: string): Promise<string>
: Returns the documentation link for the specified object.
📜 License
This library is licensed under the MIT License. See the LICENSE file for more details.