@@ -46,11 +46,13 @@ const pronote = require("pronote-api-maintained");
4646const { NodeHtmlMarkdown} = require ( "node-html-markdown" ) ;
4747const moment = require ( "moment/moment" ) ;
4848module . exports = async ( client , interaction ) => {
49- interaction . deferUpdate ( ) ;
49+ if ( [ "cours_date" , "content_select" , "menu_files" , "select_note" ] . includes ( interaction . customId ) ) {
50+ await interaction . deferUpdate ( ) ;
5051
51- if ( ! client . session ) {
52- const cas = ( process . env . PRONOTE_CAS && process . env . PRONOTE_CAS . length > 0 ? process . env . PRONOTE_CAS : "none" ) ;
53- client . session = await pronote . login ( process . env . PRONOTE_URL , process . env . PRONOTE_USERNAME , process . env . PRONOTE_PASSWORD , cas ) . catch ( console . error ) ;
52+ if ( ! client . session ) {
53+ const cas = ( process . env . PRONOTE_CAS && process . env . PRONOTE_CAS . length > 0 ? process . env . PRONOTE_CAS : "none" ) ;
54+ client . session = await pronote . login ( process . env . PRONOTE_URL , process . env . PRONOTE_USERNAME , process . env . PRONOTE_PASSWORD , cas ) . catch ( console . error ) ;
55+ }
5456 }
5557
5658 if ( interaction . customId === "cours_date" ) {
@@ -342,7 +344,7 @@ module.exports = async (client, interaction) => {
342344 } else if ( mark . value === mark . min ) {
343345 better = "**__Tu est le premier des derniers !__**\n" ;
344346 embed . setThumbnail ( "https://i.imgur.com/5H5ZASz.gif" ) ;
345- embed . author . url = "https://youtu.be/dQw4w9WgXcQ" ;
347+ embed . data . author . url = "https://youtu.be/dQw4w9WgXcQ" ;
346348 }
347349 let studentNote = `**Note de l'élève :** ${ mark . value } /${ mark . scale } ` ;
348350 if ( mark . scale !== 20 ) studentNote += ` *(${ + ( mark . value / mark . scale * 20 ) . toFixed ( 2 ) } /20)*` ;
0 commit comments