Git Product home page Git Product logo

drawbot's Introduction

discord-drawbot

Made by drawbu

Codacy Badge GitHub GitHub code size in bytes GitHub repo size Lines of code GitHub last commit GitHub commit activity

A Pronote notifier discord bot.

We now have a Discord sever! You can join it if you have some questions, some issues or just want to talk about the bot. Click here to join

‼️ Don't try with a wrong username or password too many time, or you can get banned from Pronote
⚠️ We do not take responsibility for a possible leak of your passwords, which is why you need to host the bot yourself.

Some screenshots

Homework message Grade message

Installation

git clone https://github.com/drawbu/drawbot
cd drawbot

pip install -e .

Launch

py drawbot

If you are using a Linux distribution or macOS, you can use the make command to install dependencies and run the bot.

Files documentation

The bot will create 3 json files in the vars folder:

  • devoirs.json
  • grades.json
  • config.json

vars/config.json

This file stocks your private logins and info's to make to bot running. You can find a config.example.json file in the vars folder.

config.json Example

{
    token: "( ͡° ͜ʖ ͡°)",
    channelID: "000000000000000000",
    username: "demonstration",
    password: "pronotevs",
    url: "https://demo.index-education.net/pronote/eleve.html?login=true",
    ping: "<@000000000000000000>"
}

copy that file as config.json and fill in the values as follows:

  • "token": your bot token.
  • "channelID": the ID of the Discord channel.
  • "username": your Pronote username.
  • "password": your Pronote password.
  • "url": the url of your pronote client.
  • "ping": the ping you want to send with the message. It can be a discord user, a role, multiple mentions... Note that mentions should keep discord mentions style (<@user_id> or/and <@&role_id>)

If you can't connect to Pronote, check if your establishment is not using an ENT. In this case, see what you need to do with the help of the pronote wrapper project: pronotepy

Files vars/devoirs.json and vars/grades.json are here to stock what's has been already sent, so you don't need to care about them

Docker

You can also run the bot in a docker container.

You still need to clone the repository, and fill the config.json file.

Then, you can build the image:

docker build -t drawbot .

And run it:

docker run -d -it --rm drawbot

drawbot's People

Contributors

apprehensivetarget avatar bain3 avatar codacy-badger avatar drawbu avatar sigmanificient avatar snyk-bot avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

drawbot's Issues

:zap: Implement chunked embed message

When the bot is run for the first time, all homeworks & grades are fetched and bulk send within the configured channels.
However, every embed is send within its own message which is a waste considering every message can contains up to 5 embeds.

Implementing such a feature would make the first fetch process 5 times faster and thus could avoiding unwanted ratelimits if the numbers of homework/notes is small enough.

from how-do-i-split-a-list-into-equally-sized-chunks

def chunks(lst, n):
    """Yield successive n-sized chunks from lst."""
    for i in range(0, len(lst), n):
        yield lst[i:i + n]

pronote.json & devoirs.json ne se créent pas !

Bonsoir, j'ai écrit le code et je l'ai extrait dans un dossier.
J'ai fais la commande "pip install -r requirements.txt" dans mon cmd. Le fichier config.json s'est créé et je l'ai modifié avec les données nécessaires, cependant aucun fichier pronote.json ni devoirs.json que se soit dans ce dossier ou dans le sous dossier "app". J'ai bien essayé de lancer les autres fichiers python (bot.py, pronote.py et information.py) mais rien ne se passe : le cmd "travaille" puis me repropose de saisir une commande.

How can we deploy this in a docker container ?

Hi, how can we deploy this project in a docker container?
I would like to do this to run it easily 24h/24.
I tried to do it by myself but I am not very competent 😆
Thank you in advance for your answer!

pronotepy.PronoteAPIError

Bonjour,
J'ai l'erreur Connexion à Pronote échoué . Après un test, je vois que cela viens de cette partie du code :

        except pronotepy.PronoteAPIError:
            print("Connexion à Pronote échoué")
            return

Comment résoudre ce problème ? Cela viens surement pronotepy mais je ne suis sur de rien.

Merci, bonne journée !

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.