Fix expiry?

This commit is contained in:
Christopher Cookman 2024-12-08 19:14:30 -07:00
parent 76187acb43
commit 3dab86510c

View file

@ -68,7 +68,7 @@ Client.on("interactionCreate", async (interaction) => {
} else { } else {
cached = {} cached = {}
} }
if (!cached.cnam || cached?.timestamp > new Date()) { if (!cached.cnam || new Date() > new Date(cached?.expires)) {
// Old, get from API // Old, get from API
interaction.reply({ephemeral: show, content: `<:checking:1305271116134092842> Looking up \`${number}\``}).then(() => { interaction.reply({ephemeral: show, content: `<:checking:1305271116134092842> Looking up \`${number}\``}).then(() => {
axios.get(process.env.API_URL.replaceAll("%n", number)).then((response) => { axios.get(process.env.API_URL.replaceAll("%n", number)).then((response) => {