Skip to content

viascom/aluna-spring-boot-starter

Repository files navigation

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.1.5 5.0.0-beta.24 3.2.5 1.9.24 JEmoji 1.4.0 1.0.1
1.1.4 5.0.0-beta.23 3.2.5 1.9.23 JEmoji 1.4.0 1.0.1
1.1.3 5.0.0-beta.21 3.2.3 1.9.23 JEmoji 1.4.0 1.0.1
1.1.2 5.0.0-beta.19 3.2.1 1.9.22 emoji-java 5.1.1 1.0.0

For older versions, please have a look at the VERSION.md

Download

Gradle:

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

Maven:

<dependency>
    <groupId>io.viascom.discord.bot</groupId>
    <artifactId>aluna-spring-boot-starter</artifactId>
    <version>1.1.5</version>
</dependency>

Getting Started

Create a command

@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

@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

aluna:
  discord:
    token: <insert your token here>

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 using the Semantic Versioning specification. For the versions available, see the releases on this repository.

Authors

  • Patrick Bösch - Initial work - itsmefox
  • Nikola Stanković - Initial work - nik-sta

See also the list of contributors who participated in this project. 💕

Contributing

See 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