Git Product home page Git Product logo

pronote-bot-discord's Issues

L'API me récupère toutes les notes de l'année alors que je veux uniquement celle du trimestre

Bonjour !
J'ai un petit problème avec le code du bot Pronote .
Lorsque le bot récupère les notes, j'ai bien noté la période en tant que trimestre :

const marks = await session.marks("trimester");

Mais au final, il me récupère tout de même l'entièreté de mes notes et calcule donc une moyenne erronée du trimestre :

{
  "averages": {
         "student": 17.07,
         "studentClass": 13.49
   }
}

Moyenne Pronote

J'avais modifié le code pour pouvoir ajouter un message contenant ma moyenne mais ça ne fonctionne pas du coup
Moyenne via Bot

Est-ce que quelqu'un sais comment résoudre ce problème ?
Je vous remercie

PS : J'avais précédemment demandé de l'aide sur le Discord

SMS de notification

Bonjour, j'aimerais savoir comment vous avez fait pour récupérer la dernière note.
Ps : j'aimerais m'envoyer un sms dés que j'ai une nouvelle note !
Cordialement

Erreur, ne veut pas fonctionner

Ready. Logged as Pronote Bot#6259!
B:****\Desktop\pronote-bot-discord-1.2.2\pronote-bot-discord\index.js:93
timetable.filter((lesson) => lesson.isAway).forEach((lesson) => {
^

TypeError: Cannot read properties of null (reading 'filter')
at pronoteSynchronization (B:****\Desktop\pronote-bot-discord-1.2.2\pronote-bot-discord\index.js:93:15)
at processTicksAndRejections (node:internal/process/task_queues:96:5)

Timetable cache

J'essaye de faire un système quand les profs son absent:

    const timetable = await session.timetable()
    const proAway = timetable.filter((away) => (away.isAway));
        proAway.forEach((edt) => sendDiscordNotificationAbs(edt));

    // Mise à jour du cache pour l'emploie du temps
        writeCache({
            ...cache,
            timetable
        })

const sendDiscordNotificationAbs = (edt) => {
    (async () => {
    const taps = await client.users.fetch("321213174454026240").catch(e => { console.log(e)});
    const d = new Date(edt.from);

    const abs = `Il y a un professeur absent: ${edt.teacher} à ${d.getUTCHours() + ':' + d.getUTCMinutes() +'\n'}`

    taps.send(abs)
    fetch(`https://smsapi.free-mobile.fr/sendmsg?user=&pass=&msg=${encodeURIComponent(abs)}`)

    })
};

Sa écrit dans le cache, mais sa envoie pas de message ?

Académie ?

Yop ! Est-ce que l'académie de Aix Marseille fonctionne ?
car j'ai sa ?

(node:31436) UnhandledPromiseRejectionWarning: TypeError: cas[casName] is not a function
    at getStart (D:\Users\legot\Visual\pronote-bot-discord-master\node_modules\pronote-api\src\auth.js:60:30)
    at Object.login (D:\Users\legot\Visual\pronote-bot-discord-master\node_modules\pronote-api\src\auth.js:15:25)
    at pronoteSynchronization (D:\Users\legot\Visual\pronote-bot-discord-master\index.js:50:35)
    at Client.<anonymous> (D:\Users\legot\Visual\pronote-bot-discord-master\index.js:96:5)
    at Client.emit (events.js:210:5)
    at WebSocketManager.triggerClientReady (D:\Users\legot\Visual\pronote-bot-discord-master\node_modules\discord.js\src\client\websocket\WebSocketManager.js:431:17)
    at WebSocketManager.checkShardsReady (D:\Users\legot\Visual\pronote-bot-discord-master\node_modules\discord.js\src\client\websocket\WebSocketManager.js:415:10)
    at WebSocketShard.<anonymous> (D:\Users\legot\Visual\pronote-bot-discord-master\node_modules\discord.js\src\client\websocket\WebSocketManager.js:197:14)
    at WebSocketShard.emit (events.js:210:5)
    at WebSocketShard.checkReady (D:\Users\legot\Visual\pronote-bot-discord-master\node_modules\discord.js\src\client\websocket\WebSocketShard.js:475:12)
(node:31436) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). (rejection id: 2)
(node:31436) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Instructions?

Je suis nouveau sur github et je ne sais pas comment installer des choses, et je voudra bien une expliquation plus détaillé. Merci pour votre compréhension.

Instruction ?

Je suis debutant sur github et je ne sais pas comment faire toute les etapes donc peut on m'expliquer svp

IMPORTANT : Library now Unusable

Due to the End Of Life of pronote-api the repository Litarvan/pronote-api was emptied his history, and the NPM package was deleted

Professeur Absent - Ne marche pas ❌

    const nextWeekDay = new Date();
    nextWeekDay.setDate(nextWeekDay.getDate() + 30);
    const timetable = await session.timetable(new Date(), nextWeekDay);
    const awayNotifications = [];
    timetable.filter((lesson) => lesson.isAway).forEach((lesson) => {
        if (!cache.lessonsAway.some((lessonID) => lessonID === lesson.id)){
            awayNotifications.push({
                teacher: lesson.teacher,
                from: lesson.from,
                subject: lesson.subject,
                id: lesson.id
            });
        }
    });
    if (awayNotifications.length) {
        awayNotifications.forEach((awayNotif) => sendDiscordNotificationAway(awayNotif));
    }

    writeCache({
        ...cache,
        lessonsAway: [
            ...cache.lessonsAway,
            ...awayNotifications.map((n) => n.id)
        ]
    });

Don't work :/

Récup une note

Comment on fait pour récupérer une note en utilisant une commande ?

npm! ERR

Bonsoir, j'ai un soucis

Quand je lance le bot celui si me dis

npm ERR! code ENOVERSIONS
npm ERR! No versions available for pronote-api

npm ERR! A complete log of this run can be found in:
npm ERR! C:\Users\yeikzy\AppData\Local\npm-cache_logs\2022-02-08T12_20_29_523Z-debug-0.log

installer le bot

Salut,
je dois surement poser une question assez basique, mais ou dois-je cloner le repository ? j'ai essayer dans le terminal d'après une vidéo et ça semble marcher, cependant lorsque je met installer les dépendances (num install) ca ne marche pas
Merci,
Algorythm

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.