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