Project Structure
This section provides an overview of Project Structure.
Project Structure Overview
ROOT
This folder contains the main application code for etmc-bot. managing command, lib, function, and specific content.
root // Main ETMC-BOT application folder
├── index.js // Main Function and configuration.
├── yourProjectApi.json // Main API You Made before
commands
This folder contains all commands can handle, the adminCommand is the Super Admin use % as a prefix, and the regular command should in the commands folder and use ! as a prefix.
commands // Main Commands Should be in this folder
├── adminCommand // This a Super Admin Command you can use % as a prefix
│ └── addap.js // Command for added all users point.
└── absen.js // The Regular Command should use ! as a prefix
config
This folder contains global and Required things for bot can booting up.
config
├── config.js // handle the firebase admin, API from firebase, and main Whatsapp-web-js Client.
├── handleCommand.js //handling any command and the point system.
└── initialCommand.js //handling the Required items that bot needed for the first time booting.
lib
This folder contains helper functions and utilities used across the application, such as Markdown parsing and routing logic. These utilities help keep the codebase clean and organized by separating out common functionality.
lib
├── SnGenerate.js // function for make a Serial Number Generator.
├── AntiSpam.js // function for make sure if someone spamming and wont get a point/rep/exp.
├── CalculateEXP.js // function calculate the Pokemon Exps.
├── FightAi.js // function for Fight your Pokemon with AI.
├── FightPVP.js // function for battle PVP with your friend Pokemon.
├── getLevelStat.js // function for Rank your status in command !stat.
├── increaseStatsByLevel.js // This calculate your pokemon exp and stats After battle.
├── restartServer.js // function for reset the !absen state every single time you restart the server.
└── updateStock.js // Updating/adding the stock from !shop for pokemon stuff every 00:00am
Additional
package.json: Contains metadata about the project, dependencies, and scripts for building and running the application.yourProjectApi.json: Configures API from Firebase-admin.
This structure organizes your project in a way that supports scalability and maintainability, making it easier to navigate and work on different sections of the application.