Git Product home page Git Product logo

nestor-bot's Introduction

Nestor Bot

Our school has a FabLAB containing 3D printers and this Bot will allow students to place orders from our site and track orders from Discord. In addition, this Bot will allow you to create a role management by reaction to an emoji and to notify new member, removing member, edited message and deleted message.

How to Install

  1. Clone this repository.
  2. npm install for install dependencies.
  3. Add the following files:
  • The config.json file:
{
  "clientId": "YOUR_CLIENT_ID",
  "token": "YOUR_TOKEN"
}
  • The configurations.json and reactions.json files in /data folder. Follow the instructions here.
  1. npm start to launch your server.

How It Works

Before starting it is recommended to create a role for the users who manage the Bot's interactions and to define the permissions of the channel containing the Webhook. The process works in two steps, the Webhook sending the order in the channel is the first step and the second is the Bot's response to this message with interactions described below.

Webhook Message

When a student places an order for a 3D print, he uploads his file and chooses his filament, then he validates his order. His order is transmitted to the PHP file (Webhook) which sends a message containing the summary of his order in the Dicord channel.

Bot Response to Webhook Message

The Bot will respond to the Webhook message with the following message:

bot_reponse

This message contains five buttons of which here is a table showing the usefulness of each button:

Button Name Utility
๐Ÿ”ฝ Download Shows that the print file has been uploaded and is ready for printing.
๐Ÿ–จ Print Shows that the part is being printed.
โœ” Finish Shows that the part has been successfully printed.
โš  Default Shows that the print had a fault.
โœ– Error Shows that there was an error either in the command (the form) or in the file or another error to be specified.

Add Info Using the Slash Command

The Bot contains several commands to manage orders, permissions Bot and more:

  • command-fablab
    • description This command allows you to add a description to a command. For example add the reason for an error.
    • temps_impression This command adds the estimated print time to let the customer know when they can pick up their part.
    • fin_impression This command adds the actual print time (the time it took to print) and an optional photo to preview the printed part.
  • site-fablab This command sends a message with two buttons which are links to the sites to place an order.
  • help This command sends a message containing all the commands and their usefulness.
  • gestion-salon
    • ajouter-salon This command adds Bot permissions to a channel. This is to limit the use of orders to authorized salons.
    • supprimer-salon This command removes the Bot's permissions to a channel.
    • salons-list This command displays all authorized channels.
  • gestion-role
    • ajouter-role This command allows you to add a role to an emoji so that the person reacting with this specific emoji is assigned this role. It is a self-role by reaction of an emoji. To use it, you must give the ID of a message on which the Bot will react.
    • supprimer-role This command removes the self-role from a message.
    • roles-list This command displays all possible reactions (emoji and role) of one or all saved messages.
  • create-embed-message This command allows you to create a customizable message in Embed format.
  • logs-parametres
    • modifier-parametres-interaction This command allows you to modify the interactions log (channel ID, button, command and reaction).
    • modifier-parametres-member This command allows you to modify the member log (channel ID, add and remove).
    • modifier-parametres-message This command allows you to modify the message log (channel ID, delete, update, add channel and remove channel).
    • afficher-parametres This command displays all the configuration parameters of the logs.

Logger

The logger has two transports:

  • Console: Show all logs in the console.
  • File: A log file named nestor-bot.log will be created in the /data folder.

Getting Started Link

License

Apache License

Copyright (c) 2022 Gauthier Dandele

nestor-bot's People

Contributors

dependabot[bot] avatar gogovega avatar marcus-j-davies avatar

Stargazers

 avatar

Watchers

 avatar

Forkers

marcus-j-davies

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.