An open API service indexing awesome lists of open source software.

https://github.com/viascom/aluna-spring-boot-starter

Spring-Boot-Starter for Discord Bots based on JDA
https://github.com/viascom/aluna-spring-boot-starter

discord java jda kotlin spring-boot spring-boot-starter

Last synced: 5 months ago
JSON representation

Spring-Boot-Starter for Discord Bots based on JDA

Awesome Lists containing this project

README

          


Aluna Logo

Fast and easy way to use JDA in your Spring-Boot Project


Maven central
JDA-Version
Kotlin Version
license Apache 2.0



## Version

*These are the versions of all exposed dependencies related to the aluna-spring-boot-starter version.*

| aluna-spring-boot-starter | JDA | Spring Boot | Kotlin | Emoji Library | nanoid-kotlin |
|:--------------------------|:--------------------------------------------------------------------------:|:--------------------------------------------------------------------------:|:----------------------------------------------------------------------------:|:----------------------------------------------------------------------------------------:|:--------------------------------------------------------------------------:|
| `1.4.1-SNAPSHOT` | 6.2.1 | 3.5.6 | 2.2.20 | JEmoji 1.7.5 | 1.0.1 |
| `1.4.0` | 6.0.0 | 3.5.6 | 2.2.20 | JEmoji 1.7.5 | 1.0.1 |
| `1.3.5` | 5.6.1 | 3.5.0 | 2.1.21 | JEmoji 1.7.3 | 1.0.1 |
| `1.3.4` | 5.5.1 | 3.4.5 | 2.1.20 | JEmoji 1.7.3 | 1.0.1 |
| `1.3.3` | 5.5.0 | 3.4.5 | 2.1.20 | JEmoji 1.7.3 | 1.0.1 |
| `1.3.2` | 5.4.0 | 3.4.4 | 2.1.20 | JEmoji 1.7.3 | 1.0.1 |
| `1.3.1` | 5.3.2 | 3.4.4 | 2.1.20 | JEmoji 1.7.3 | 1.0.1 |
| `1.3.0` | 5.3.1 | 3.4.4 | 2.1.20 | JEmoji 1.7.1 | 1.0.1 |
| `1.1.10` | 5.1.2 | 3.3.4 | 2.0.20 | JEmoji 1.5.1 | 1.0.1 |
| `1.1.9` | 5.1.0 | 3.3.2 | 2.0.10 | JEmoji 1.5.1 | 1.0.1 |
| `1.1.8` | 5.0.2 | 3.3.2 | 2.0.10 | JEmoji 1.4.1 | 1.0.1 |
| `1.1.7` | 5.0.1 | 3.3.1 | 2.0.0 | JEmoji 1.4.1 | 1.0.1 |

For older versions, please have a look at the [VERSION.md](VERSION.md)

## Download

Gradle:

```gradle
dependencies {
implementation 'io.viascom.discord.bot:aluna-spring-boot-starter:1.4.0'
}
```

Maven:

```xml

io.viascom.discord.bot
aluna-spring-boot-starter
1.4.0

```

## Getting Started

### Create a command

```kotlin
@Interaction
class PingCommand : DiscordCommand("ping", "Send a ping") {
override fun execute(event: SlashCommandInteractionEvent) {
event.reply("Pong\nYour locale is:${this.userLocale}").queue()
}
}
```

### React to a Button

```kotlin
@Interaction
class PingCommand : DiscordCommand("ping", "Send a ping") {
override fun execute(event: SlashCommandInteractionEvent) {
event.reply("Pong\nYour locale is:${this.userLocale}").setComponents(ActionRow.of(primaryButton("hi", "Hi")))
.queueAndRegisterInteraction(hook, this)
}

override fun onButtonInteraction(event: ButtonInteractionEvent): Boolean {
if (event.componentId == "hi") {
event.editMessage("Oh hi :)").removeActionRows().queue()
}

return true
}
}
```

## Configuration Properties

### Basic configuration example

```yaml
aluna:
discord:
token:

logging:
level:
io.viascom.discord.bot.aluna: DEBUG
io.viascom.discord.bot.aluna.event.EventPublisher: INFO #Set to DEBUG to show all published events
io.viascom.discord.bot.aluna.bot.handler.AlunaLocalizationFunction: INFO #Set to DEBUG to show translation keys for interactions
```

## Versioning

This project is developed by [Viascom](https://github.com/viascom) using
the [Semantic Versioning specification](https://semver.org). For the versions available, see
the [releases on this repository](https://github.com/viascom/aluna-spring-boot-starter/releases).

## Authors

* **Patrick Bösch** - *Initial work* - [itsmefox](https://github.com/itsmefox)
* **Nikola Stanković** - *Initial work* - [nik-sta](https://github.com/nik-sta)

See also the list of [contributors](https://github.com/viascom/aluna-spring-boot-starter/contributors) who participated
in this project. 💕

## Contributing

See [CONTRIBUTING.md](CONTRIBUTING.md) file.

If you like aluna-spring-boot-starter you can show support by starring ⭐ this repository.

# Licence

[Apache License, Version 2.0, January 2004](http://www.apache.org/licenses/LICENSE-2.0)