Skip to content

Installation

Follow these steps to correctly install the script on your bot.

  1. Download the module & unzip the folder

    Retrieve the module folder (usually in .zip or .rar format) from the official source.
    Use a tool like WinRAR or 7-Zip to extract the script folder on your computer.

  2. Configure environment variables

    Open the provided .env file and add/modify the environment variables required for the module to work correctly.

    • guildID : ID of the Discord server where the bot is deployed
    • channelBirthdayID : ID of the channel where birthday messages will be sent
  3. Copy/move the files/code into your project

    Copy the following files into the appropriate folder(s) of your Discord bot project:

    • commands/birthday.js into your slash commands folder
    • utils/birthday.js into your utilities folder

    Also copy the module registration code into your main index.js. In this file, we have added Prisma directly linked to the “client” object. Put this code in your own file or adjust it according to how you use Prisma.

  4. Update the database schema

    Add the birthday data model to your prisma/schema.prisma file and run the necessary migrations to apply the changes to your database.
    Run the following commands:

    Terminal window
    npx prisma generate
    npx prisma migrate dev --name add_birthday_model
  5. Install dependencies

    Make sure required dependencies are installed by checking your package.json and running:

    Terminal window
    npm install
  6. Restart the bot

    Restart your bot so the script is loaded.


  • Test the /birthday slash command in a test server before deploying to production.
  • In index.js you can adjust the scheduling of birthday messages as needed (currently set to run every day at 08:00).
  • In utils/birthday.js you can customize the content of the birthday messages sent to users.