koishi-plugin-ggcevo-game 0.3.6 → 0.3.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.js +5 -5
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1046,17 +1046,17 @@ ${output}`;
|
|
|
1046
1046
|
if (!backpack || backpack.quantity < 1) {
|
|
1047
1047
|
return `当前扭蛋币不足,剩余:${backpack?.quantity || 0}枚`;
|
|
1048
1048
|
}
|
|
1049
|
-
await ctx.database.upsert("ggcevo_backpack", [{
|
|
1050
|
-
handle,
|
|
1051
|
-
itemId: 3,
|
|
1052
|
-
quantity: backpack.quantity - 1
|
|
1053
|
-
}]);
|
|
1054
1049
|
const award = PetCapsuleToy();
|
|
1055
1050
|
const items = await ctx.database.get("ggcevo_items", { name: award });
|
|
1056
1051
|
if (items.length === 0) {
|
|
1057
1052
|
return `系统错误,奖品${award}不存在,请联系管理员。`;
|
|
1058
1053
|
}
|
|
1059
1054
|
const item = items[0];
|
|
1055
|
+
await ctx.database.upsert("ggcevo_backpack", [{
|
|
1056
|
+
handle,
|
|
1057
|
+
itemId: 3,
|
|
1058
|
+
quantity: backpack.quantity - 1
|
|
1059
|
+
}]);
|
|
1060
1060
|
const [userAward] = await ctx.database.get("ggcevo_backpack", { handle, itemId: item.id });
|
|
1061
1061
|
const currentQuantity = userAward ? userAward.quantity : 0;
|
|
1062
1062
|
await ctx.database.upsert("ggcevo_backpack", [{
|