| 359 | 359 | // We build a hash seed based on: unique chat file, raw content, and the placement inside this content |
| 360 | 360 | // This allows us to get unique but repeatable picks in nearly all cases |
| 361 | 361 | const combinedSeedString = `${chatIdHash}-${rawContentHash}-${offset}`; |
| 362 | 362 | const finalSeed = getStringHash(combinedSeedString).toString(); |
| 363 | + // @ts-ignore - have to use numbers for legacy picks |
| 363 | 364 | const rng = seedrandom(finalSeed); |
| 364 | 365 | const randomIndex = Math.floor(rng() * list.length); |
| 365 | 366 | return list[randomIndex]; |