Public
ScottHub - Telegram Bot Hosting Platform with webhooks
Val Town is a collaborative website to build and scale JavaScript apps.
Deploy APIs, crons, & store data – all from the browser, and deployed in milliseconds.

πŸ€– ScottHub β€” Telegram Bot Hosting Platform

A complete Telegram-bot hosting platform built on Val Town. Upload a Python bot file, and ScottHub wires it through a webhook router so it goes live instantly β€” no server rental, no Python process to manage.

Bot: @BlackCodeHatHostingBot Channel: @ScottHubs (required to join) Archive: every uploaded file is forwarded to @ProjectScottCode


✨ Features

For users (Telegram main interface β€” reply keyboards, not inline)

  • πŸ–₯ Host β€” main dashboard
    • πŸ—„ Server β€” shows the Free tier
    • ⬆️ Upload Files β€” drop your main.py
    • πŸ“ Manage Files β€” add, delete, set main file
    • ⏱ Host Time β€” 2-day countdown
    • ⏹ Stop / πŸ”„ Restart
    • πŸ“œ Logs β€” recent webhook events for your bot
    • πŸ—‚ Switch Project β€” flip between your 2 slots
  • πŸ‘₯ Referral β€” share your link, earn 2 friends β†’ 1 free host slot
  • πŸ“Š Status β€” platform stats + your personal stats
  • ℹ️ Help

Smart uploader

On upload of a .py file ScottHub automatically:

  • Detects the bot token
  • Detects admin / owner id
  • Scans all import / from … import … and maps them to pip packages (telegramβ†’python-telegram-bot, bs4β†’beautifulsoup4, cv2β†’opencv-python, etc.)
  • Registers the bot's webhook to the ScottHub router β†’ bot is instantly ONLINE
  • Forwards the file to @ProjectScottCode for archival

Free-tier rules

RuleValue
CostFree
Duration per slot2 days
Referrals required / slot2
Slots per user2
Admin (6511143869)No referrals required

Web Admin Panel

/panel β€” login Scott / ReyBalor21

  • Dashboard (users, projects, running, messages)
  • All projects list
  • Per-project detail: set/remove webhook, extend time, override token, delete
  • Live Telegram getWebhookInfo feed
  • Event log
  • Main-bot webhook control (bring the ScottHub bot itself online)

πŸ—Ί Architecture

Rendering mermaid diagram...

πŸ“ Project structure

main.ts                     # bootstrap, re-exports Hono app
handlers/
  app.ts                    # Hono routes
  router.ts                 # main-bot update dispatcher
  screens.ts                # every menu screen (Host, Server, Referral…)
  actions.ts                # upload/manage/stop/restart actions
  hosted_webhook.ts         # router for uploaded bots (webhook-only)
  access.ts                 # channel-join + referral gate
  archive.ts                # forwarder to @ProjectScottCode
  panel.ts                  # web admin panel HTML
lib/
  config.ts                 # all constants (token, api_id/hash, limits)
  telegram.ts               # Telegram Bot API client + reply keyboards
  parser.ts                 # smart Python import/token/admin parser
  utils.ts                  # helpers, base URL, escaping
database/
  schema.ts                 # migrations
  queries.ts                # typed query layer
jobs/
  expiry_sweep.ts           # 15-min cron β†’ expire projects
scripts/
  setup_webhook.ts          # one-time webhook registration

βš™οΈ Configuration

All config lives in lib/config.ts:

KeyValue
BOT_TOKEN8779579899:AAEN…
CHANNEL@ScottHubs
ARCHIVE_CHANNEL@ProjectScottCode
ADMIN_ID6511143869
TG_API_ID31802482
TG_API_HASH184c16c584a0e350a252271029cf7eb7
REFERRALS_REQUIRED2
HOST_DURATION_SECONDS172800 (2 days)
MAX_PROJECTS_PER_USER2

🚦 Setup (already done)

  1. Run scripts/setup_webhook.ts β†’ registers POST /bot as the main-bot webhook βœ…
  2. The cron jobs/expiry_sweep.ts runs every 15 min to auto-expire slots βœ…
  3. Open /panel to manage hosted bots through the web UI βœ…

πŸ”’ Webhook-only hosting

Val Town can't run Python processes β€” instead, ScottHub stores each bot's code, registers its webhook to our router, and replies via the bot's token. When a command like /start comes in, ScottHub parses the handler text from the Python source and responds. For production Python execution you would plug in an external runner that reads the same DB and posts replies through the same router.

πŸ“ License / remixing

/source redirects to the Val Town source β€” feel free to remix!