GreetGuardian is a Discord bot designed to enhance your server's experience by playing a custom sound whenever a specific user joins a voice channel. Whether you want to welcome users with a friendly greeting, a fun sound effect, or even a personalized message, GreetGuardian makes sure every entry is noticed.
-
Add GreetGuardian to Your Server
Use this link to add the bot to your server. -
-
/config-new-sound
Configures a new sound to play when a user enters the server. By default, the bot plays the sound for the same user only once every 60 minutes. This time interval can be configured using the/update-server-config
command. This command has 2 required parameters:- @target: The user to add a new sound for in the server.
- sound: The sound file to play when the user joins a channel. Note that the file needs to be an mp3 with a maximum size of 250kb.
-
/toggle-user-sound
Turns on and off the functionality of the bot to play sound for a specific user. This command has 1 required parameter:- @target: The user affected by the command.
-
/reset-user-timer
Resets the timer for the bot to play sound again for a specific user. This command has 1 required parameter:- @target: The user affected by the command.
-
/reset-all-users-timers
Resets the timer for the bot to play sound again for all users. -
/update-server-config
Configures the server settings for the bot. This command has 2 optional parameters:- play: Whether the bot should stop playing sound in that server.
- delay: The number of minutes the bot should wait to play sound again for a specific user.
-
Step-by-step guide to running the bot on your local machine:
-
Ensure Prerequisites
- Git: Install Git for version control and repository management.
- Node.js: Install Node.js version 20 or higher.
- FFmpeg: Install FFmpeg for audio processing.
- Docker: Install Docker to run the bot in a containerized environment.
-
Clone the Repository
git clone https://github.com/FabioCeleste/greetGuardian.git cd greetGuardian
-
Ensure Prerequisites
Run the following command to install the required Node.js packages:
npm install
-
Configure Environment Variables
Create a .env file in the root directory with the following content:
DISCORD_TOKEN=your_discord_bot_token DISCORD_CLIENT_ID=your_discord_bot_client_id DISCORD_GUILD_ID=your_guild_id_for_slash_commands DATABASE_URL=database_url POSTGRES_PASSWORD=database_password POSTGRES_DB=postgres_database
Note: If DISCORD_GUILD_ID is not provided, slash commands will be registered to all servers the bot is added to.
-
Register Slash Commands
If slash commands are not configured, run:
npm run register-commands-dev
-
Start the Bot
Finally, run:
docker-compose up --build
GreetGuardian leverages a powerful stack of technologies to deliver a seamless and reliable experience. Here’s a look at what’s under the hood:
-
Node.js with TypeScript: The project is built on Node.js, using TypeScript to provide strong typing and modern JavaScript features for robust and maintainable code.
-
Discord.js: This library powers the bot's interaction with Discord's API, enabling it to handle events, manage voice channels, and execute commands.
-
FFmpeg: Used for audio compression and processing, FFmpeg ensures that sound files are optimized for performance without compromising quality.
-
PostgreSQL: This reliable relational database serves as the backbone for storing user configurations and sound files, providing a solid foundation for data management.
-
Prisma: Acting as the ORM layer, Prisma facilitates smooth database interactions with an intuitive API, allowing for efficient data querying and manipulation.
-
ESLint and Prettier: Code quality is maintained with ESLint for linting and Prettier for code formatting, ensuring a consistent and error-free codebase.
-
Docker and GitHub Actions: Docker containers are used for consistent and isolated development environments, while GitHub Actions automates the build, test, and deployment processes, streamlining the CI/CD pipeline.
This tech stack not only ensures high performance and reliability but also enhances the developer experience with modern tooling and practices.
For support or collaboration, you can reach out via the following:
- LinkedIn: Fabio Celeste
- GitHub: FabioCeleste
- Email: [email protected]