Compare commits
No commits in common. "0879da00959d87200e94a01501e689d724f304b3" and "17dbff00a806ceee2565cb4db9f0959f4de6104d" have entirely different histories.
0879da0095
...
17dbff00a8
@ -3,21 +3,6 @@ const { EmbedBuilder, ActionRowBuilder, StringSelectMenuBuilder } = require('dis
|
||||
const PINBOARD_SELECT_CUSTOM_ID = 'pinboard-image-select';
|
||||
const selectedImageIndexByMessage = new Map();
|
||||
|
||||
const getCacheBustValue = () => {
|
||||
const bucketSeconds = Number.parseInt(process.env.PINBOARD_CACHE_BUST_SECONDS || '60', 10);
|
||||
const safeBucketSeconds = Number.isNaN(bucketSeconds) || bucketSeconds <= 0 ? 60 : bucketSeconds;
|
||||
return Math.floor(Date.now() / (safeBucketSeconds * 1000));
|
||||
};
|
||||
|
||||
const toCacheBustedUrl = (url) => {
|
||||
if (process.env.PINBOARD_CACHE_BUST_ENABLED === 'false') {
|
||||
return url;
|
||||
}
|
||||
|
||||
const separator = url.includes('?') ? '&' : '?';
|
||||
return `${url}${separator}cb=${getCacheBustValue()}`;
|
||||
};
|
||||
|
||||
const parsePinboardImageUrls = () => {
|
||||
const raw = process.env.PINBOARD_IMAGE_URLS || '';
|
||||
return raw
|
||||
@ -37,7 +22,7 @@ const buildSelectedImageEmbed = (url, index, total) => (
|
||||
new EmbedBuilder()
|
||||
.setColor('#f59e0b')
|
||||
.setTitle(`Image selectionnee (${index + 1}/${total})`)
|
||||
.setImage(toCacheBustedUrl(url))
|
||||
.setImage(url)
|
||||
);
|
||||
|
||||
const buildImageSelectorRow = (urls, selectedIndex) => {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user