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.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

Download

Gradle:

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

Maven:

<dependency>
    <groupId>io.viascom.discord.bot</groupId>
    <artifactId>aluna-spring-boot-starter</artifactId>
    <version>1.1.10</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