Ewibot is a Discord Bot used only on the official La Quête d'Ewilan Discord Server. This bot aim to enhance the social interactions between users. All moderation tools have been removed from this bot.
Ewibot is written in Javascript. The tree is devided into 4 main parts:
- pics
- concrete
- vest
- db
- source code
- static code
The pics folder contains all the pictures required or generated by Ewibot for some features.
Note: the generated content is not uploaded on github.
- It includes the concrete folder, which is for the concrete command. It is used by Ewibot users to make a gif containing a falling concrete block and the specified user profile picture. It is inspired by the La Quête d'Ewilan book. The concrete jpgs folder regroups all the necessary pictures used to create the requested concrete gif. It contains 50 frames. The gifs created by the code are stored in the concrete gifs folder.
- It includes the vest folder. This one regroups the pics for the
/vestcommand.
The database folder contains the database files required. The DB system is a .json file.
db.json file is the database file used by the bot.
All the database values are stored inside of it. Note: this folder is not uploaded on github, for privacy concerns.
db.json.example is a template file. This allows to share a template between developers without sharing all users' information online.
The src folder is the folder containing all the source code for Ewibot.
Source means that its javascript (.js) files.
It is divided into 4 parts: admin, commands, helpers and the main code.
The admin folder regroups the file aiming to have an administrative action in the Discord Server. Admin means mostly roles interaction.
There are different commands available for the users. All are inside the files of the commands folder.
The folder is dedicated to regroup every file having smaller functions or methods used in more important files.
Main code refers to all the files in the src folder. It includes 5 files:
- bot.js is the principal file containing all the major Discord features required to make the bot
functional, such as
clientlogin and eventlisteners. - commons.js is where the
CommonsClass is declared. This class allows Ewibot to find the correct ids/emotes to use, according to the current guild where Ewibot is working. - fun.js regroups features that are only for fun/entertainment purpose, such as Ewibot
reactingto some specific user words, or itsactivity. - listeners.js is a file regrouping all functions associated to the events Ewibot is responding to.
- personality.js is the file where the
PersonalityClass is declared. This class allows Ewibot to chose the correct text to send to users. It will also allow admins to change Ewibot personality, but is still work in progress. - stats.js is the main file handling the stats system. This needs a complete rework (written at 6.5.1)
The static folder is including the json files used.
commons.json contains all the IDs used in the main file, like guild, channels or emoji IDs. It allows the distinction between 2 modes:
- test is the development mode, used to have the data of the Discord Test Server.
- prod is the Ewibot mode, which is using all the data from La Quête d'Ewilan Discord Server.
- shared includes all ids that are common to both Ewibot modes.
The personalities folder includes all the texts send by the bot in Discord channels. The texts are written according to different personalities but for now only one is used.
We welcome every contribution. If you want to contribute to Ewibot, you will have to follow the next instructions.
You need to install nodejs v20.19.4.
Then on your code editor you can clone the Ewibot repository, using this command on your terminal: git clone https://github.com/Eccleria/ewibot.git.
You will need to install yarn with the follow command: npm install --global yarn.
Next, you need to download every dependancy that the bot need. To do so, you need to go in the ewibot folder and use the command in the terminal: yarn.
This command installs all the libraries required, such as
discord.js.
Now, you need to setup the .env file. Create it with touch .envand use the .env.example as a template (you can copy the .env.example content and paste it in .env file).
The DEBUG line needs to be set as yes if you have only a bot used for development (used on a Discord test server), and no if you will host Ewibot on the Ewilan Discord Server.
For the database, you need to create the .db.json file in the database folder.
When created, you can repeate the same process for .env file: copy the content of the .db.json.example and paste it in the newly created file.
Remove the comments, otherwise you will get an error.
2 folders need to be created:
gifs, in the concrete folder. Nothing to add inside.pngs, in the vest folder. Nothing to add inside too.
Note: if you use an IDE that create local setup files, you shall add it to the .gitignore file. It is the case with Visual Studio 2019 that create the
.vsfolder locally, or.vscodefor Visual Studio Code.
To contribute, you can do so by different ways. You can contribute on existing branches or by creating a new branch.
For an existing branch, please ask to contributors if there are commits under way before adding yours.
For a new branch, you will need to create a Pull Request(PR) in order to have this branch merged into master. The PR cannot be merged without the approval of at least one other contributor. If the branch is still under development, you can set the PR as a draft. When it is ready, undraft it and request an approval.