Skip to content

Getting Started

RyanLand edited this page Nov 7, 2024 · 7 revisions

New to Colossus? Here is a guide to get you started.

Creating a bot

  1. Create a Discord bot application on the Developer Portal.
  2. Add a bot
  3. Save the token
  4. Add it to your server (if you specify the guild ID in your config, Colossus will generate an invite link automatically)

Prerequisites

  • Java 17
  • Project with Gradle/Maven
  • An IDE (IntelliJ IDEA recommended)

Installation

You can install Colossus inside of your project using a dependency manager, as seen below:

Gradle

repositories {
    maven { url 'https://jitpack.io' }
}

dependencies {
    implementation 'com.github.RyanLandDev:Colossus:VERSION'
}

Maven

<repositories>
    <repository>
        <id>jitpack.io</id>
        <url>https://jitpack.io</url>
    </repository>
</repositories>

<dependency>
    <groupId>com.github.RyanLandDev</groupId>
    <artifactId>Colossus</artifactId>
    <version>VERSION</version>
</dependency>

Starting your bot

Create a ColossusBuilder to set up your bot.

The ColossusBuilder class contains methods to define all kinds of properties for your bot.

Colossus bot = new ColossusBuilder() // the default constructor -- creates a `config.json` file in your root project directory. Use another constructor for other configuration setups.
    .scanPackage("dev.ryanland.firstbot") // scans the entire project for commands, database entities and listeners, registering them automatically
    .build();
bot.initialize(); // initialize the bot