My Discord bot to prevent spam and malicious link. This project is still under development and testing on my discord server. Any feedback is welcome.
- Spam & malicious messages detection.
- URL scanning with VirusTotal.
- Modular & clean structure layout.
- Lavalink Audio player with multiple sources based the server.
Below is a basic overview of the project structure:
├── assets/ # Static assets used by the bot (e.g. banners, icons)
├── commands/ # Slash and text command logic files
├── config/ # Configuration files (only for filtering url ATM)
├── events/ # Discord event listeners
├── handlers/ # Discord command & event handlers logic
├── lavaEvents/ # Lavalink events handler for audio player
├── utils/ # Utility functions
├── .env
├── client.js # Bot client setup
├── commands.js # Bot commands registration file
├── main.js # Main entry point of the bot
├── package.json
├── README.md
└── .gitignore
- Node.js
- Discord application & bot with necessary permissions.
Configuring the discord app & bot is covered in detail in the getting started guide.
Before you start, ensure the prerequisites are fulfilled and you have setup the environment variables:
APP_ID=
PORT=
DISCORD_TOKEN=
PUBLIC_KEY=
VIRUSTOTAL_KEY=
HEROKU_LOG=
PASSIVE_MODE=
AFK_ROOM=
GENERAL_ROOM=
GUILD_ID=
LOG_CHANNEL_ID=
WELCOME_CHANNEL_ID=
LAVALINK_HOST=
LAVALINK_PORT=
LAVALINK_SECRET=
For the first time:
npm install
The commands for the app are set up in commands.js. All of the commands in the commands directory will be registered on the server when you run the register command configured in package.json:
npm run register
You can run the app directly by:
node main.js
or
npm run start
⚙️ A package like
nodemon, which watches for local changes and restarts your app, may be helpful while locally developing. Usenpm run devinstead.