npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

moulibot

v1.0.6

Published

## A Discord Bot for [my.epitech.eu](https://my.epitech.eu/)

Downloads

4

Readme

MouliBot

A Discord Bot for my.epitech.eu

This discord bot aims to make life easier for epitech students !Thanks to this bot you will be able to directly access your latest notes directly from discord ! It will be active 24/7 when I deem it fit for duty !

Setup

You need to install this :

    sudo apt install nodejs npm
    npm install discordjs
    npm install axios
    npm install quickchart-js

Then you have to create a config.json and a data.json file at the root of the project. The config.json file will contain important information about your bot such as its name, its description but also its token, the data.json file will serve as a database and will contain the token from my.epitech.eu associated with each user.

In the config.json file you must write what is below, the other file must remain empty.

{
    "prefix": "'",
    "bottoken": "bot_token",
    "botname": "bot_name",
    "botdesc": "bot_description",
    "botimg": "bot_picture",
    "data": "./data.json"
}

Then you just have to launch the bot !

    node bot.js

Overview

You can see below examples of the main commands that can be used on discord.

  • 'last : Shows the last test performed on my.epitech.eu, you can also change the test by clicking on the arrows under the message.

  • 'select <project_name> : Shows the last test performed on the project as argument (you can put the full project name or only the simplified version as in the example.

  • 'total : Shows the total of syntax errors of all your projects combined per units. You can also look at the syntax errors per units by doing the command 'total <unit_name>

Token

For the moment you have to enter your token yourself, so you have to go get it manually, but this will change in the future to make it much easier

Where to find this token?

First you need to go and login to my.epitech.eu then right click, inspect, and go to the networks section.Once done you will probably have to do ctrl + r to refresh the requests. Once done at the top of the section, check Fetch/XHR and search for the "2021" query.Once inside you will find the Authentication variable which contains our token, so copy it without the "Bearer" at the beginning !

API

For this bot I use the api of api.epitest.eu but this one is not documented, here is what I can show you about it, hoping to help you !

First you have to request on this link : https://api.epitest.eu/me/${CurrentYears}/your_token ⚠️ Oddly the year in the ${Current Years} variable is one year back (example: 2022 => 2021) ⚠️

Then the response from the api looks like this :

[{
    {
        "project": {
            "slug": "dante",            → Short Project Name
            "name": "Dante's star",     → Project Name
            "module": {
                "code": "B-CPE-200"     → Unit
            },
            "skills": []
        },
        "results": {
            "testRunId": 4736784,
            "logins": ["[email protected]"],
            "prerequisites": 2.0,
            "externalItems": [{
                "type": "lint.note",    → Project Note
                "value": -3.0
            }, {
                "type": "lint.major",   → Major Error
                "value": 0.0
            }, {
                "type": "lint.minor",   → Minor Error
                "value": 3.0
            }, {
                "type": "lint.info",    → Info Error
                "value": 3.0
            }],
            "mandatoryFailed": 0,
            "skills": {
                "00 - Basics": {
                    "count": 2,          → Total Test of this part
                    "passed": 2,         → Number of Test passed
                    "crashed": 0,        → NUmber of Test crashed
                    "mandatoryFailed": 0
                },
                ...
                "05 - Solving": {
                    "count": 6,
                    "passed": 2,
                    "crashed": 0,
                    "mandatoryFailed": 0
                }
            }
        },
        "date": "2022-05-19T08:07:02Z"  → Test Date
    },
    ...
}]
    

If you like this project don't hesitate to star it !

Authors