Comments (6)
J'ai essayé sa:
const timetable = await session.timetable()
const proAway = timetable.filter((edt) => (cache.homeworks.some((cacheTable) => cacheTable.isAway === edt.isAway)));
if (proAway.length > 0 && proAway.length <= 3) {
proAway.forEach((edt) => sendDiscordNotificationAbs(edt));
}
// Mise à jour du cache pour l'emploie du temps
writeCache({
...cache,
timetable
})
// Déconnexion de Pronote
session.logout();
};
/**
* Envoi un notification en cas d'absence sur Discord et SMS
* @param {pronote.PronoteTimetable} edt La matière de la note
*/
const sendDiscordNotificationAbs = (edt) => {
(async () => {
const taps = await client.users.fetch("321213174454026240").catch(e => { console.log(e)});
const ewan = await client.users.fetch("716379190332752014").catch(e => { console.log(e)});
const d = new Date(edt.from);
const abs = `Il y a un professeur absent: ${edt.teacher} le ${d.getUTCDate}/${d.getUTCMonth}/${d.getUTCFullYear} à ${d.getUTCHours()} : ${d.getUTCMinutes()}\n`
taps.send(abs)
// ewan.send(abs)
fetch(`https://smsapi.free-mobile.fr/sendmsg?user=pass=&msg=${encodeURIComponent(abs)}`)
})
};
from pronote-bot-discord.
Bon en tous cas sa écrit dans le cache donc bon
from pronote-bot-discord.
Salut, je regarde ça dès que possible, je pense que je l'ajouterai définitivement au bot dans les prochains jours
from pronote-bot-discord.
ça vient peut-être des arguments passés à session.timetable()
from pronote-bot-discord.
C'est bien comme sa qu'il faut récupérer l'edt ?
from pronote-bot-discord.
Oui. Les cours annulés sont dispo en v1.2.0, n'hésite pas à me mp sur discord si tu as des questions
from pronote-bot-discord.
Related Issues (14)
- Académie ? HOT 1
- Erreur, ne veut pas fonctionner
- npm! ERR
- Instruction ? HOT 3
- Je ffait quoi lorque que j'ai installé
- Instructions?
- Professeur Absent - Ne marche pas ❌ HOT 2
- SMS de notification HOT 3
- L'API me récupère toutes les notes de l'année alors que je veux uniquement celle du trimestre HOT 1
- Récup une note
- Récuperer l'emploi du temps automatiquement ?
- IMPORTANT : Library now Unusable
- installer le bot HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pronote-bot-discord.