This repository has been archived on 2024-12-31. You can view files and clone it, but cannot push or open issues or pull requests.

98 lines
2.9 KiB
Markdown

<h1 align="center">Sheepstar Core</h1>
## About The Project
This is the official Sheepstar Core. It was written with java and made to run with the JDA. Have fun during programming
your own modules :p
## Getting Started
### Installation
1. Create a new project in your IDE
2. Import the dependency from https://jitpack.io/#sheepstar-dc/SheepstarCore
3. Create an `.env` folder (or another folder in which you want to load the runtime)
4. Create a `config.json` file in your `.env` folder and replace it to your needs
```json
{
"token": "the discord bot token",
"api_key": "the key of the sheepstar api",
"api_url": "https://api.sheepstar.xyz",
"moduleDirectory": "modules",
"mysql": {
"hostname": "localhost",
"username": "username",
"password": "password",
"database": "database"
},
"commands": {
"enable_ping_feature": true,
"enable_prefix_feature": true,
"enable_slash_feature": true,
"debug_guild": "guildID / leave empty to set global"
},
"permissions": {
"BOT_OWNER": [
"357214370188492802",
"386242172632170496"
],
"SUPPORTER": {
"guildID": "846497208086167602",
"roleID": "860823465329295380"
}
},
"activities": [
{
"type": "WATCHING",
"name": "discord.gg/dAe7BPsHZc"
},
{
"type": "LISTENING",
"name": "/help"
},
{
"type": "WATCHING",
"name": "sheepstar.xyz"
}
],
"pools": [
{
"name": "SR-PreparePool",
"cores": 16
},
{
"name": "SR-CommandPool",
"cores": 8
},
{
"name": "SR-ListenerPool",
"cores": 8
},
{
"name": "SR-ActionPool",
"cores": 4
}
]
}
```
5. Add a `module.yml` file into your resources
```yaml
main: xyz.sheepstar.exampleModule.Bootstrap # your main class
name: example module # your module name
author: Mathias Wagner # the name of the author
```
### Optional: Instant reloading (Only works in IntelliJ)
#### If you want to, you can create a configuration that lets you update the changes directly without restarting (in most cases)
1. Go to `Project Settings` > `Artifacts` and create a new empty artifact
2. Add `compile output` into your `.jar` file
3. Change the output directory to the `modules` directory (it should be located in your runtime folder. if not, create
one.)
4. Apply the settings and create a new `Application`-configuration
5. Change the main-class to `xyz.sheepstar.core.SheepstarCore`
6. Click on `Modify options` > `Add before launch task` > `Build artifact` and choose your created artifact
7. Change the working directory to your runtime folder
8. Add `-cf config.json` to your program arguments
9. Ready! Click on the debug-icon to start your module, make a change and click on the build-icon to try it