refactor caching to be better , uhh changed some things to v2,,,, other things?

This commit is contained in:
2026-01-12 10:06:40 -05:00
parent d00d5bb313
commit 3b8aeff340
7 changed files with 112 additions and 141 deletions

View File

@@ -17,7 +17,7 @@ module.exports = async (client, torn, config) => {
if (slot.item_requirement) {
if (slot.item_requirement.is_available === false) {
const username = (await torn.user.profile(slot.user.id)).name;
const itemname = (await torn.cache.item(slot.item_requirement.id)).name;
const itemname = (await torn.item(slot.item_requirement.id)).name;
console.debug(`noItemOC: Found crime with unavailable item: ${crime.name}: ${slot.user.id}`);
message += `[${username}](https://www.torn.com/profiles.php?XID=${slot.user.id}) needs [${itemname}](https://www.torn.com/page.php?sid=ItemMarket#/market/view=search&itemID=${slot.item_requirement.id}) for [${crime.name}](https://www.torn.com/factions.php?step=your&type=1#/tab=crimes&crimeId=${crime.id})\n`;
itemsneeded++;

View File

@@ -22,7 +22,7 @@ module.exports = async (client, torn, config) => {
.setURL(`https://www.torn.com/factions.php?step=your&type=7#/tab=crimes&crimeId=${crime.id}`);
if (crime.rewards.money === 0) {
const itemPromises = crime.rewards.items.map(item =>
torn.cache.item(item.id).then(itemData => ({
torn.item(item.id, true).then(itemData => ({
quantity: item.quantity,
name: itemData.name,
value: itemData.value.market_price