bot icon indicating copy to clipboard operation
bot copied to clipboard

Improve and clarify doc comments for public API

Open steindvart opened this issue 4 months ago • 0 comments

Problem

Many documentation comments in the go-telegram/bot library lack important details. For example:

  • Some comments do not clarify how the function or entity works. For example, WithMiddlewares allows to set middlewares for each incoming request does not specify the order of middleware execution. A more informative comment would be:
    // Set middlewares for each incoming request (update).
    // Middleware functions are called in the order in which they are added.
    
  • Comments such as SetWebhook https://core.telegram.org/bots/api#setwebhook should be changed to See Telegram API: https://core.telegram.org/bots/api#setwebhook for clarity and consistency.
  • etc.

Proposal

  • Add specific details where needed, such as the order of function calls or links to official documentation.
  • Use concise language and keep the main point clear.

Arguments

  • Clear and informative doc comments help developers use the library correctly and efficiently.

steindvart avatar Oct 30 '25 05:10 steindvart