Telegram bot for editing Better Life SG website
Find a file
Andre K eb8f283e44
Some checks failed
Deploy BetterBot / deploy (push) Failing after 2s
Deploy BetterBot / notify (push) Successful in 3s
fix: update README for deployment instructions and improve code formatting
2026-04-19 08:57:58 +08:00
.forgejo/workflows feat: fork from CodeAnywhere framework 2026-04-19 08:01:27 +08:00
compose feat: fork from CodeAnywhere framework 2026-04-19 08:01:27 +08:00
frontend feat: fork from CodeAnywhere framework 2026-04-19 08:01:27 +08:00
provisioners feat: fork from CodeAnywhere framework 2026-04-19 08:01:27 +08:00
scripts feat: fork from CodeAnywhere framework 2026-04-19 08:01:27 +08:00
static feat: fork from CodeAnywhere framework 2026-04-19 08:01:27 +08:00
tools fix: update README for deployment instructions and improve code formatting 2026-04-19 08:57:58 +08:00
.env feat: fork from CodeAnywhere framework 2026-04-19 08:01:27 +08:00
.gitignore feat: fork from CodeAnywhere framework 2026-04-19 08:01:27 +08:00
background_tasks.py feat: fork from CodeAnywhere framework 2026-04-19 08:01:27 +08:00
config.py fix: use polling mode for Telegram (no WEBHOOK_BASE_URL) 2026-04-19 08:08:56 +08:00
copilot_runtime.py feat: fork from CodeAnywhere framework 2026-04-19 08:01:27 +08:00
docker-entrypoint.sh feat: fork from CodeAnywhere framework 2026-04-19 08:01:27 +08:00
Dockerfile fix: set REPOS_DIR=/repo and create the directory in Dockerfile 2026-04-19 08:06:03 +08:00
instance.py feat: fork from CodeAnywhere framework 2026-04-19 08:01:27 +08:00
learning.py feat: fork from CodeAnywhere framework 2026-04-19 08:01:27 +08:00
llm_costs.py feat: fork from CodeAnywhere framework 2026-04-19 08:01:27 +08:00
local_media_store.py feat: fork from CodeAnywhere framework 2026-04-19 08:01:27 +08:00
main.py fix: update README for deployment instructions and improve code formatting 2026-04-19 08:57:58 +08:00
model_selection.py feat: fork from CodeAnywhere framework 2026-04-19 08:01:27 +08:00
prompt_utils.py feat: fork from CodeAnywhere framework 2026-04-19 08:01:27 +08:00
pyproject.toml feat: fork from CodeAnywhere framework 2026-04-19 08:01:27 +08:00
README.md fix: update README for deployment instructions and improve code formatting 2026-04-19 08:57:58 +08:00
requirements.txt feat: fork from CodeAnywhere framework 2026-04-19 08:01:27 +08:00
ruff.toml feat: fork from CodeAnywhere framework 2026-04-19 08:01:27 +08:00
telegram_bot.py feat: fork from CodeAnywhere framework 2026-04-19 08:01:27 +08:00
tool_pipeline.py feat: fork from CodeAnywhere framework 2026-04-19 08:01:27 +08:00
tool_registry.py feat: fork from CodeAnywhere framework 2026-04-19 08:01:27 +08:00
user_store.py feat: fork from CodeAnywhere framework 2026-04-19 08:01:27 +08:00
ux.py feat: fork from CodeAnywhere framework 2026-04-19 08:01:27 +08:00
web_fallback_store.py feat: fork from CodeAnywhere framework 2026-04-19 08:01:27 +08:00

BetterBot

A Telegram bot for editing the Better Life SG website and Memoraiz app frontend. Fork of CodeAnywhere — shares the core Copilot SDK framework and only customises instance.py and tools/site_editing/.

How it works

  1. User sends a message to the Telegram bot (e.g. "Change the phone number to 91234567")
  2. BetterBot uses the CodeAnywhere Copilot SDK framework with site-editing tools
  3. Tools list / read / write files and automatically commit + push to git

Projects

Key What it manages Mount path
betterlifesg Static HTML site (Tailwind CSS via CDN) /repo/betterlifesg/site
memoraiz React 19 + Vite 6 frontend /repo/memoraiz/frontend

Stack

  • Python 3.12 + CodeAnywhere framework (Copilot SDK, python-telegram-bot)
  • Runs on RackNerd
  • Forgejo repo: andre/betterbot

Fork relationship

BetterBot shares all framework files with CodeAnywhere. The only betterbot-specific files are:

File Purpose
instance.py Bot identity, system prompt, feature flags, tool registration
tools/site_editing/ list_files / read_file / write_file with auto git push
.env Non-secret config (model defaults, site paths)
compose/ Docker compose for RackNerd with site-dir mounts
scripts/deploy-betterbot.sh Deploy script targeting RackNerd + Infisical

Deploys on RackNerd pull from the BetterBot Forgejo repo only. They do not pull directly from CodeAnywhere during deploy.

If CodeAnywhere framework files change, sync those changes into this repo first, commit them here, and then deploy BetterBot from its own master branch.

Deployment

ssh racknerd bash /opt/src/betterbot/scripts/deploy-betterbot.sh

Commands

  • /start — Introduction and examples
  • /reset — Clear conversation history
  • /model <name> — Switch LLM model
  • /current — Show current model