writing-methods

Guide developers in creating and modifying mtcute high-level client methods.

541|61|Updated Apr 8, 2021
One-click install
npx skills add https://github.com/mtcute/mtcute --skill writing-methods
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: writing-methods
Source: https://github.com/mtcute/mtcute/tree/main/.claude/skills/writing-methods
Command: npx skills add https://github.com/mtcute/mtcute --skill writing-methods

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes references (resource) components.

What problem does it solve?

This Skill provides a comprehensive guide for developers on how to add or modify high-level client methods within the mtcute library, ensuring consistency and adherence to established patterns.

Core Features & Use Cases

  • Method Signature Convention: Standardizes the structure of method functions for clarity and maintainability.
  • Codegen Annotations: Details special comments used to control code generation processes.
  • Peer Resolution: Explains how to handle different types of Telegram peer identifiers.
  • Update Handling: Guides on managing and dispatching updates received from the Telegram API.
  • Pagination: Demonstrates patterns for handling paginated API responses.
  • Use Case: A developer needs to add a new method to send messages with specific formatting options. They would consult this Skill for the correct signature, how to handle optional parameters, and how to integrate it with the existing codebase.

Quick Start

Consult the writing-methods skill for guidance on adding a new high-level client method.

Frequently Asked Questions about writing-methods

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add high-level client methods to a Telegram TypeScript library?

To add high-level client methods in TypeScript, you must follow established library conventions for function signatures, use codegen annotations, and handle peer resolution to ensure seamless integration with the Telegram MTProto API.

What are codegen annotations and how do they work for API method development?

Codegen annotations are special comments used during API method development to control code generation processes, ensuring that high-level client methods are structured correctly and maintain consistency across the library.

How do I handle peer resolution when developing Telegram API methods?

Handling peer resolution involves managing different types of Telegram peer identifiers within your client methods, ensuring the correct user, chat, or channel is targeted when the high-level API method is called.

What is the best way to manage pagination and updates in Telegram library methods?

Managing pagination and updates requires implementing specific patterns for handling paginated API responses and dispatching updates received from the Telegram API within your high-level client methods.

How do I ensure correct method signature conventions for library development?

Correct method signature conventions are achieved by standardizing the structure of method functions, which provides clarity and maintainability when adding or modifying high-level client methods in the library.

Does this guide cover error management for Telegram MTProto methods?

Yes, error management is covered to ensure adherence to established patterns for method development, guiding developers on handling exceptions and errors returned by the Telegram MTProto API.