Rewrite bot to TypeScript + grammY with webhook-first design and Heroku deploy support#29
Draft
Copilot wants to merge 2 commits into
Draft
Rewrite bot to TypeScript + grammY with webhook-first design and Heroku deploy support#29Copilot wants to merge 2 commits into
Copilot wants to merge 2 commits into
Conversation
Agent-Logs-Url: https://github.com/cyrillic-design/copy-bot/sessions/deeabc65-f7df-4442-965b-0f879e04126c Co-authored-by: jfkz <328452+jfkz@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Refactor bot to use TypeScript and grammy framework
Rewrite bot to TypeScript + grammY with webhook-first design and Heroku deploy support
Apr 1, 2026
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.
The bot was written in plain JS using Telegraf, relied on Redis/Bull for queuing, and lacked proper Heroku deployment artifacts. This rewrites it in TypeScript with grammY, switches to webhook delivery, and makes the configuration fully generic for any GitHub Pages target.
Core rewrite
index.js→src/index.ts— strict TypeScript throughout;tsconfig.jsoncompiles todist/telegraf-i18nremoved — replaced with a tiny YAML + regex helper reusing the existinglocales/ru.yamlunchangeddotenv-load→dotenvWebhook delivery
lastCommandstate is persisted to disk so it survives Heroku dyno restarts between webhook calls.Heroku deployment
Procfile:web: node dist/index.jsapp.jsonnow declares every required config var with descriptions (enables the one-click deploy button)Dockerfileupdated to a multi-stage Node 20-alpine buildUniversality
All paths and the deploy command are env-var-driven — no hardcoded project assumptions remain:
DATA_FOLDERIMAGES_FOLDERIMAGES_SLUGRUN_COMMANDgit push)Tooling
eslint.config.js) with@typescript-eslint.tsfilesnpm testnow runs lint +tsccompile checkOriginal prompt