com um clique
update-api
// Parse Telegram Bot API docs and rebuild generated Ruby types and endpoints
// Parse Telegram Bot API docs and rebuild generated Ruby types and endpoints
| name | update-api |
| description | Parse Telegram Bot API docs and rebuild generated Ruby types and endpoints |
| disable-model-invocation | true |
| allowed-tools | Bash, Read, Edit, Grep, WebFetch |
Update generated types and API endpoints from the latest Telegram Bot API documentation.
CHANGELOG.md and find the highest Bot API version mentioned to determine which version this lib currently supports.Run both parse tasks to scrape the latest Telegram Bot API docs:
bundle exec rake parse:types
bundle exec rake parse:methods
Before rebuilding, read the custom method files listed in Step 4 so you have a snapshot of their current content.
Regenerate Ruby source files from the parsed JSON data:
bundle exec rake rebuild:types
bundle exec rake rebuild:methods
The rebuild overwrites type files from templates, losing hand-written methods. After rebuild, read each file below and restore the custom method if it's missing:
| File | Method to restore |
|---|---|
lib/telegram/bot/types/callback_query.rb | def to_s returning data.to_s |
lib/telegram/bot/types/message.rb | def to_s returning text.to_s |
lib/telegram/bot/types/chosen_inline_result.rb | alias to_s query |
lib/telegram/bot/types/inline_query.rb | alias to_s query |
lib/telegram/bot/types/inline_keyboard_markup.rb | def to_compact_hash that calls to_compact_hash on nested InlineKeyboardButton items |
lib/telegram/bot/types/reply_keyboard_markup.rb | def to_compact_hash that calls to_compact_hash on nested KeyboardButton items |
lib/telegram/bot/types/update.rb | def current_message that finds the first non-update_id attribute value |
For each file:
end of the class, with one blank line before itRun git diff --stat and then git diff to review all changes. Summarize what was added/modified/removed compared to the previous version.
Run linting and tests to verify everything is correct:
bundle exec rubocop
bundle exec rake spec
If rubocop or tests fail, fix the issues before finishing.