Fix expiry?
This commit is contained in:
parent
76187acb43
commit
3dab86510c
2
index.js
2
index.js
|
@ -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) => {
|
||||
|
|
Loading…
Reference in a new issue