Skip to content

Commit fa55b58

Browse files
DxsSucukgitbook-bot
authored andcommitted
GITBOOK-9: No subject
1 parent 8206272 commit fa55b58

File tree

13 files changed

+784
-0
lines changed

13 files changed

+784
-0
lines changed

README.md

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
---
2+
description: The official Wiki of Ree6!
3+
coverY: 0
4+
layout:
5+
cover:
6+
visible: true
7+
size: full
8+
title:
9+
visible: true
10+
description:
11+
visible: true
12+
tableOfContents:
13+
visible: true
14+
outline:
15+
visible: true
16+
pagination:
17+
visible: false
18+
---
19+
20+
# Welcome to the Ree6 Wiki!
21+
22+
## What can you expect here?
23+
24+
In this Wiki we will be showing you everything from hosting Ree6 yourself to helping with the official Ree6 development!
25+
26+
## What features does Ree6 have?
27+
28+
{% content-ref url="broken-reference" %}
29+
[Broken link](broken-reference)
30+
{% endcontent-ref %}
31+
32+
## How can I self host Ree6?
33+
34+
For the Bot you can use this guide:
35+
36+
{% content-ref url="bot/self-hosting/" %}
37+
[self-hosting](bot/self-hosting/)
38+
{% endcontent-ref %}
39+
40+
For the Webinterface you can use this guide below:
41+
42+
{% content-ref url="webinterface/self-hosting.md" %}
43+
[self-hosting.md](webinterface/self-hosting.md)
44+
{% endcontent-ref %}

SUMMARY.md

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# Table of contents
2+
3+
## 🏠 Home
4+
5+
* [Welcome to the Ree6 Wiki!](README.md)
6+
7+
## ✨ Features
8+
9+
* [Community](features/community.md)
10+
* [Music System](features/music-system.md)
11+
12+
## 🤖 Bot
13+
14+
* [Self hosting](bot/self-hosting/README.md)
15+
* [Self host with Pterodactyl](bot/self-hosting/self-host-with-pterodactyl.md)
16+
* [Addon System](bot/addon-system/README.md)
17+
* [Make your first Addon](bot/addon-system/make-your-first-addon.md)
18+
* [StreamTools](bot/streamtools.md)
19+
* [Configurations](bot/configurations.md)
20+
* [Translations](bot/translations.md)
21+
* [Troubleshooting](bot/troubleshooting.md)
22+
23+
## 🌐 Webinterface
24+
25+
* [Self hosting](webinterface/self-hosting.md)

bot/addon-system/README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
---
2+
description: Informations about the Addon System of Ree6!
3+
---
4+
5+
# Addon System
6+
7+
## Whats that?
8+
9+
Its a API that allows users to create Addons for Ree6 without directly modifying the original Source!
10+
Lines changed: 151 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,151 @@
1+
# Make your first Addon
2+
3+
## Requirements
4+
5+
Developing with the Ree6 Addon API requires Java 17.\
6+
We recommend using Maven or Gradle to import Ree6 as a Library file into your project.
7+
8+
Example for Maven:
9+
10+
```xml
11+
...
12+
<repository>
13+
<id>jitpack.io</id>
14+
<url>https://jitpack.io</url>
15+
</repository>
16+
17+
...
18+
19+
<dependency>
20+
<groupId>de.ree6</groupId>
21+
<artifactId>Ree6</artifactId>
22+
<version>VERSION</version>
23+
</dependency>
24+
...
25+
```
26+
27+
## Lets get started!
28+
29+
When working with the Ree6 Addon API you need to create a Main class of your Addon which implements our `AddonInterface` class!
30+
31+
In this example we call the class AddonMain:
32+
33+
```java
34+
public class AddonMain implements AddonInterface {
35+
}
36+
```
37+
38+
After implementing the AddonInterface you should start with the onEnable and onDisable Methods!
39+
40+
```java
41+
@Override
42+
public void onEnable() {
43+
System.out.println("Start!");
44+
}
45+
46+
@Override
47+
public void onDisable() {
48+
System.out.println("Goodybye!");
49+
}
50+
```
51+
52+
## Creating a command!
53+
54+
To create a command we need to first understand the concept behind the Ree6 Command System.\
55+
We have a `CommandManager` which is handling all the internal works like command parameter parsing and more!\
56+
For a command we need to create a class implements the `ICommand` class and having the `Command` Annonciation.
57+
58+
Lets make a command together called `PongCommand`:
59+
60+
```java
61+
@Command(name = "ping", description = "Answer with Pong!", category = Category.FUN)
62+
public class PongCommand extends ICommand {
63+
64+
@Override
65+
public void onPerform(CommandEvent commandEvent) {
66+
}
67+
68+
@Override
69+
public CommandData getCommandData() {
70+
return null;
71+
}
72+
73+
@Override
74+
public String[] getAlias() {
75+
return new String[0];
76+
}
77+
}
78+
```
79+
80+
When creating the commands you will need to implement these 3 methods to work with them.\
81+
The `onPerform` method is where you are going to do most of the stuff.\
82+
I will give you a `CommandEvent` as parameter which will contain informations like:\
83+
84+
85+
* Has this Command been executed as SlashCommand?
86+
* Who executed this Command?
87+
* In which Guild has this Command been executed?
88+
89+
Now, lets continue with our work!\
90+
Since we want the Bot to respond with `Pong!` when someone writes `/ping` or `ree!ping`\
91+
We need to go into the `onPerform` method and respond to it!\
92+
For this we can use the internal reply method.\
93+
Just like this:
94+
95+
```java
96+
@Override
97+
public void onPerform(CommandEvent commandEvent) {
98+
commandEvent.reply("Pong!");
99+
}
100+
```
101+
102+
## Register the command.
103+
104+
Well now that we finished our great `PongCommand` we will need to register it!\
105+
106+
107+
How do we do that?\
108+
Simple, we go into our Main class into the `onEnable` method and tell the `CommandManager` to add it into the system!
109+
110+
It would look like this:
111+
112+
```java
113+
@Override
114+
public void onEnable() {
115+
System.out.println("Start!");
116+
Main.getInstance().getCommandManager().addCommand(new PongCommand());
117+
}
118+
```
119+
120+
But we shouldn't forget to also remove the Command once the Addon shutsdown!\
121+
You can do this like this:
122+
123+
```java
124+
@Override
125+
public void onDisable() {
126+
System.out.println("Goodybye!");
127+
Main.getInstance().getCommandManager().removeCommand(new PongCommand());
128+
}
129+
```
130+
131+
## The missing Addon.yml
132+
133+
To let Ree6 now where to look you will need to create a `Addon.yml`!\
134+
In this you will need to add the name of the Addon, the Author name, the path to the main class, the version of the addon, the version of Ree6 it has been made for!\
135+
For example addon it would looks like this:
136+
137+
```yaml
138+
name: Pong Command
139+
version: 1.0
140+
api-version: 2.4.11
141+
author: Presti
142+
main: de.presti.pongcommand.AddonMain
143+
```
144+
145+
## Finishing up!
146+
147+
You should be ready to go with your Addon!\
148+
Now you will need to export it either via Maven, Gradle or any desired way you have!
149+
150+
After exporting it you just need to put it into the `addons` folder of Ree6!\
151+
You can either restart Ree6 to load the addon or use the `/addon load NAME` to load it!

0 commit comments

Comments
 (0)