Kord-Extensions / kord-extensions

Kord extensions framework, providing commands and distinct units of functionality
https://kordex.dev
European Union Public License 1.2
112 stars 27 forks source link

paginator gives wrong error message when no pages are added #168

Closed mooziii closed 2 years ago

mooziii commented 2 years ago

Description

Whenever I try to create a paginator without a page I get an exception saying No such group: tags but it should be `Empty paginators aren't allowed' or something similar

What were you doing when you first noticed the problem?

➜ I tried to send a paginator as command interaction response without any page in it

How does the problem affect your use-case?

➜ It gave me the wrong error

Versions

Dependencies

    implementation("com.sedmelluq:lavaplayer:1.3.78")
    implementation("dev.kord:kord-core:0.8.0-M15") {
        capabilities {
            requireCapability("dev.kord:core-voice:0.8.0-M14")
        }
    }
    implementation("com.kotlindiscord.kord.extensions:kord-extensions:1.5.5-SNAPSHOT") {
        exclude("dev.kord")
    }
    implementation("com.kotlindiscord.kord.extensions:unsafe:1.5.5-SNAPSHOT")
    implementation("com.kotlindiscord.kord.extensions:extra-mappings:1.5.5-SNAPSHOT")

Editor name and version

➜ IntelliJ IDEA Ultimate 2022.1.4

Gradle version

➜ Gradle 7.4.2

JDK distribution, version and architecture

➜ OpenJDK Temurin-17+35 (build17+35)

Kotlin distribution and plugin version

➜ Kotlin JVM 1.7.10

Code Examples

image This code doesn't add a page because pagesNeeded is zero

This gives me the error No such group: tags although it should be something other

boring-cyborg[bot] commented 2 years ago

Hello, and thanks for opening an issue! As this is the first time you've created an issue on this repository, we'd just like to offer you a warm welcome to the project, and the following pointers:

gdude2002 commented 2 years ago

This has been fixed in https://github.com/Kord-Extensions/kord-extensions/commit/1d683d2ce46bc8d1e948964ae66582696d280b7d - please note that I've also pushed a dependency on the Kord Voice capability in https://github.com/Kord-Extensions/kord-extensions/commit/f78b64d54f882c835a822a8b56671125d2b3a1ac, so you should remove your explicit dependency on Kord (and the voice capability) entirely.