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 {
|
} 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) => {
|
||||||
|
|
Loading…
Reference in a new issue