Stix Magic is a Telegram-first sticker creation platform hosted at stixmagic.com.
| Concept | Description |
|---|---|
| Magic Center | Main navigation hub presented on /start |
| Magic Cut | Processing pipeline that converts a photo into a sticker draft |
| Draft Vault | Holds un-actioned sticker drafts |
| Review System | Inline Approve / Retry / Trash / Save actions on every draft |
stixmagic-bot.js β Main entry point
βββ bot/
β βββ index.js β Bot wiring (commands + events)
β βββ magicCenter.js β Magic Center menu hub
β βββ handlers/
β βββ stickerHandler.js β Photo β Draft (Magic Cut)
β βββ draftHandler.js β Draft review callbacks + /drafts /trash
β βββ catalogHandler.js β /catalog /mystickers
βββ services/
β βββ stickerService.js β Image processing (Magic Cut)
β βββ draftService.js β Draft lifecycle (create/approve/retry/trash/save)
β βββ usageService.js β Plan limits & usage tracking
β βββ cleanupService.js β Expired draft removal logic
βββ workers/
β βββ cleanupWorker.js β Scheduled background cleanup
βββ models/
β βββ storage.js β In-memory storage (swap for DB in production)
βββ config/
βββ limits.js β Plan limits (Free / Premium / Pro)
User sends photo
β Magic Cut processes image
β Draft created in Draft Vault
β Review card sent with:
β
Approve β marks draft as approved
π Retry β re-generates a new draft
π Trash β marks as rejected / moves to trash
πΎ Save β keeps in vault for later
β Only Approved drafts can be published to a sticker pack
| Command | Description |
|---|---|
/start |
Open Magic Center |
/menu |
Open Magic Center (alias) |
/drafts |
View Draft Vault |
/catalog |
Browse approved stickers |
/mystickers |
My sticker collection |
/trash |
View trashed drafts |
/plans |
Usage & plan information |
/help |
Help message |
| Plan | Creations | Period | Max Drafts |
|---|---|---|---|
| Free | 3 | per day | 10 |
| Premium | 50 | per month | 100 |
| Pro | 300 | per month | Unlimited |
Draft expiry and trash retention periods are configurable in config/limits.js.
npm installcp .env.example .env
# Edit .env and set BOT_TOKENnpm startFor webhook mode, also set WEBHOOK_URL in your environment.
| Variable | Required | Description |
|---|---|---|
BOT_TOKEN |
β | Telegram Bot API token |
PORT |
No | HTTP server port (default: 3000) |
WEBHOOK_URL |
No | Public base URL for webhook mode |
A background cleanup worker runs every hour and:
- Expires DRAFT/SAVED records past their expiry timestamp
- Permanently deletes REJECTED/EXPIRED records past the trash retention period
- Phase 1 (current): Magic Center, draft lifecycle, usage limits, cleanup worker
- Phase 2: Real background-removal / WebP conversion in Magic Cut
- Phase 3: Sticker pack publishing, public catalog, sharing
- Phase 4: Animated stickers, collaboration packs
MIT Β© PupFr