mirror of
https://github.com/tiennm99/tiennm99bot.git
synced 2026-10-12 22:15:01 +00:00
A meteor coloured by rarity falls across a night sky, lands in a white flash, and the label is revealed with its stars popping in. The caller picks the result and rarity; the route only draws it. Renders as silent H.264 so Telegram plays it as an animation without GIF banding, and shares the render slots with /api/gif.
1.2 KiB
1.2 KiB
miti99bot Integration
Future bot integration should keep winner handling explicit.
Recommended Flow
- Bot parses
/wheelofnamesbetaoptions. - Bot chooses
winnerIndexlocally. - Bot calls
POST /api/gif. - Bot sends response bytes with Telegram
sendAnimation. - Bot caption uses local winner as source of truth.
- If the service fails, bot falls back to existing local GIF renderer.
Request
Send Authorization: Bearer <API_TOKEN> with the JSON body.
{
"options": ["alice", "bob", "carol"],
"winnerIndex": 1,
"durationMs": 6500,
"holdMs": 1200,
"fps": 15,
"size": 512,
"theme": "classic"
}
Response
- Body:
image/gif - Headers:
X-Wheel-Winner-IndexX-Wheel-WinnerX-Render-Duration-Ms
X-Wheel-Winner is URL-encoded. Decode it before displaying if service-side
winner selection is used.
Gacha
/gacha in miti99bot calls POST /api/gacha on the same service and token.
The bot derives the endpoint from WHEELOFNAMES_API_URL by replacing its last
path segment (/api/gif becomes /api/gacha), picks the result and rarity
itself, and sends the MP4 with sendAnimation. On any failure it falls back to
a text reply.