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
    • animationRoleWinnerAnimationID : ID of the event winner role
    • animationChannelEventID : ID of the channel where animation 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/animation-add.js : into your slash commands folder
    • commands/animation-list.js : into your slash commands folder
    • commands/animation-remove.js : into your slash commands folder
    • commands/animation-message.js : into your slash commands folder
    • events/interactionCreate.js : copy the relevant part of the code from this file to encode it in your own file
    • utils/arguments/post-message.js : into your utilities folder
    • utils/animation.js : into your utilities folder

    Also copy the module initialization code into your main index.js file. In our file, Prisma is attached directly to the client object — add this code to your project or adapt it according to how you use Prisma.

  4. Update the database schema

    Add the data model for animations 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_animation_model
  5. Install dependencies

    Ensure the 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 slash commands /animation-add, /animation-list, /animation-remove, /animation-message on a test server before deploying to production.
  • In index.js you can adjust the scheduling for removing the “Event Winner” role as needed. (Currently configured to run every day at 23:59).