Repository navigation
v2.12.0 — Batched Saves, Graceful Shutdown & Full Persistence
🎉 Alisa Reaction Bot — v2.12.0
Full changelog from v1.0.5 to v2.12.0 — 15 releases, 16 files changed, 5,300+ lines of improvements.
⚡ v2.12.0 — Batched Saves & Graceful Shutdown
- Writes are now debounced — state changes flush to storage at most once every 5 seconds instead of on every event
- Reduces Vercel KV writes from hundreds/minute to ~12/minute max
scheduleSave()marks state dirty and schedules a delayed writeflush()does an immediate write on shutdown and critical moments
- SIGTERM/SIGINT handlers — bot flushes all pending state before exiting
uncaughtExceptionhandler also triggers a flush before crash-exit- Store initialized at startup in
index.jsfor double safety
🛡️ v2.11.0 — Full State Persistence
- All in-memory state now persists across restarts via the Store
- Per-chat custom reactions (
/setreactions) — survives restarts - Paused chats (
/pause,/resume) — survives restarts - Runtime restrictions (
/restrict,/unrestrict) — survives restarts - Welcome/leave toggles (
/welcome,/goodbye) — survives restarts - Stats counters (messages processed, reactions sent, command usage) — survives restarts
- Per-chat custom reactions (
/statsnow shows global lifetime stats, not just current session/leaveand/removeclean up all related persistent data
📦 v2.10.0 — Persistent Chat Tracking
- Persistent chat storage — bot remembers every chat across restarts
- Environment-aware: auto-detects Vercel KV (Redis) or falls back to local
data/state.json - New
api/store.jsmodule with unified API - Tracks: chat ID, title, type, first seen, last seen, total message count
- Environment-aware: auto-detects Vercel KV (Redis) or falls back to local
/chatsnow shows all historical chats sorted by type with emoji indicators/statsdisplays both session and total persistent chat counts + storage backend
👑 v2.9.0 — Admin Panel Separated from Help
- Owner-only commands removed from public
/help— no longer visible to regular users - New
𝘤Pᴀɴᴇʟinline button visible only to the bot owner - New
!admincallback handler with owner verification - Styled as a dedicated admin panel with all owner-only commands
🦊 v2.8.0 — Alisa Mikhailovna Kujou Character Rewrite
- Complete personality rewrite matching Alisa Mikhailovna Kujou from Alya Sometimes Hides Her Feelings in Russian
- Tsundere tone — pride, sharp wit, hidden warmth
- Russian at emotional moments — Хмпф, Хорошо, Спасибо, Дурак, До свидания, Великолепно, Ахаха
- Every message rewritten: start, help, about, donate, ping, paused, resumed, broadcast, stats, welcome, leave, callbacks
- About page restructured with character lore, version, network, channels, and credits
- README.md added "Who Is Alisa Mikhailovna Kujou?" wiki profile section
📮 v2.7.0 — AdLab, Photo Support, Welcome/Leave & UI Overhaul
- AdLab — centralized ad library (
api/ads.js) with random ad selection and HTML-formatted footers - Photo support — bot sends photos with key commands when
BOT_PHOTOis configured- New
sendPhoto(),editMessageMedia(),editMessageCaption(),deleteMessage()methods
- New
- Close button (✖️) on every inline keyboard — deletes the message
- Buttons on all commands —
/ping,/pause,/resume,/setreactions,/broadcast,/log, etc. - Welcome & Leave messages —
/welcomeand/goodbyeadmin toggles for groups- Auto-deletes Telegram's default join/leave notifications
- IST timestamps — all times displayed in Indian Standard Time (UTC+5:30)
- Switched parse_mode from Markdown to HTML for reliable formatting across all Telegram clients
🐛 v2.6.1 — /randomlevel Bug Fixes
- Works in private chats (shows global default info)
- Added
isNaNguard — invalidRANDOM_LEVELenv var no longer breaks group reactions - Fixed threshold logic:
Math.random() < thresholdso level 10 truly means "never react" - Added try-catch error handling
🗑️ v2.6.0 — Card Feature Removed
- All
/cardrelated commands and functionality removed — bot focuses purely on auto-reaction - Removed:
/card,/cardlight,/carddark,/cardpal,/cardvrf,/cardphoto - Removed inline query handler, card helper functions, card cooldown system
- Cleaned up unused imports and card references from docs
🎯 v2.5.0 — Inline Mode & Per-Chat Random Level
- Inline Mode —
@AlisaReactionBot <username>generates profile cards with 6 theme options /randomlevel <0-10>— group admins set custom reaction randomness per chat- Added
answerInlineQuery()API method - Webhook now receives inline query updates
🎨 v2.4.0 — Card Commands Refactored
- Removed
/cardinline buttons — all customization is now command-based - New commands:
/cardlight,/carddark,/cardpal,/cardvrf,/cardphoto - Removed
pendingCardPhotoconversation state — single command replaces multi-step flow
🖼️ v2.3.0 — Telegram Card Generator
/card <username>— generate live Telegram profile card images- Inline button themes (☀️ Light, 🌙 Dark), 12 color palettes, verified badge toggle
- Custom photo avatar support, 60s cooldown, refresh button
- New
editMessageMedia()API method
🔧 v2.2.1 — 12 Upgrades & Security Hardening
New Commands:
/leave <chat_id>,/remove <chat_id>— owner-only chat removal/chats— owner-only list of all active chats/setwebhook <url>— set webhook via Telegram/restrict <chat_id>,/unrestrict <chat_id>— runtime chat restrictions
Security:
- Webhook auto-secret (random UUID if
WEBHOOK_SECRETnot set) - Broadcast cooldown (60s between broadcasts)
- Chat ID validation on leave/remove
Quality:
- Structured logger (
log.info/warn/error) across all files - Enhanced health check with
reactionsConfiguredandrestrictedChats - Extracted landing page from
constants.jsto dedicatedapi/landing.js - Startup env validation for
BOT_TOKENandBOT_USERNAME
Bug Fixes:
- Fixed Cloudflare Workers crash (
new returnHTML()→returnHTML()) - Fixed donate message formatting (removed problematic backticks)
- Removed dead payment code (
sendInvoice,answerPreCheckoutQuery)
✨ v2.2.0 — Core Feature Expansion
Commands:
/ping— latency check with live response time/setreactions <emojis>— per-chat custom reaction emojis/pause//resume— admin pause/resume for groups/broadcast <message>— owner-only broadcast to all chats/log— owner-only last 10 reactions view
Security:
OWNER_IDenv var for owner-only commandsWEBHOOK_SECRETfor webhook validation (rejects spoofed requests)- Request size limit (1MB)
- Rate limiting (30 reactions/min per chat)
Stats:
- Messages processed, reactions sent, unique chats, uptime
- Command usage breakdown, top chats leaderboard
- Reaction log (last 50 reactions)
🎨 v2.1.0 — Interactive UI & Navigation
- Inline buttons on
/start— Help, About, Stats, Donate, Add to Channel/Group - Callback queries for instant in-message navigation (no extra messages)
- Custom donate message with PayPal, Ko-fi, and Telegram Stars
- New
/help,/about,/stats,/donatecommands - In-memory stats tracking
🚀 v2.0.0 — Serverless Architecture
- Complete rewrite as serverless application
- Cloudflare Workers, Vercel, Docker deployment support
- Express server for Docker/VPS/local development
- Webhook-based architecture with zero cold starts on edge
📊 Stats
| Metric | Value |
|---|---|
| Files changed | 16 |
| Lines added | ~5,300+ |
| New modules | store.js, landing.js, ads.js |
| New commands | 20+ |
| Deployment platforms | 5 (Cloudflare, Vercel, Docker, Railway, Render) |
Full diff: v1.0.5...v2.12.0
Хмпф… Not that you needed all this detail. But you're welcome. ✨