mirror of
https://github.com/tiennm99/tiennm99bot.git
synced 2026-10-13 16:15:36 +00:00
feat(gacha): add /api/gacha wish animation rendered as MP4
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.
This commit is contained in:
1 parent
61d0e74709
commit
97d8aeaadf
16 files changed
+1111
-20
No files matched your search
@@ -45,6 +45,26 @@ try {
|
||||
}
|
||||
|
||||
console.log(`api-smoke: ${response.rawPayload.byteLength} bytes`);
|
||||
|
||||
const gacha = await app.inject({
|
||||
method: 'POST',
|
||||
url: '/api/gacha',
|
||||
headers: {
|
||||
authorization: 'Bearer smoke-token',
|
||||
},
|
||||
payload: {label: 'Pizza', rarity: 5},
|
||||
});
|
||||
|
||||
if (gacha.statusCode !== 200) {
|
||||
throw new Error(`Expected gacha 200, got ${gacha.statusCode}: ${gacha.body}`);
|
||||
}
|
||||
|
||||
const box = gacha.rawPayload.subarray(4, 8).toString();
|
||||
if (box !== 'ftyp') {
|
||||
throw new Error(`Expected MP4 ftyp box, got ${box}`);
|
||||
}
|
||||
|
||||
console.log(`api-smoke gacha: ${gacha.rawPayload.byteLength} bytes`);
|
||||
} finally {
|
||||
await app.close();
|
||||
}
|
||||
Reference in new issue
Block a user