INNER CODE UNIT · JavaScript

futureDate

nyxxbit/discord-quest-completer · index.js:379

    const futureDate = (raw) => {
        try {
            if (!raw) return null;
            const when = raw instanceof Date ? raw : new Date(raw);
            return Number.isNaN(when.getTime()) || when.getTime() <= Date.now() ? null : when;
        } catch (_) { return null; }
    };

    const enrollmentBlockedUntil = () => futureDate(Mods.QuestStore?.questEnrollmentBlockedUntil);

    // Discord returns this beside questEnrollmentBlockedUntil on the quest list fetch and its own
    // client refuses to start any unfinished quest while it is set. Enrollment being blocked stops
    // new quests; access being suspended stops everything.
    const questAccessSuspendedUntil = () => {
        const store = Mods.QuestStore;
        if (!store) return null;
        const explicit = futureDate(store.questAccessSuspendedUntil);
        if (explicit) return explicit;

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…