Skip to content

Installing and configuring the bot

CPS edited this page Aug 22, 2024 · 3 revisions

🚀 Installation from Source

  1. Clone the Ultimate Tunes repository:

    First, clone the bot's repository to your local machine:

    git clone https://github.com/CPS7/Ultimate_Tunes.git
  2. Change to the Ultimate Tunes directory:

    Navigate to the project directory:

    cd Ultimate_Tunes
  3. Install the required packages:

    Install all the necessary dependencies using npm:

    npm install
  4. Configure the Environment Variables:

    Copy the .env.example file and rename it to .env:

    cp .env.example .env

    Open the .env file in a text editor and fill in the required values:

    • TOKEN: Your Discord bot token.
    • MONGO_URI: Your MongoDB connection string.
    • CLIENT_ID: Your bot's client ID.
    • GUILD_ID: (Optional) Your guild ID if you want to register slash commands only for a specific guild.

    Example:

    TOKEN=YOUR_BOT_TOKEN_HERE
    MONGO_URI=YOUR_MONGO_URI_HERE
    CLIENT_ID=YOUR_CLIENT_ID_HERE
    GUILD_ID=YOUR_GUILD_ID_HERE
  5. Configure the Bot Settings:

    Copy the config.example.json file and rename it to config.json:

    cp config.example.json config.json

    Open the config.json file in a text editor and fill in the required values:

    • clientId: Your bot's client ID.
    • prefix: The prefix for your bot commands (e.g., !).
    • messages.COOLDOWN_MESSAGE: Customize the cooldown message for commands.
    • ownerID: Your Discord user ID.
    • adminId: The Discord user IDs of admins.
    • uri: Your MongoDB connection string.
    • nodes: Lavalink server details (host, identifier, password, port).

    Example:

    {
        "clientId": "YOUR_CLIENT_ID_HERE",
        "prefix": "!",
        "messages": {
            "COOLDOWN_MESSAGE": "You are on <duration> cooldown!"
        },
        "ownerID": ["YOUR_USER_ID_HERE"],
        "adminId": ["ADMIN_USER_ID_HERE"],
        "uri": "YOUR_MONGO_URI_HERE",
        "alwaysOnlineReplit": true,
        "nodes": [
            {
                "host": "YOUR_LAVALINK_HOST_HERE",
                "identifier": "YOUR_LAVALINK_IDENTIFIER_HERE",
                "password": "YOUR_LAVALINK_PASSWORD_HERE",
                "port": 2333,
                "retryAmount": 1000,
                "retrydelay": 10000,
                "resumeStatus": true,
                "resumeTimeout": 1000,
                "secure": false
            }
        ]
    }
  6. Run the Bot:

    With everything configured, you can now start your bot:

    npm start
  7. Invite the Bot to Your Server:

    Generate an invite link for your bot from the Discord Developer Portal or use the Permissions Calculator to select the necessary permissions and invite the bot to your server.

    • OAuth2 URL Generator: Select bot and applications.commands scopes, then choose the required permissions for your bot.
  8. Test the Bot:

    After inviting the bot to your server, test it by using the commands you configured. Ensure MongoDB integration, Lavalink music playback, and other features work as expected.

🔗 Useful Links

This comprehensive guide should help you get your bot up and running with all the necessary configurations!


Wiki Sidebar

  • Home

    • Introduction and Overview
    • Features and Capabilities
  • Installing and Configuring the Bot

    • Prerequisites
    • Installation Steps
    • Configuration Guide
      • .env Configuration
      • config.json Configuration
  • Connecting MongoDB

    • Setting Up MongoDB
    • Connecting MongoDB via Driver URL
    • Configuring MongoDB in Your Bot
  • Connecting Lavalink

    • Downloading and Setting Up Lavalink
    • Configuring Lavalink in Your Bot
    • Connecting the Bot to Lavalink
    • Troubleshooting Lavalink Connections
  • FAQ

    • Common Issues and Solutions
    • How to Enable Message Content Intent
    • Bot Permissions and Command Issues
    • Music Playback and Node Configuration
    • Admin Management and Token Changes

Clone this wiki locally