├── .gitignore ├── LICENSE ├── README.md ├── bot.js ├── color.json ├── emote.json ├── package-lock.json └── package.json /.gitignore: -------------------------------------------------------------------------------- 1 | node_modules 2 | data.json 3 | config.json -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2021 BastienBoymond 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |
2 |

IntraBot

3 | 4 | 5 |
6 | 7 | ## :notebook: Description :notebook: 8 | 9 | The goal of this bot is to provide a simple way to interact with the [Intranet](https://intra.epitech.eu) website of Epitech. 10 | 11 | I Create a lot of command to interact with the Intranet. 12 | We got the folowing commands: 13 | 14 | * **`!help`**: Display this help message. 15 | 16 | 17 | 18 | * **`!login`**: Login to the Intranet. 19 | 20 | 21 | 22 | * **`!logout`**: Logout of the Intranet. 23 | 24 | 25 | 26 | * **`!profil`**: Display your profile. 27 | 28 | 29 | 30 | * **`!gpa`**: Display your GPA. 31 | 32 | 33 | 34 | * **`!xp [year]`**: Display your XP. if you don't specify a year, it will display the current year. 35 | 36 | 37 | 38 | 39 | * **`!credits`**: Display your credits. 40 | 41 | 42 | 43 | * **`!flags`**: Display your flags. 44 | 45 | 46 | 47 | * **`binomes`**: Display your binomes. 48 | 49 | 50 | 51 | * **`!news`**: Display the news. 52 | 53 | 54 | 55 | * **`!deadline`**: Display the deadline of a Project. 56 | 57 | 58 | 59 | * **`!projet`**: Display the project. 60 | 61 | 62 | 63 | * **`!Docs [nb]`**: Send you file coresponding to number nb. If you don't specify a number, it will send you list of files. 64 | 65 | 66 | 67 | ## :electric_plug: Setup on your Serveur :electric_plug: 68 | 69 | To Setup the bot, you need to do click on this link and follow the instructions. 70 | 71 | -------------------------------------------------------------------------------- /bot.js: -------------------------------------------------------------------------------- 1 | //dependency 2 | const Discord = require("discord.js"); 3 | const fs = require("fs"); 4 | const axios = require("axios"); 5 | const IntraApi = require('epitech_intranet_api') 6 | const bot = new Discord.Client(); 7 | 8 | //Json parsing 9 | const config = JSON.parse(fs.readFileSync("config.json").toString()); 10 | const color = JSON.parse(fs.readFileSync("color.json").toString()); 11 | const emote = JSON.parse(fs.readFileSync("emote.json").toString()); 12 | let data; 13 | try { 14 | data = JSON.parse(fs.readFileSync(config.data, 'utf8')); 15 | } catch(e) { 16 | data = { 17 | log: [] 18 | } 19 | fs.writeFileSync(config.data, JSON.stringify(data)); 20 | } 21 | 22 | function getUserIndex(Data, user) 23 | { 24 | for (i = 0; Data.log[i]; i++) { 25 | if (Data.log[i].user === user) 26 | return (i); 27 | } 28 | return (-1); 29 | } 30 | 31 | //Starting of bot 32 | bot.on("ready", () => { 33 | console.log("Intrabot ready to do action"); 34 | bot.user.setActivity('Connected to Intranet'); 35 | }); 36 | 37 | //Bot command 38 | bot.on("message", async message => { 39 | //Start of prefix 40 | const prefix = config.prefix; 41 | if (!message.content.startsWith(prefix) || message.author.bot) return; 42 | const args = message.content.slice(prefix.length).split(/ +/); 43 | const command = args.shift().toLowerCase(); 44 | console.log(`${message.author.tag} do the command ${command}`); 45 | 46 | //Help 47 | if (command === "help") { 48 | let embed = new Discord.MessageEmbed(); 49 | embed.setColor(color.Blue); 50 | embed.setTitle(`Helping`); 51 | embed.addField(`**Login**`,`Log user to Intrabot`, true); 52 | embed.addField(`**Logout**`,`Logout user to Intrabot`, true); 53 | embed.addField(`**Profil/Profile**`, `Send your detailled profil`, true); 54 | embed.addField(`**gpa**`,`Send your GPA`, true); 55 | embed.addField(`**Xp**`, `Send your Xp with some detail`, true); 56 | embed.addField(`**Crédit**`,`Send your Credits`, true); 57 | embed.addField(`**Flags**`,`Send your Flags`, true); 58 | embed.addField(`**Binomes**`,`Send your Binomes`, true); 59 | embed.addField(`**News**`,`Send your last Notification`, true); 60 | embed.addField(`**deadline**`,`Send the Currently Date and the end of projet`, true); 61 | embed.addField(`**Projet**`,`Send you the list projet and timeline`, true); 62 | embed.addField(`**Activity**`,`Send you the list activity and timeline`, true); 63 | embed.addField(`**Docs**`,`Send you all Technical Documents`, true); 64 | return message.channel.send(embed); 65 | } 66 | 67 | //Login 68 | else if (command === "login" && message.channel.type === "dm") { 69 | if (args[0]) { 70 | if (args[0].length == 73 || args[0].length == 70 || args[0].length == 40) { 71 | const autolog = args[0].substr(args[0].length - 40); 72 | axios.get(`https://intra.epitech.eu/auth-${autolog}/user/?format=json`).then(response => { 73 | if (response.data.login) { 74 | const index = getUserIndex(data, message.author.id); 75 | if (index > -1) 76 | data.log.splice(index, 1); 77 | data.log.push({"user": message.author.id, "mail": response.data.login, "auth": autolog}); 78 | fs.writeFileSync(config.data, JSON.stringify(data)); 79 | console.log(message.author.tag + " is now known as " + response.data.login); 80 | let embed = new Discord.MessageEmbed(); 81 | embed.setColor(color.Green); 82 | embed.setTitle(`Connected`); 83 | embed.setDescription(`You can use the bot now !`); 84 | return message.channel.send(embed); 85 | } 86 | }); 87 | } 88 | } else { 89 | let embed = new Discord.MessageEmbed(); 90 | embed.setColor(color.Red); 91 | embed.setTitle(`Error`); 92 | embed.setDescription("**We need your autologin to connect you**\nGo on this page to take it : { https://intra.epitech.eu/admin/autolog }\n"); 93 | return message.channel.send(embed); 94 | } 95 | } else if (command === "login") { 96 | let embed = new Discord.MessageEmbed(); 97 | embed.setColor(color.Red); 98 | embed.setTitle(`Error`); 99 | embed.setDescription(`To use this command go in Dm`); 100 | return message.channel.send(embed); 101 | } 102 | 103 | //Logout 104 | else if (command === "logout" && message.channel.type === "dm") { 105 | const index = getUserIndex(data, message.author.id); 106 | if (index > -1) { 107 | data.log.splice(index, 1); 108 | fs.writeFileSync(config.data, JSON.stringify(data)); 109 | console.log(message.author.tag + " has been disconnected."); 110 | let embed = new Discord.MessageEmbed(); 111 | embed.setColor(color.Green); 112 | embed.setTitle(`Disconnected`); 113 | embed.setDescription(`You are Disconnected for the bot`); 114 | return message.channel.send(embed); 115 | } else { 116 | let embed = new Discord.MessageEmbed(); 117 | embed.setColor(color.Red); 118 | embed.setTitle(`Error`); 119 | embed.setDescription(`You're not logged in so you cannot do this command, do !login`); 120 | return message.channel.send(embed); 121 | } 122 | 123 | } else if (command === "logout") { 124 | let embed = new Discord.MessageEmbed(); 125 | embed.setColor(color.Red); 126 | embed.setTitle(`Error`); 127 | embed.setDescription(`To use this command go in Dm`); 128 | return message.channel.send(embed); 129 | } 130 | 131 | //Profil 132 | else if (command === "profil" || command === "profile") { 133 | const index = getUserIndex(data, message.author.id); 134 | if (index > -1) { 135 | axios.get(`https://intra.epitech.eu/auth-${data.log[index].auth}/user/?format=json`).then(async response => { 136 | const intra = new IntraApi(`https://intra.epitech.eu/auth-${data.log[index].auth}`); 137 | let url = `https://intra.epitech.eu/`; 138 | let year = response.data.scolaryear; 139 | let name = response.data.title; 140 | let gpa = response.data.gpa[0].gpa; 141 | let login = response.data.login; 142 | let credits = response.data.credits; 143 | let promo = response.data.promo; 144 | let location = response.data.location; 145 | const attachment = new Discord.MessageAttachment(`https://intra.epitech.eu/auth-${data.log[index].auth}/file/userprofil/profilview/${data.log[index].mail}.jpg`, "profile-pic.jpg") 146 | let xp = await intra.user.getXp(year) 147 | let embed2 = new Discord.MessageEmbed(); 148 | embed2.setColor(color.Yellow); 149 | embed2.setTitle(`Wait`); 150 | embed2.attachFiles(attachment); 151 | embed2.setThumbnail('attachment://profile-pic.jpg'); 152 | embed2.setDescription(`Calculating...`); 153 | let msg = await message.channel.send(embed2) 154 | let embed = new Discord.MessageEmbed(); 155 | embed.setColor(color.Green); 156 | embed.setTitle(`${name}`); 157 | embed.attachFiles(attachment); 158 | embed.setThumbnail('attachment://profile-pic.jpg'); 159 | embed.setURL(`${url}`); 160 | embed.setDescription(`**Login**: ${login}\n**City**: ${location}\n**Promotion**: ${promo}\n**GPA**: ${gpa}\n**Crédits**: ${credits}\n**XP**: ${xp} You can do !xp for details`); 161 | return msg.edit(embed); 162 | }); 163 | } else { 164 | let embed = new Discord.MessageEmbed(); 165 | embed.setColor(color.Red); 166 | embed.setTitle(`Error`); 167 | embed.setDescription(`You're not logged in so you cannot do this command, do !login`); 168 | return message.channel.send(embed); 169 | } 170 | } 171 | 172 | //Gpa 173 | else if (command === "gpa") { 174 | const index = getUserIndex(data, message.author.id); 175 | if (index > -1) { 176 | axios.get(`https://intra.epitech.eu/auth-${data.log[index].auth}/user/?format=json`).then(response => { 177 | const gpa = response.data.gpa[0].gpa; 178 | let embed = new Discord.MessageEmbed(); 179 | embed.setColor(color.Green); 180 | embed.setTitle(`GPA`); 181 | embed.setDescription(`Your GPA was ${gpa}`); 182 | return message.channel.send(embed); 183 | }); 184 | } else { 185 | let embed = new Discord.MessageEmbed(); 186 | embed.setColor(color.Red); 187 | embed.setTitle(`Error`); 188 | embed.setDescription(`You're not logged in so you cannot do this command, do !login`); 189 | return message.channel.send(embed); 190 | } 191 | } 192 | 193 | //xp 194 | else if (command === "xp") { 195 | const index = getUserIndex(data, message.author.id); 196 | if (index > -1) { 197 | console.log(args[0]); 198 | if (parseInt(args[0]) > 2000) { 199 | let embed2 = new Discord.MessageEmbed(); 200 | embed2.setColor(color.Yellow); 201 | embed2.setTitle(`Wait`); 202 | embed2.setDescription(`Calculating...`); 203 | let msg = await message.channel.send(embed2) 204 | const intra = new IntraApi(`https://intra.epitech.eu/auth-${data.log[index].auth}`); 205 | let xp = await intra.user.getXp(args[0], true); 206 | let embed = new Discord.MessageEmbed(); 207 | embed.setColor(color.Green); 208 | embed.setTitle(`You got ${xp.xp} Xp`); 209 | embed.setDescription(`You do ${xp.details.hubProjects} xp in Hub Project\nYou do ${xp.details.limitExperience * 3} xp in Experience\nYou do ${xp.details.limitOrganizationHubTalk * 4} xp in Organisation Hubtalk\nYou do ${xp.details.limitOrganizationWorkshop * 7} xp in Organisation Workshop\nYou do ${xp.details.hackathonsOrganisation * 15} xp in Organisation Hackatlon\nYou do ${xp.details.limitParticipationHubTalk} xp in Participation Hubtalk\nYou do ${xp.details.limitParticipationWorshop * 2} xp in Participation Workshop\nYou do ${xp.details.hackathonsParicipation * 6} xp in Participation Hackatlon`); 210 | return msg.edit(embed); 211 | } else { 212 | let embed2 = new Discord.MessageEmbed(); 213 | embed2.setColor(color.Yellow); 214 | embed2.setTitle(`Wait`); 215 | embed2.setDescription(`Calculating...`); 216 | let msg = await message.channel.send(embed2) 217 | const intra = new IntraApi(`https://intra.epitech.eu/auth-${data.log[index].auth}`); 218 | let year = await intra.user.getScolarYear(); 219 | let xp = await intra.user.getXp(year, true); 220 | let embed = new Discord.MessageEmbed(); 221 | embed.setColor(color.Green); 222 | embed.setTitle(`You got ${xp.xp} Xp`); 223 | embed.setDescription(`You do ${xp.details.hubProjects} xp in Hub Project\nYou do ${xp.details.limitExperience * 3} xp in Experience\nYou do ${xp.details.limitOrganizationHubTalk * 4} xp in Organisation Hubtalk\nYou do ${xp.details.limitOrganizationWorkshop * 7} xp in Organisation Workshop\nYou do ${xp.details.hackathonsOrganisation * 15} xp in Organisation Hackatlon\nYou do ${xp.details.limitParticipationHubTalk} xp in Participation Hubtalk\nYou do ${xp.details.limitParticipationWorshop * 2} xp in Participation Workshop\nYou do ${xp.details.hackathonsParicipation * 6} xp in Participation Hackatlon`); 224 | return msg.edit(embed); 225 | } 226 | } else { 227 | let embed = new Discord.MessageEmbed(); 228 | embed.setColor(color.Red); 229 | embed.setTitle(`Error`); 230 | embed.setDescription(`You're not logged in so you cannot do this command, do !login`); 231 | return message.channel.send(embed); 232 | } 233 | } 234 | 235 | //Credit 236 | else if (command === "credits" || command === "credit") { 237 | const index = getUserIndex(data, message.author.id); 238 | if (index > -1) { 239 | axios.get(`https://intra.epitech.eu/auth-${data.log[index].auth}/user/?format=json`).then(response => { 240 | const credits = response.data.credits; 241 | let embed = new Discord.MessageEmbed(); 242 | embed.setColor(color.Green); 243 | embed.setTitle(`Credits ${emote.credits}`); 244 | embed.setDescription(`You got ${credits} credits`); 245 | return message.channel.send(embed); 246 | }); 247 | } else { 248 | let embed = new Discord.MessageEmbed(); 249 | embed.setColor(color.Red); 250 | embed.setTitle(`Error`); 251 | embed.setDescription(`Your not log so you cannot do this command do !login`); 252 | return message.channel.send(embed); 253 | } 254 | } 255 | 256 | //flags 257 | else if (command === "flags") { 258 | const index = getUserIndex(data, message.author.id); 259 | if (index > -1) { 260 | axios.get(`https://intra.epitech.eu/auth-${data.log[index].auth}/user/${data.log[index].mail}/flags?format=json`).then(response => { 261 | const flags = response.data.flags; 262 | let embed = new Discord.MessageEmbed(); 263 | embed.setColor(color.Green); 264 | embed.setTitle(`Flags`); 265 | embed.addField(flags.ghost.label + emote.absent, flags.ghost.nb, true); 266 | embed.addField(flags.difficulty.label + emote.dificulty, flags.difficulty.nb, true); 267 | embed.addField(flags.remarkable.label + emote.pouce, flags.remarkable.nb, true); 268 | embed.addField(flags.medal.label + emote.medal, flags.medal.nb, true); 269 | return message.channel.send(embed); 270 | }).catch((e) => { 271 | const flags = e.response.data.flags; 272 | let embed = new Discord.MessageEmbed(); 273 | embed.setColor(color.Green); 274 | embed.setTitle(`Flags`); 275 | embed.addField(flags.ghost.label + " " + emote.absent, flags.ghost.nb, true); 276 | embed.addField(flags.difficulty.label + " " + emote.dificulty, flags.difficulty.nb, true); 277 | embed.addField(flags.remarkable.label + " " + emote.pouce, flags.remarkable.nb, true); 278 | embed.addField(flags.medal.label + " " + emote.medal, flags.medal.nb, true); 279 | return message.channel.send(embed); 280 | }); 281 | } else { 282 | let embed = new Discord.MessageEmbed(); 283 | embed.setColor(color.Red); 284 | embed.setTitle(`Error`); 285 | embed.setDescription(`You're not logged in so you cannot do this command, do !login`); 286 | return message.channel.send(embed); 287 | } 288 | } 289 | 290 | //binomes 291 | else if (command === "binomes" || command == "binome") { 292 | const index = getUserIndex(data, message.author.id); 293 | if (index > -1) { 294 | axios.get(`https://intra.epitech.eu/auth-${data.log[index].auth}/user/${data.log[index].mail}/binome?format=json`).then(response => { 295 | let embed = new Discord.MessageEmbed(); 296 | DATA = response.data.binomes; 297 | const login = response.data.user.login.split('@epitech.eu'); 298 | let nbstudent = DATA.length; 299 | embed.setTitle(`Binomes of ${login[0]}`) 300 | embed.setColor(color.Green); 301 | for (let j = 0; j < nbstudent; j++) { 302 | const student = DATA[j] 303 | const logstudent = student.login.split('@epitech.eu'); 304 | embed.addField(`${logstudent[0]}`, `${student.weight}`, true); 305 | } 306 | return message.channel.send(embed); 307 | }); 308 | } else { 309 | let embed = new Discord.MessageEmbed(); 310 | embed.setColor(color.Red); 311 | embed.setTitle(`Error`); 312 | embed.setDescription(`You're not logged in so you cannot do this command, do !login`); 313 | return message.channel.send(embed); 314 | } 315 | } 316 | 317 | //grade 318 | else if (command === "grade" || command === "grades") { 319 | const index = getUserIndex(data, message.author.id); 320 | if (index > -1) { 321 | axios.get(`https://intra.epitech.eu/auth-${data.log[index].auth}/user/${data.log[index].mail}/notes?format=json`).then(response => { 322 | DATA = response.data.modules; 323 | let embed = new Discord.MessageEmbed(); 324 | let nbmodules = DATA.length; 325 | for (let k = 0; k < nbmodules; k++) { 326 | const modules = DATA[k].codemodule 327 | if (args[0] == modules) { 328 | embed.setTitle(`Grade on Module ${DATA[k].title}`) 329 | embed.setColor(color.Green); 330 | if (DATA[k].grade == '-') { 331 | embed.setDescription(`Grade Not Set`); 332 | } else { 333 | embed.setDescription(`Your Grade was ${DATA[k].grade}`) 334 | } 335 | return message.channel.send(embed); 336 | } 337 | } 338 | let embed2 = new Discord.MessageEmbed(); 339 | embed2.setColor(color.Red); 340 | embed2.setTitle(`Error`); 341 | embed2.setDescription(`**Put a Valid Module**\n Exemple !grade B-MUL-100`); 342 | return message.channel.send(embed2); 343 | }); 344 | } else { 345 | let embed = new Discord.MessageEmbed(); 346 | embed.setColor(color.Red); 347 | embed.setTitle(`Error`); 348 | embed.setDescription(`You're not logged in so you cannot do this command, do !login`); 349 | return message.channel.send(embed); 350 | } 351 | } 352 | 353 | //news 354 | else if (command === 'news' || command === 'notif' || command === 'notification') { 355 | const index = getUserIndex(data, message.author.id); 356 | if (args[0] === "alert" || args[0] === "coming" || args[0] === "missed" || args[0] === "message") { 357 | if (index > -1) { 358 | axios.get(`https://intra.epitech.eu/auth-${data.log[index].auth}/user/${data.log[index].mail}/notification/${args[0]}?format=json`).then(response => { 359 | DATA = response.data; 360 | let embed = new Discord.MessageEmbed(); 361 | embed.setColor(color.Green); 362 | embed.setTitle(`News on ${args[0]}`); 363 | if (args[0] === "alert") { 364 | let nbalert = DATA.length; 365 | if (nbalert == undefined) 366 | nbalert = 0; 367 | embed.setDescription(`**You got ${nbalert} alert(s)**`); 368 | if (nbalert >= 1) 369 | embed.setColor(color.Yellow); 370 | if (nbalert >= 3) 371 | embed.setColor(color.Red); 372 | for (let k = 0; k < nbalert; k++) { 373 | embed.addField(`alert ${k + 1} :`,`${DATA[k].title}`, true); 374 | } 375 | } 376 | if (args[0] === "coming") { 377 | let nbcomming = DATA.length; 378 | if (nbcomming == undefined) 379 | nbcomming = 0; 380 | embed.setDescription(`**You got ${nbcomming} comming**`); 381 | for (let k = 0; k < nbcomming; k++) { 382 | embed.addField(`coming ${k + 1} :`,`${DATA[k].title}`, true); 383 | } 384 | } 385 | if (args[0] === "missed") { 386 | let nbmissed = DATA.recents.length; 387 | if (nbmissed == undefined) 388 | nbmissed = 0; 389 | embed.setDescription(`**You got ${nbmissed} missed**`); 390 | if (nbmissed >= 1) 391 | embed.setColor(color.Yellow); 392 | if (nbmissed >= 3) 393 | embed.setColor(color.Red); 394 | for (let k = 0; k < nbmissed; k++) { 395 | embed.addField(`coming ${k + 1} :`,`${DATA[k].title}`, true); 396 | } 397 | } 398 | if (args[0] === "message") { 399 | let nbmessage = DATA.length; 400 | if (nbmessage == undefined) 401 | nbmessage = 0; 402 | embed.setDescription(`**You got ${nbmessage} message**`); 403 | for (let k = 0; k < nbmessage; k++) { 404 | embed.addField(`message ${k + 1} :`,`**Category:** ${DATA[k].class}\n**Content:** ${DATA[k].content}`, true); 405 | } 406 | } 407 | message.channel.send(embed); 408 | }); 409 | } else { 410 | let embed = new Discord.MessageEmbed(); 411 | embed.setColor(color.Red); 412 | embed.setTitle(`Error`); 413 | embed.setDescription(`You're not logged in so you cannot do this command, do !login`); 414 | return message.channel.send(embed); 415 | } 416 | } else { 417 | let embed = new Discord.MessageEmbed(); 418 | embed.setColor(color.Red); 419 | embed.setTitle(`Error`); 420 | embed.setDescription(`**The only arg you can enter is**\n !news [alert, coming, missed, message]`); 421 | return message.channel.send(embed); 422 | } 423 | } 424 | 425 | //deadline 426 | else if (command === 'deadline') { 427 | const index = getUserIndex(data, message.author.id); 428 | if (args[0]) { 429 | if (index > -1) { 430 | const response = await axios.get(`https://intra.epitech.eu/auth-${data.log[index].auth}/?format=json`); 431 | let project = response.data.board.projets; 432 | let dataproject = project.length; 433 | for (let i = 0; i < dataproject; i++) { 434 | if (project[i].title.toLowerCase() == args[0].toLowerCase()) { 435 | let d = new Date(); 436 | let Currently = `${d.getDate()}/${d.getMonth() + 1}/${d.getFullYear()}, ${d.getHours()}:${d.getMinutes()}`; 437 | let start = project[i].timeline_start; 438 | let end = project[i].timeline_end; 439 | let embed = new Discord.MessageEmbed(); 440 | embed.setColor(color.Green); 441 | embed.setTitle(`The deadline of ${project[i].title}`); 442 | embed.setDescription(`**Start**: ${start}\n**Currently**: ${Currently}\n**End**: ${end}`); 443 | return message.channel.send(embed); 444 | } 445 | } 446 | let embed = new Discord.MessageEmbed(); 447 | embed.setColor(color.Red); 448 | embed.setTitle(`Error`); 449 | embed.setDescription(`Put a valid Project`); 450 | return message.channel.send(embed); 451 | } else { 452 | let embed = new Discord.MessageEmbed(); 453 | embed.setColor(color.Red); 454 | embed.setTitle(`Error`); 455 | embed.setDescription(`You're not logged in so you cannot do this command, do !login`); 456 | return message.channel.send(embed); 457 | } 458 | } else { 459 | let embed = new Discord.MessageEmbed(); 460 | embed.setColor(color.Red); 461 | embed.setTitle(`Error`); 462 | embed.setDescription(`**You need to put a project**\n Exemple !deadline [project]`); 463 | return message.channel.send(embed); 464 | } 465 | } 466 | 467 | //projet 468 | else if (command === 'projet') { 469 | const index = getUserIndex(data, message.author.id); 470 | if (index > -1) { 471 | const response = await axios.get(`https://intra.epitech.eu/auth-${data.log[index].auth}/?format=json`); 472 | let project = response.data.board.projets; 473 | let dataproject = project.length; 474 | let embed = new Discord.MessageEmbed(); 475 | embed.setColor(color.Green); 476 | embed.setTitle(`**Project**`); 477 | for (let k = 0; k < dataproject; k++) { 478 | let actual = project[k].title.split("-"); 479 | if (actual[0] != "Back To The Future ") 480 | embed.addField(`${project[k].title}`,`${project[k].timeline_barre}%`,true); 481 | } 482 | return message.channel.send(embed); 483 | } else { 484 | let embed = new Discord.MessageEmbed(); 485 | embed.setColor(color.Red); 486 | embed.setTitle(`Error`); 487 | embed.setDescription(`You're not logged in so you cannot do this command, do !login`); 488 | return message.channel.send(embed); 489 | } 490 | } 491 | 492 | //activite 493 | else if (command === 'activite') { 494 | const index = getUserIndex(data, message.author.id); 495 | if (index > -1) { 496 | const response = await axios.get(`https://intra.epitech.eu/auth-${data.log[index].auth}/?format=json`); 497 | let project = response.data.board.activites; 498 | let dataproject = project.length; 499 | let embed = new Discord.MessageEmbed(); 500 | embed.setColor(color.Green); 501 | embed.setTitle(`**Project**`); 502 | for (let k = 0; k < dataproject; k++) { 503 | embed.addField(`${project[k].title}`,`${project[k].timeline_barre}%`,true); 504 | } 505 | return message.channel.send(embed); 506 | } else { 507 | let embed = new Discord.MessageEmbed(); 508 | embed.setColor(color.Red); 509 | embed.setTitle(`Error`); 510 | embed.setDescription(`You're not logged in so you cannot do this command, do !login`); 511 | return message.channel.send(embed); 512 | } 513 | } 514 | 515 | //docs 516 | else if (command === 'docs' || command == 'man' || command === 'doc') { 517 | if (args[0]) { 518 | const index = getUserIndex(data, message.author.id); 519 | if (index > -1) { 520 | const response = await axios.get(`https://intra.epitech.eu/auth-${data.log[index].auth}/file/Public/technical-documentations/?format=json`); 521 | let DATA = response.data; 522 | let datalenght = DATA.length; 523 | let embed2 = new Discord.MessageEmbed(); 524 | embed2.setColor(color.Blue); 525 | embed2.setTitle(`**Click here**`); 526 | message.author.createDM().then(channel => { 527 | for (let i = 0; i < datalenght; i++) { 528 | if (`${DATA[i].title}` == args[0]) { 529 | embed2.setDescription(`https://intra.epitech.eu${DATA[i].fullpath}`); 530 | } 531 | } 532 | if (embed2.description == null || embed2.description == undefined) 533 | embed2.setDescription(`Unvalid path`); 534 | embed2.setColor(color.Red); 535 | channel.send(embed2) 536 | }); 537 | let embed = new Discord.MessageEmbed(); 538 | embed.setColor(color.Green ); 539 | embed.setTitle(`Done`); 540 | embed.setDescription(`**Files Sent in DM**`); 541 | return message.channel.send(embed); 542 | }else { 543 | let embed = new Discord.MessageEmbed(); 544 | embed.setColor(color.Red); 545 | embed.setTitle(`Error`); 546 | embed.setDescription(`You're not logged in so you cannot do this command, do !login`); 547 | return message.channel.send(embed); 548 | } 549 | } else { 550 | const index = getUserIndex(data, message.author.id); 551 | if (index > -1) { 552 | let embed = new Discord.MessageEmbed(); 553 | embed.setColor(color.Blue); 554 | embed.setTitle(`Put a files name`); 555 | const response = await axios.get(`https://intra.epitech.eu/auth-${data.log[index].auth}/file/Public/technical-documentations/?format=json`); 556 | let DATA = response.data; 557 | let datalenght = DATA.length; 558 | for (let i = 0; i < datalenght; i++) { 559 | embed.addField(`${DATA[i].title}`,`${i}`, true); 560 | } 561 | return message.channel.send(embed); 562 | }else { 563 | let embed = new Discord.MessageEmbed(); 564 | embed.setColor(color.Red); 565 | embed.setTitle(`Error`); 566 | embed.setDescription(`You're not logged in so you cannot do this command, do !login`); 567 | return message.channel.send(embed); 568 | } 569 | } 570 | } 571 | //if wrong command 572 | else { 573 | let embed = new Discord.MessageEmbed(); 574 | embed.setColor(color.Blue); 575 | embed.setTitle(`Command does not exist`); 576 | embed.setDescription(`Use the command !help to access at all Command`); 577 | message.channel.send(embed) 578 | } 579 | }); 580 | 581 | bot.on("guildMemberAdd", member => { 582 | roles = member.guild.roles.cache.find(roles => roles.name === 'User'); 583 | member.roles.add(roles); 584 | member.createDM().then(channel => { 585 | let embed = new Discord.MessageEmbed(); 586 | embed.setColor(color.Blue); 587 | embed.setTitle(`Welcome`); 588 | embed.setDescription(`To use the bot do !login [Autologin]`); 589 | return channel.send(embed); 590 | }); 591 | }); 592 | 593 | bot.login(config.token); 594 | -------------------------------------------------------------------------------- /color.json: -------------------------------------------------------------------------------- 1 | { 2 | "Green": "#00FF00", 3 | "Red": "#FF0000", 4 | "Blue": "#0000FF", 5 | "Yellow": "#FFFF00" 6 | } -------------------------------------------------------------------------------- /emote.json: -------------------------------------------------------------------------------- 1 | { 2 | "credits":"<:1_credit:821872199026868235>", 3 | "dificulty":"<:bouet:821887039179063306>", 4 | "absent":"<:absent:821887054182613002>", 5 | "pouce":"<:Pouce:821887025148854332>", 6 | "medal":"<:medaille:821886997407858693>" 7 | } -------------------------------------------------------------------------------- /package-lock.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "intrabot", 3 | "version": "1.0.0", 4 | "lockfileVersion": 1, 5 | "requires": true, 6 | "dependencies": { 7 | "@discordjs/collection": { 8 | "version": "0.1.6", 9 | "resolved": "https://registry.npmjs.org/@discordjs/collection/-/collection-0.1.6.tgz", 10 | "integrity": "sha512-utRNxnd9kSS2qhyivo9lMlt5qgAUasH2gb7BEOn6p0efFh24gjGomHzWKMAPn2hEReOPQZCJaRKoURwRotKucQ==" 11 | }, 12 | "@discordjs/form-data": { 13 | "version": "3.0.1", 14 | "resolved": "https://registry.npmjs.org/@discordjs/form-data/-/form-data-3.0.1.tgz", 15 | "integrity": "sha512-ZfFsbgEXW71Rw/6EtBdrP5VxBJy4dthyC0tpQKGKmYFImlmmrykO14Za+BiIVduwjte0jXEBlhSKf0MWbFp9Eg==", 16 | "requires": { 17 | "asynckit": "^0.4.0", 18 | "combined-stream": "^1.0.8", 19 | "mime-types": "^2.1.12" 20 | } 21 | }, 22 | "@selderee/plugin-htmlparser2": { 23 | "version": "0.6.0", 24 | "resolved": "https://registry.npmjs.org/@selderee/plugin-htmlparser2/-/plugin-htmlparser2-0.6.0.tgz", 25 | "integrity": "sha512-J3jpy002TyBjd4N/p6s+s90eX42H2eRhK3SbsZuvTDv977/E8p2U3zikdiehyJja66do7FlxLomZLPlvl2/xaA==", 26 | "requires": { 27 | "domhandler": "^4.2.0", 28 | "selderee": "^0.6.0" 29 | } 30 | }, 31 | "abort-controller": { 32 | "version": "3.0.0", 33 | "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", 34 | "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", 35 | "requires": { 36 | "event-target-shim": "^5.0.0" 37 | } 38 | }, 39 | "asynckit": { 40 | "version": "0.4.0", 41 | "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", 42 | "integrity": "sha1-x57Zf380y48robyXkLzDZkdLS3k=" 43 | }, 44 | "axios": { 45 | "version": "0.21.2", 46 | "resolved": "https://registry.npmjs.org/axios/-/axios-0.21.2.tgz", 47 | "integrity": "sha512-87otirqUw3e8CzHTMO+/9kh/FSgXt/eVDvipijwDtEuwbkySWZ9SBm6VEubmJ/kLKEoLQV/POhxXFb66bfekfg==", 48 | "requires": { 49 | "follow-redirects": "^1.14.0" 50 | } 51 | }, 52 | "change-url": { 53 | "version": "1.1.2", 54 | "resolved": "https://registry.npmjs.org/change-url/-/change-url-1.1.2.tgz", 55 | "integrity": "sha512-NQ9tOZ5wGRh6T4z8/z7lbJUkPLjPwH+O6/l/941Qh3eZ2eEFHEpeRcGIMvtd8PgxpDDEnttU0+ZY91oDdhgGdA==", 56 | "requires": { 57 | "lodash": "^4.17.15", 58 | "lodash-es": "^4.17.15" 59 | } 60 | }, 61 | "combined-stream": { 62 | "version": "1.0.8", 63 | "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", 64 | "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", 65 | "requires": { 66 | "delayed-stream": "~1.0.0" 67 | } 68 | }, 69 | "commander": { 70 | "version": "2.20.3", 71 | "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", 72 | "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==" 73 | }, 74 | "deepmerge": { 75 | "version": "4.2.2", 76 | "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", 77 | "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==" 78 | }, 79 | "delayed-stream": { 80 | "version": "1.0.0", 81 | "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", 82 | "integrity": "sha1-3zrhmayt+31ECqrgsp4icrJOxhk=" 83 | }, 84 | "discontinuous-range": { 85 | "version": "1.0.0", 86 | "resolved": "https://registry.npmjs.org/discontinuous-range/-/discontinuous-range-1.0.0.tgz", 87 | "integrity": "sha1-44Mx8IRLukm5qctxx3FYWqsbxlo=" 88 | }, 89 | "discord.js": { 90 | "version": "12.5.1", 91 | "resolved": "https://registry.npmjs.org/discord.js/-/discord.js-12.5.1.tgz", 92 | "integrity": "sha512-VwZkVaUAIOB9mKdca0I5MefPMTQJTNg0qdgi1huF3iwsFwJ0L5s/Y69AQe+iPmjuV6j9rtKoG0Ta0n9vgEIL6w==", 93 | "requires": { 94 | "@discordjs/collection": "^0.1.6", 95 | "@discordjs/form-data": "^3.0.1", 96 | "abort-controller": "^3.0.0", 97 | "node-fetch": "^2.6.1", 98 | "prism-media": "^1.2.2", 99 | "setimmediate": "^1.0.5", 100 | "tweetnacl": "^1.0.3", 101 | "ws": "^7.3.1" 102 | } 103 | }, 104 | "dom-serializer": { 105 | "version": "1.3.2", 106 | "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-1.3.2.tgz", 107 | "integrity": "sha512-5c54Bk5Dw4qAxNOI1pFEizPSjVsx5+bpJKmL2kPn8JhBUq2q09tTCa3mjijun2NfK78NMouDYNMBkOrPZiS+ig==", 108 | "requires": { 109 | "domelementtype": "^2.0.1", 110 | "domhandler": "^4.2.0", 111 | "entities": "^2.0.0" 112 | } 113 | }, 114 | "domelementtype": { 115 | "version": "2.2.0", 116 | "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.2.0.tgz", 117 | "integrity": "sha512-DtBMo82pv1dFtUmHyr48beiuq792Sxohr+8Hm9zoxklYPfa6n0Z3Byjj2IV7bmr2IyqClnqEQhfgHJJ5QF0R5A==" 118 | }, 119 | "domhandler": { 120 | "version": "4.3.0", 121 | "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-4.3.0.tgz", 122 | "integrity": "sha512-fC0aXNQXqKSFTr2wDNZDhsEYjCiYsDWl3D01kwt25hm1YIPyDGHvvi3rw+PLqHAl/m71MaiF7d5zvBr0p5UB2g==", 123 | "requires": { 124 | "domelementtype": "^2.2.0" 125 | } 126 | }, 127 | "domutils": { 128 | "version": "2.8.0", 129 | "resolved": "https://registry.npmjs.org/domutils/-/domutils-2.8.0.tgz", 130 | "integrity": "sha512-w96Cjofp72M5IIhpjgobBimYEfoPjx1Vx0BSX9P30WBdZW2WIKU0T1Bd0kz2eNZ9ikjKgHbEyKx8BB6H1L3h3A==", 131 | "requires": { 132 | "dom-serializer": "^1.0.1", 133 | "domelementtype": "^2.2.0", 134 | "domhandler": "^4.2.0" 135 | } 136 | }, 137 | "entities": { 138 | "version": "2.2.0", 139 | "resolved": "https://registry.npmjs.org/entities/-/entities-2.2.0.tgz", 140 | "integrity": "sha512-p92if5Nz619I0w+akJrLZH0MX0Pb5DX39XOwQTtXSdQQOaYH03S1uIQp4mhOZtAXrxq4ViO67YTiLBo2638o9A==" 141 | }, 142 | "epitech_intranet_api": { 143 | "version": "1.2.7", 144 | "resolved": "https://registry.npmjs.org/epitech_intranet_api/-/epitech_intranet_api-1.2.7.tgz", 145 | "integrity": "sha512-kreevCT1DGYTNG7rBnS4mtNn960KpWeQzdkM4VeaOrsM7PfI0hWcQFHTse1A06Bzpmeuy38RnFATC3YB85WYYg==", 146 | "requires": { 147 | "axios": "^0.21.1", 148 | "html-to-text": "^8.0.0" 149 | } 150 | }, 151 | "event-target-shim": { 152 | "version": "5.0.1", 153 | "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", 154 | "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" 155 | }, 156 | "follow-redirects": { 157 | "version": "1.14.9", 158 | "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.14.9.tgz", 159 | "integrity": "sha512-MQDfihBQYMcyy5dhRDJUHcw7lb2Pv/TuE6xP1vyraLukNDHKbDxDNaOE3NbCAdKQApno+GPRyo1YAp89yCjK4w==" 160 | }, 161 | "fs": { 162 | "version": "0.0.1-security", 163 | "resolved": "https://registry.npmjs.org/fs/-/fs-0.0.1-security.tgz", 164 | "integrity": "sha1-invTcYa23d84E/I4WLV+yq9eQdQ=" 165 | }, 166 | "he": { 167 | "version": "1.2.0", 168 | "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", 169 | "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==" 170 | }, 171 | "html-to-text": { 172 | "version": "8.1.0", 173 | "resolved": "https://registry.npmjs.org/html-to-text/-/html-to-text-8.1.0.tgz", 174 | "integrity": "sha512-Z9iYAqYK2c18GswSbnxJSeMs7lyJgwR2oIkDOyOHGBbYsPsG4HvT379jj3Lcbfko8A5ceyyMHAfkmp/BiXA9/Q==", 175 | "requires": { 176 | "@selderee/plugin-htmlparser2": "^0.6.0", 177 | "deepmerge": "^4.2.2", 178 | "he": "^1.2.0", 179 | "htmlparser2": "^6.1.0", 180 | "minimist": "^1.2.5", 181 | "selderee": "^0.6.0" 182 | } 183 | }, 184 | "htmlparser2": { 185 | "version": "6.1.0", 186 | "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-6.1.0.tgz", 187 | "integrity": "sha512-gyyPk6rgonLFEDGoeRgQNaEUvdJ4ktTmmUh/h2t7s+M8oPpIPxgNACWa+6ESR57kXstwqPiCut0V8NRpcwgU7A==", 188 | "requires": { 189 | "domelementtype": "^2.0.1", 190 | "domhandler": "^4.0.0", 191 | "domutils": "^2.5.2", 192 | "entities": "^2.0.0" 193 | } 194 | }, 195 | "lodash": { 196 | "version": "4.17.21", 197 | "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", 198 | "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" 199 | }, 200 | "lodash-es": { 201 | "version": "4.17.21", 202 | "resolved": "https://registry.npmjs.org/lodash-es/-/lodash-es-4.17.21.tgz", 203 | "integrity": "sha512-mKnC+QJ9pWVzv+C4/U3rRsHapFfHvQFoFB92e52xeyGMcX6/OlIl78je1u8vePzYZSkkogMPJ2yjxxsb89cxyw==" 204 | }, 205 | "mime-db": { 206 | "version": "1.46.0", 207 | "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.46.0.tgz", 208 | "integrity": "sha512-svXaP8UQRZ5K7or+ZmfNhg2xX3yKDMUzqadsSqi4NCH/KomcH75MAMYAGVlvXn4+b/xOPhS3I2uHKRUzvjY7BQ==" 209 | }, 210 | "mime-types": { 211 | "version": "2.1.29", 212 | "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.29.tgz", 213 | "integrity": "sha512-Y/jMt/S5sR9OaqteJtslsFZKWOIIqMACsJSiHghlCAyhf7jfVYjKBmLiX8OgpWeW+fjJ2b+Az69aPFPkUOY6xQ==", 214 | "requires": { 215 | "mime-db": "1.46.0" 216 | } 217 | }, 218 | "minimist": { 219 | "version": "1.2.5", 220 | "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", 221 | "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" 222 | }, 223 | "modify-image-url-md": { 224 | "version": "0.0.1", 225 | "resolved": "https://registry.npmjs.org/modify-image-url-md/-/modify-image-url-md-0.0.1.tgz", 226 | "integrity": "sha512-3/atFl1VNpNSsGUN4WedRc3haXYirniDLQL6wI6TdkZTPzYmx7RW7idWw8y49//3wNu9S3YG8gMqutigLI0TSw==" 227 | }, 228 | "moo": { 229 | "version": "0.5.1", 230 | "resolved": "https://registry.npmjs.org/moo/-/moo-0.5.1.tgz", 231 | "integrity": "sha512-I1mnb5xn4fO80BH9BLcF0yLypy2UKl+Cb01Fu0hJRkJjlCRtxZMWkTdAtDd5ZqCOxtCkhmRwyI57vWT+1iZ67w==" 232 | }, 233 | "nearley": { 234 | "version": "2.20.1", 235 | "resolved": "https://registry.npmjs.org/nearley/-/nearley-2.20.1.tgz", 236 | "integrity": "sha512-+Mc8UaAebFzgV+KpI5n7DasuuQCHA89dmwm7JXw3TV43ukfNQ9DnBH3Mdb2g/I4Fdxc26pwimBWvjIw0UAILSQ==", 237 | "requires": { 238 | "commander": "^2.19.0", 239 | "moo": "^0.5.0", 240 | "railroad-diagrams": "^1.0.0", 241 | "randexp": "0.4.6" 242 | } 243 | }, 244 | "node": { 245 | "version": "15.10.0", 246 | "resolved": "https://registry.npmjs.org/node/-/node-15.10.0.tgz", 247 | "integrity": "sha512-JboERsul33BpTDeth8SsGWg/gTZfNEWGMT5HVqIoyepRwAARznCjwdWvLHHd/A9bvAYFp5zaq46RnVArWz44kA==", 248 | "requires": { 249 | "node-bin-setup": "^1.0.0" 250 | } 251 | }, 252 | "node-bin-setup": { 253 | "version": "1.0.6", 254 | "resolved": "https://registry.npmjs.org/node-bin-setup/-/node-bin-setup-1.0.6.tgz", 255 | "integrity": "sha512-uPIxXNis1CRbv1DwqAxkgBk5NFV3s7cMN/Gf556jSw6jBvV7ca4F9lRL/8cALcZecRibeqU+5dFYqFFmzv5a0Q==" 256 | }, 257 | "node-fetch": { 258 | "version": "2.6.7", 259 | "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.7.tgz", 260 | "integrity": "sha512-ZjMPFEfVx5j+y2yF35Kzx5sF7kDzxuDj6ziH4FFbOp87zKDZNx8yExJIb05OGF4Nlt9IHFIMBkRl41VdvcNdbQ==", 261 | "requires": { 262 | "whatwg-url": "^5.0.0" 263 | } 264 | }, 265 | "parseley": { 266 | "version": "0.7.0", 267 | "resolved": "https://registry.npmjs.org/parseley/-/parseley-0.7.0.tgz", 268 | "integrity": "sha512-xyOytsdDu077M3/46Am+2cGXEKM9U9QclBDv7fimY7e+BBlxh2JcBp2mgNsmkyA9uvgyTjVzDi7cP1v4hcFxbw==", 269 | "requires": { 270 | "moo": "^0.5.1", 271 | "nearley": "^2.20.1" 272 | } 273 | }, 274 | "prism-media": { 275 | "version": "1.2.8", 276 | "resolved": "https://registry.npmjs.org/prism-media/-/prism-media-1.2.8.tgz", 277 | "integrity": "sha512-bJ8J9PKpUdG6GmtnlaPSi2cMdGDLsS9o4iOlOncJasku73uJucgcN9Yr7/jlENqfh7hoR6LDqPr17JEzp6srjg==" 278 | }, 279 | "railroad-diagrams": { 280 | "version": "1.0.0", 281 | "resolved": "https://registry.npmjs.org/railroad-diagrams/-/railroad-diagrams-1.0.0.tgz", 282 | "integrity": "sha1-635iZ1SN3t+4mcG5Dlc3RVnN234=" 283 | }, 284 | "randexp": { 285 | "version": "0.4.6", 286 | "resolved": "https://registry.npmjs.org/randexp/-/randexp-0.4.6.tgz", 287 | "integrity": "sha512-80WNmd9DA0tmZrw9qQa62GPPWfuXJknrmVmLcxvq4uZBdYqb1wYoKTmnlGUchvVWe0XiLupYkBoXVOxz3C8DYQ==", 288 | "requires": { 289 | "discontinuous-range": "1.0.0", 290 | "ret": "~0.1.10" 291 | } 292 | }, 293 | "ret": { 294 | "version": "0.1.15", 295 | "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", 296 | "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==" 297 | }, 298 | "selderee": { 299 | "version": "0.6.0", 300 | "resolved": "https://registry.npmjs.org/selderee/-/selderee-0.6.0.tgz", 301 | "integrity": "sha512-ibqWGV5aChDvfVdqNYuaJP/HnVBhlRGSRrlbttmlMpHcLuTqqbMH36QkSs9GEgj5M88JDYLI8eyP94JaQ8xRlg==", 302 | "requires": { 303 | "parseley": "^0.7.0" 304 | } 305 | }, 306 | "setimmediate": { 307 | "version": "1.0.5", 308 | "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", 309 | "integrity": "sha1-KQy7Iy4waULX1+qbg3Mqt4VvgoU=" 310 | }, 311 | "tr46": { 312 | "version": "0.0.3", 313 | "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", 314 | "integrity": "sha1-gYT9NH2snNwYWZLzpmIuFLnZq2o=" 315 | }, 316 | "tweetnacl": { 317 | "version": "1.0.3", 318 | "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-1.0.3.tgz", 319 | "integrity": "sha512-6rt+RN7aOi1nGMyC4Xa5DdYiukl2UWCbcJft7YhxReBGQD7OAM8Pbxw6YMo4r2diNEA8FEmu32YOn9rhaiE5yw==" 320 | }, 321 | "webidl-conversions": { 322 | "version": "3.0.1", 323 | "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", 324 | "integrity": "sha1-JFNCdeKnvGvnvIZhHMFq4KVlSHE=" 325 | }, 326 | "whatwg-url": { 327 | "version": "5.0.0", 328 | "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", 329 | "integrity": "sha1-lmRU6HZUYuN2RNNib2dCzotwll0=", 330 | "requires": { 331 | "tr46": "~0.0.3", 332 | "webidl-conversions": "^3.0.0" 333 | } 334 | }, 335 | "ws": { 336 | "version": "7.4.4", 337 | "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.4.tgz", 338 | "integrity": "sha512-Qm8k8ojNQIMx7S+Zp8u/uHOx7Qazv3Yv4q68MiWWWOJhiwG5W3x7iqmRtJo8xxrciZUY4vRxUTJCKuRnF28ZZw==" 339 | } 340 | } 341 | } 342 | -------------------------------------------------------------------------------- /package.json: -------------------------------------------------------------------------------- 1 | { 2 | "name": "intrabot", 3 | "version": "1.0.0", 4 | "description": "Projet Hub do a bot discord Connected to Intranet", 5 | "main": "bot.js", 6 | "scripts": { 7 | "test": "node index.js" 8 | }, 9 | "repository": { 10 | "type": "git", 11 | "url": "git+https://github.com/BastienBoymond/IntraBot.git" 12 | }, 13 | "keywords": [ 14 | "Node", 15 | "Bot", 16 | "Discord", 17 | "Intranet", 18 | "Epitech" 19 | ], 20 | "author": "Bastien Boymond", 21 | "license": "ISC", 22 | "bugs": { 23 | "url": "https://github.com/BastienBoymond/IntraBot/issues" 24 | }, 25 | "homepage": "https://github.com/BastienBoymond/IntraBot#readme", 26 | "dependencies": { 27 | "axios": "^0.21.2", 28 | "change-url": "^1.1.2", 29 | "discord.js": "^12.5.1", 30 | "epitech_intranet_api": "^1.2.7", 31 | "fs": "0.0.1-security", 32 | "modify-image-url-md": "0.0.1", 33 | "node": "^15.10.0" 34 | } 35 | } 36 | --------------------------------------------------------------------------------