Installation - Ganyu-Studios/stelle-music GitHub Wiki

  • Trying to run Stelle? Here are a few brief steps.
  • Also make sure you have the minimum requirements.

📋 Clone the repo

git clone https://github.com/Ganyu-Studios/stelle-music.git

# Or if you want to get the latest (and experimental) features (not recommended), use:

git clone https://github.com/Ganyu-Studios/stelle-music.git --branch dev

📋 Install Dependencies

cd stelle-music
pnpm i

📋 Environment Variables

  • Stelle needs some environment variables to work.
  1. Copy the .env.example file. (located in the root of the project)
  2. Rename the file to: .env.
  3. Fill the required variables. (available variables)

📋 Database

  • Stelle uses Prisma ORM to manage the database.
  • And also uses Redis as alternative cache.

When prisma is installed the first time (or update prisma) prisma needs to generate the types to work.

  1. Run pnpm generate to generate the types

This also applies when you make changes in the schema, you need to generate the new types.

Note

You can execute also pnpm prisma db push to synchronize the database.
This needs to be executed when you make changes in the schema (It's not mandatory, but I recommend it.)

Important

You need to follow the DATABASE_URL example url format.
You can learn more about the prisma url format here

📋 Configuration

  • Stelle has a configuration to save a specific data, now you can create multiple files to store them!

Note

For now, Stelle only has two config types: local & default to load.

Name Usage
local.config Used as local config for the bot.
default.config Used as default config of the bot.

The bot expects at least one of the two files, first start searching for local.config and after, default.config.
So you need to create a local.config if you want to add your own data.

  1. First, go to: /src/config/
  2. Create a local.config or you can use the default.config by default. (ending with .ts)
  3. Fill the required properties.

Example:

Click to show.
//
// Imagine this is the local.config.ts file.
//

import { createConfig } from "#stelle/utils/data/configuration.js"; // Stelle now has a helper function to make the config creation easier.

//
// Exporting the config as default is important to ensure that the bot can obtain the properties.
//
// NOTE: These properties are example values, if you copy and pase it exactly, maybe you will get some erros.
//       so, please be careful, and fill the required spaces.
//
export default createConfig({
    defaultLocale: "en-US",
    defaultPrefix: "stelle",
    prefixes: ["st!"],
    defaultSearchPlatform: "spotify",
    defaultVolume: 100,
    lyricsLines: 10,
    disconnectTime: ms("30s"),
    inviteLink:
        "https://discord.com/oauth2/authorize?client_id=1241085977544359968&permissions=36793408&integration_type=0&scope=bot+applications.commands",
    githubLink: "https://github.com/Ganyu-Studios/stelle-music", // <-- Replace with your bot invite
    developerIds: [], // <-- Replace with an array of user ids
    guildIds: [], // <-- Same here, replace with an array of guild ids
    nodes: Sessions.resolve(
        {
            id: "SN #1", // <--- AKA Stelle Node
            host: "localhost",
            port: 2333,
            authorization: "youshallnotpass",
            secure: false,
            retryAmount: 25,
            retryDelay: ms("30s"),
        },
        // <--- Add more nodes here if you want...
    ),
    color: {
        success: 0x8d86a8,
        extra: 0xece8f1,
    },
    channels: {
        guildsId: "the-id-was-here", // <-- Replace with your guilds logger channel.
        errorsId: "the-id-wasn't-here", // <-- Replace with your errors logger channel.
    },
    permissions: {
        stagePermissions: ["MuteMembers"],
        voicePermissions: ["ViewChannel", "Connect", "Speak"],
    },
    sessions: {
        enabled: true,
        resumeTime: ms("1min"),
        resumePlayers: true,
    },
    cache: {
        size: 5,
    },
});

📋 Traspile and Run

  • Stelle is made in typescript but she can runs in javascript.

Run the bot in javascript

pnpm clean # Will re-create the dist folder
pnpm start # Will start the bot

Run the bot in typescript

# Run it!
pnpm dev

🔎 Looking for a lavalink node?

Stelle needs a Lavalink node to play music.
See self-hosting a node for more.

⚠️ **GitHub.com Fallback** ⚠️