Public
beryacode
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.
A Telegram bot that registers servants for the ቤርያ ፌሎሺፕ የዓመት ማጠቃለያ ፕሮግራም (year-end ceremony). It collects each person's name, phone, and chosen service stream, takes a Telebirr payment screenshot, then lets an admin verify or reject the payment and sends a digital entry ticket.
This runs 24/7 on Val Town via a Telegram webhook — no always-on server needed.
Rendering mermaid diagram...
- Create the bot with @BotFather (
/newbot) and copy the token. - Set the
TELEGRAM_TOKENenvironment variable to that token. - Set the
ADMIN_IDenvironment variable to your Telegram numeric user ID (the only account allowed to verify/reject). You can get it from @userinfobot. - Visit the val's HTTP endpoint once — this auto-registers the webhook with Telegram.
- Message your bot
/startto test.
| File | Purpose |
|---|---|
main.ts | HTTP webhook entry point; registers the webhook and routes updates |
bot.ts | Conversation logic (name → phone → stream → payment) + admin verify/reject |
db.ts | SQLite storage for registrations (replaces the old CSV file) |
config.ts | Event details, Telebirr info, and service streams |
Registrations are stored in this val's SQLite database in a registrations table — including status (PENDING / VERIFIED / REJECTED). Nothing is lost when the bot restarts.