Repository navigation
feat: index aiogram, python-telegram-bot and grammY documentation - #1
Merged
Merged
Conversation
Add the guides and bot-facing references of the three most-used bot libraries: aiogram (docs.aiogram.dev/en/latest), python-telegram-bot (docs.python-telegram-bot.org/en/stable and the official wiki) and grammY (grammy.dev, read from the site's Markdown sources). Generated per-type pages that mirror the Bot API, grammY's /ref/ and translations stay out. - library_path() sets a strict boundary per host; released versions (/en/vX.Y.Z/) are readable on demand and never queued for crawling - the grammY sitemap and the PTB wiki sidebar feed discovery only - search areas aiogram, python-telegram-bot and grammy; core Telegram docs rank first unless the query names a library - skill guide bot-libraries.md: match the installed version and compare with the Bot API page Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Agents most often break bot code at the library level, and the server indexed none of the library docs. This adds the official docs of the three most-used bot libraries:
https://docs.aiogram.dev/en/latest/latestis built from the main branch; aiogram'sstablealias redirects to it)https://docs.python-telegram-bot.org/en/stable/+ official wiki (_Sidebar.md)stable= release tag)https://grammy.dev/sitemap.xml→ Markdown sources ingrammyjs/websiteAbout 250 pages in total, next to 6,600+ core pages in a full corpus. A real crawl of all of them took 58 s.
Left out on purpose: generated per-type pages that mirror the Bot API (aiogram
api/types,api/methods,api/enums, theapi/TOC with 916k characters; PTBtelegram.<Type>, ~300 pages; grammY/ref/, ~880 pages), translations, contributor pages. Not added: Telegraf (last release v4.16.3, Feb 2024), Telethon and Pyrogram (GitHub repos archived), TON Connect SDK reference (TypeDoc; TON Connect is already covered through docs.ton.org).How
library_path()holds a strict boundary per host: no query strings, assets,_modules/_static/_sources, other languages or repos.telegram.ext.is matched with the dot, sotelegram.externalreplyinfostays out.fetch_location(), cited by human URLs — the same pattern as TON. GitHub wiki[[Title|Page]]links are resolved.INDEX_ONLY: the grammY sitemap and the PTB wiki sidebar feed discovery but get no search chunks (their URL lists would match everything).[source]links are stripped./en/vX.Y.Z/) can be read on demand to match an installed version and are never added to the frontier.aiogram,python-telegram-bot,grammy— per library, because the agent knows which library the project uses and Python and TypeScript snippets should not mix. Core Telegram docs rank first unless the query names a library (aiogram,PTB,python-telegram-bot,telegram.ext,grammY, optionally with a version). The name is removed from the full-text terms, because most chunks never repeat it.references/bot-libraries.md(installed version first, pinned docs, compare with the Bot API page and changelog, say when versions differ) and a row inSKILL.md.Checks
uv run --frozen python -m unittest discover -s tests -v: 70 passed (15 new intests/test_libraries.py).searchindex.js; 3 PTB wiki links are 404 on GitHub itself.scripts/check_sources.pyon the four new entry points: healthy.aiogram 3 callback query handler→dispatcher/router.html§ Callback query;PTB ConversationHandler→telegram.ext.conversationhandler.html;grammY inline keyboard→plugins/keyboard;inline keyboard,answerCallbackQuery,webhook→ only Bot API / Bot FAQ in the top five. Details indocs/validation.md.Worth a look
2 × len(SEEDS), somaintenance_tick()now takes the round-robin_fair_maintenancepath by default (the same path small budgets already used).🤖 Generated with Claude Code