Skip to content

Latest commit

 

History

History
212 lines (171 loc) · 9.29 KB

README.md

File metadata and controls

212 lines (171 loc) · 9.29 KB

PronoteBot

project-image

PronoteBot is a discord bot who inform about certain event of Pronote using the pronote-api by Litarvan

PronoteBot GitHub package.json version GitHub last commit Maintenance discord.js used version GitHub Repo stars

Project Screenshots:

Homeworks embed notifcations Timetable changes notifications Average update notifications

🧐 Features

Here're some of the project's best features:

  • Average update embed
  • Homework embed
  • QCM reminder (SOON)
  • Timetable updated live
  • Timetable update (missings teachers changed room...)
  • Holidays reminder

❔Requirement:

  • Node.js v16.6.0 or or higher
  • NPM
  • A Discord Bot Token (get one here)
  • Direct Pronote Passwords or with a CAS

🛠️ Installation Steps:

  1. Clone or download the repository
git clone https://github.com/quentin72000/PronoteBot.git
  1. Start a comand line or move in the folder of the project.
cd PronoteBot
  1. Install NPM dependencies
npm i
  1. Rename .env.exemple to .env and change the settings with yours.
# Pronote Login
PRONOTE_URL="YOUR FULL PRONOTE URL (without eleve.html or parent.html)" 
PRONOTE_USERNAME="YOUR ENT USERNAME"
PRONOTE_PASSWORD="YOUR ENT PASSWORD"
CAS="YOUR CAS (see list) or none if you don't use a CAS"

# Discord Token 
BOT_TOKEN=YOUR DISCORD BOT TOKEN
  1. Rename config.js.exemple to config.js and change the settings with yours.
module.exports = {
    timezone: "Europe/Paris", // Your timezone, used for the cronjobs. (https://en.wikipedia.org/wiki/List_of_tz_database_time_zones)
    notificationUserId: "user id", // Discord user id that will be notified for certain event (in general, it's the pronote account owner)
    slashCommandGuildId: "slash command guild id", // The Discord guild id where the slash commands will be added.
    channels: {
        homework: "channel id for homework", // Discord channel id for the homeworks
        moyenne: "channel id for moyenne", // Discord channel id for the averages updates
        timetableChange: "channel id for timetable change", // Discord channel id for the timetable changes (missing teacher...)
        timetable: "channel id for the timetable embed", // Discord Channel id for the live timetable embed
        announcement: "channel id for announcements" // Discord Channel id for the announcements (like the end of school year)
    },
    colors: { // Bypass default color of a subject if you don't like it or if the color is confusing. The name must be the same as what you see in your timetable to work !
        "subject name": "#customColor",
        // "SCIENCES VIE & TERRE": "#38c219", // example
    },

    tasksConfig: [
        {
            name: "informEvent",
            enabled: true,
            options: {
                endOfSchoolYear: true, // Enable the end of school year reminder

                holidays: true, // Enable the holidays reminder
                holidaysReminderBeforeStart: 1, // Number of days before the start of the holidays to send the reminder
                pingOnHolidays: true, // Ping the user on the holidays reminder
            }
        },
        {
            name: "updateTimetable",
            enabled: true,
            options: {
                pingOnTimetableChange: true, // Ping the user on a timetable change
            }
        },
        {
            name: "checkHomeWork",
            enabled: true,
            options: {
                pingOnNewHomeWork: false, // Ping the user on a new homework
            }
        },
        {
            name: "updateMoyenne",
            enabled: true,
            options: {
                pingOnMoyenneUpdate: true, // Ping the user on a new average
            }
        }
    ]
};
  1. Run the program
node .

How to get the credentials for Pronote if you don't have them

  • If you have your email setup in your account (visible in Mes données --> Mon profile) you can remove?identifiant= and what is after of the pronote url and "add ?login=true at the end. This way you will have access to the login page. You can now ask for a username and password by clicking on Récupérer son identifiant et son mot de passe.

  • If your email is not set on your account and you don't have the password, you will need to use a Regional CAS.

Tip

If you can connect directly from Pronote, the bot will work with every ENT.

CAS list
- Académie d'Orleans-Tours (CAS : ac-orleans-tours, URL : "ent.netocentre.fr")
- Académie de Besançon (CAS : ac-besancon, URL : "cas.eclat-bfc.fr")
- Académie de Bordeaux (CAS : ac-bordeaux, URL : "mon.lyceeconnecte.fr")
- Académie de Bordeaux 2 (CAS : ac-bordeaux2, URL : "ent2d.ac-bordeaux.fr")
- Académie de Caen (CAS : ac-caen, URL : "fip.itslearning.com")
- Académie de Clermont-Ferrand (CAS : ac-clermont, URL : "cas.ent.auvergnerhonealpes.fr")
- Académie de Dijon (CAS : ac-dijon, URL : "cas.eclat-bfc.fr")
- Académie de Grenoble (CAS : ac-grenoble, URL : "cas.ent.auvergnerhonealpes.fr")
- Académie de la Loire (CAS : cybercolleges42, URL : "cas.cybercolleges42.fr")
- Académie de Lille (CAS : ac-lille, URL : "cas.savoirsnumeriques62.fr")
- Académie de Lille (CAS : ac-lille2, URL : "teleservices.ac-lille.fr")
- Académie de Limoges (CAS : ac-limoges, URL : "mon.lyceeconnecte.fr")
- Académie de Lyon (CAS : ac-lyon, URL : "cas.ent.auvergnerhonealpes.fr)
- Académie de Marseille (CAS : atrium-sud, URL : "atrium-sud.fr")
- Académie de Montpellier (CAS : ac-montpellier, URL : "cas.mon-ent-occitanie.fr")
- Académie de Nancy-Metz (CAS : ac-nancy-metz, URL : "cas.monbureaunumerique.fr")
- Académie de Nantes (CAS : ac-nantes, URL : "cas3.e-lyco.fr")
- Académie de Poitiers (CAS : ac-poitiers, URL : "mon.lyceeconnecte.fr")
- Académie de Reims (CAS : ac-reims, URL : "cas.monbureaunumerique.fr")
- Académie de Rouen (Arsene76) (CAS : arsene76, URL : "cas.arsene76.fr")
- Académie de Rouen (CAS : ac-rouen, URL : "nero.l-educdenormandie.fr")
- Académie de Strasbourg (CAS : ac-strasbourg, URL : "cas.monbureaunumerique.fr")
- Académie de Toulouse (CAS : ac-toulouse, URL : "cas.mon-ent-occitanie.fr")
- Académie du Val-d'Oise (CAS : ac-valdoise, URL : "cas.moncollege.valdoise.fr")
- ENT "Agora 06" (Nice) (CAS : agora06, URL : "cas.agora06.fr")
- ENT "Haute-Garonne" (CAS : haute-garonne, URL : "cas.ecollege.haute-garonne.fr")
- ENT "Hauts-de-France" (CAS : hdf, URL : "enthdf.fr")
- ENT "La Classe" (Lyon) (CAS : laclasse, URL : "www.laclasse.com")
- ENT "Lycee Connecte" (Nouvelle-Aquitaine) (CAS : lyceeconnecte, URL : "mon.lyceeconnecte.fr")
- ENT "Seine-et-Marne" (CAS : seine-et-marne, URL : "ent77.seine-et-marne.fr")
- ENT "Somme" (CAS : somme, URL : "college.entsomme.fr")
- ENT "Portail Famille" (Orleans Tours) (CAS : portail-famille, URL : "seshat.ac-orleans-tours.fr:8443")
- ENT "Toutatice" (Rennes) (CAS : toutatice, URL : "www.toutatice.fr")
- ENT "Île de France" (CAS : iledefrance, URL : "ent.iledefrance.fr")
- ENT "Mon collège Essonne" (CAS : moncollege-essonne, URL : "www.moncollege-ent.essonne.fr")
- ENT "Paris Classe Numerique" (CAS : parisclassenumerique, URL : "ent.parisclassenumerique.fr")
- ENT "Lycee Jean Renoir Munich" (CAS : ljr-munich, URL : "cas.kosmoseducation.com")
- ENT "L'Eure en Normandie" (CAS : eure-normandie, URL : "cas.ent27.fr")  
- ENT "Mon Bureau Numérique" via EduConnect (CAS: monbureaunumerique-educonnect, URL: "cas.monbureaunumerique.fr")
- ENT "L’Éduc de Normandie" (CAS : educdenormandie, URL : "ent.l-educdenormandie.fr")
If your CAS or ENT is not on the list, feel free to open an Issue and I will try to help you.

Prepare for a new school year

You can run the script "clean-db" to delete all the data of the previous school year. This will delete all the data of the previous year and will create a new database for the new year.

Warning

This will delete all your previous data.
Make sure to backup your database before running this script if you want to keep your previous data.

  • To run the script, run the following command in a terminal opened in the project folder:
npm run script:cleandb

💻 Built with:

Technologies used in the project: