Fix emoji and sticker saving

This commit is contained in:
Natsumi
2025-06-27 19:54:00 +12:00
parent 4e09c78e32
commit 1da99c7ca6
3 changed files with 60 additions and 19 deletions

View File

@@ -283,16 +283,20 @@ export default class extends baseClass {
if ($app.saveInstanceEmoji) {
try {
// https://api.vrchat.cloud/api/1/inventory/spawn?id=inv_75781d65-92fe-4a80-a1ff-27ee6e843b08
// https://api.vrchat.cloud/api/1/user/usr_032383a7-748c-4fb2-94e4-bcb928e5de6b/inventory/inv_75781d65-92fe-4a80-a1ff-27ee6e843b08
const url = new URL(gameLog.url);
if (
url.pathname.substring(0, 22) ===
'/api/1/inventory/spawn'
url.pathname.substring(0, 12) ===
'/api/1/user/' &&
url.pathname.includes('/inventory/inv_')
) {
const inventoryId = url.searchParams.get('id');
if (inventoryId && inventoryId.length === 40) {
const pathArray = url.pathname.split('/');
const userId = pathArray[4];
const inventoryId = pathArray[6];
if (userId && inventoryId.length === 40) {
$app.queueCheckInstanceInventory(
inventoryId
inventoryId,
userId
);
}
}
@@ -454,6 +458,7 @@ export default class extends baseClass {
$app.trySaveStickerToFile(
gameLog.displayName,
gameLog.userId,
gameLog.inventoryId
);
break;