Skip to content

Commit

Permalink
Update PLUGINS.md (#924)
Browse files Browse the repository at this point in the history
  • Loading branch information
DRSchlaubi committed Jul 27, 2023
1 parent 30bedca commit 1bcc3df
Showing 1 changed file with 7 additions and 22 deletions.
29 changes: 7 additions & 22 deletions PLUGINS.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,35 +21,20 @@ You can add your own plugin by submitting a pull-request to this file.
## Developing your own plugin

> **Note:**
> If your plugin is developed in Kotlin make sure you are using **Kotlin v1.7.20**
> If your plugin is developed in Kotlin make sure you are using **Kotlin v1.8.22**
Follow these steps to quickly get started with plugin development:
1. Create a copy of https://github.com/lavalink-devs/lavalink-plugin-template
2. Rename the directories `org/example/plugin/` under `src/main/java/` to something more specific like
`io/github/yourusername/yourplugin`
3. Rename `src/main/resources/lavalink-plugins/your-plugin.properties` to the name of your plugin. The file must end
with `.properties`. This is the plugin manifest.
4. Fill out the name, path, and version properties in the manifest. The path is where your classes will be loaded from,
e.g. `io.github.yourusername.yourplugin`.
Follow [these steps](https://github.com/lavalink-devs/lavalink-plugin-template#how-to-use-this-template) to setup a new Lavalink plugin

Now you can start writing your plugin. You can test your plugin against Lavalink by running Gradle with the
`:run` Gradle task. The [Gradle documentation](https://docs.gradle.org/current/userguide/userguide.html) might be helpful.
`:runLavalink` Gradle task. The [Gradle plugin documentation](https://github.com/lavalink-devs/lavalink-gradle-plugin#running-the-plugin) might be helpful.

Lavalink has a [plugin API](plugin-api/src/main/java/dev/arbjerg/lavalink/api) which you can integrate with. The API is
provided as an artifact and is used by the template. It is also possible to integrate with internal parts og Lavalink,
Lavalink has a [plugin API](https://javadoc.io/doc/dev.arbjerg.lavalink/plugin-api/latest/dev/arbjerg/lavalink/api/package-summary.html) which you can integrate with. The API is
provided [as an artifact](https://central.sonatype.com/artifact/dev.arbjerg.lavalink/plugin-api) and is used by the template. It is also possible to integrate with internal parts og Lavalink,
but this is not recommended. Instead, open an issue or pull-request to change the API.

Lavalink is configured by plugins using the Spring Boot framework using Spring annotations. For instance, you could define
an extension to the WebSocket API by exposing a Spring bean like this:
Lavalink is configured by plugins using the Spring Boot framework using Spring annotations.

```java
@Service
class MyExtension implements WebSocketExtension {
// ...
}
```

You can also define custom REST endpoints and configuration file properties. See the Spring Boot documentation for
You can define custom REST endpoints and configuration file properties. See the Spring Boot documentation for
[Spring Web MVC](https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#web.servlet) and
[type-safe configuration](https://docs.spring.io/spring-boot/docs/current/reference/htmlsingle/#features.external-config.typesafe-configuration-properties).

Expand Down

0 comments on commit 1bcc3df

Please sign in to comment.