Kord

K

Kord

Join the community to ask questions about Kord and get answers from other members.

Join

Can't get guild members

Hello, Inside a Guild Chat Input Command, I have this code: interaction.guild.members.toList() ...

Is there a way to make kord automatically reconnect after an error?

Each time i get the error 502 in the terminal output, the bot goes offline. Is there a way to automatically make it reconnect?...

[Kotlin/Native] Slow connection issues

i'm experiencing noticeable connection issues with Kord (branch feature/native on Linux). about 90% of interactions fail, i can't even defer them to respond later. so far i couldn't upload files too, and it takes 10 seconds for a message to be sent (and retrieved afterwards). what's strange is that it always takes 10 seconds. here's the code for the last part: ```kt val (message, restLatency) = measureTimedValue { ctx.message.reply("Calculating...") // this is sent instantly though }...
No description

Is Kord meant for other api features other than bots?

For example can I use it to make discord api calls to authorize https://discord.com/oauth2/authorize Or...
Solution:
though the rest module expects you to use a bot token

Check if embed, actionRow etc. has been modified

Hello With the InteractionResponseModifyBuilder, we can define actionRow, embeds etc. However, I would like to avoid to send the same content to the API (to reduce network interaction) ...

[Kotlin/Native] Linking stage fails

I've spent days trying to figure out this issue, and it turns out that the build fails whenever I explicitly specify a Ktor engine. The Kord native build fails on linux (irrelevant of dependencies) with the following error: ```sh The /home/runner/.konan/dependencies/x86_64-unknown-linux-gnu-gcc-8.3.0-glibc-2.19-kernel-4.9-2/x86_64-unknown-linux-gnu/bin/ld.gold command returned non-zero exit code: 1. output:...

`getMember` not writing to Member cache?

I have a task that is periodically doing some checks to update some content. This goes guild by guild (in the guilds that use the feature). At some point I get the channel entity, and then I get the permissions for the bot. For this I use kordex's GuildChannel.botHasPermissions, and its first step is calling GuildBehaviour.getMember with the bot's snowflake. The problem is that this is doing a REST call every single time and therefore greatly slowing my process, not to mention the possibl rate limit implications....
No description

Cancelling the event listener job inside the event listener

Is it possible to cancel the Job returned by Kord#on inside its scope? I doubt it, but would something like this do the trick: ```kt var job: Job? = null job = kord.on<Event> { job?.cancel()...

Is Kord#getApplicationInfo() cached?

Is Kord#getApplicationInfo() backed by a cache? I'd like to check if the message author is the owner of the application.

Can't find a way to disconnect/kick someone

Hello, everyone! I have a bot made in Kord and I've used it a lot to play sounds based on VoiceState changes and timed stuff. Now I wanted to do some kind of routine to disconnect users who have been fully muted for a long time. I was able to get all active users/members/voicestates etc but I can't find a way to disconnect them from the voice channel, I searched through the docs but it seems I'm either using this lib in a wrong way (totally possible) or there's no disconnect/leave command or it has another "name". Thanks!...

Runtime Error

I don’t remember changing anything, I just started getting an error on startup. I use kord 0.15.0 and Kord-Extensions 1.9.0 ```kotlin Caused by: java.lang.NoClassDefFoundError: io/ktor/client/plugins/contentnegotiation/ContentNegotiation at dev.kord.core.builder.kord.KordBuilderUtilKt.defaultConfig(KordBuilderUtil.kt:16)...

Publish multiplatform library (not Discord bot)

Hello This is the list of supported platform of my lib: ``` iosX64()...

Support of native targets (not Discord bot)

Hello I tried to add the support of native targets (not for my discord bot), so I have: (code in comment) ...

Join voice channel

How can I make the bot join a voice channel? I couldnt find a method in VoiceChannel nor Member

Compilation error with KSP

Hello, I'm facing this particular error when compiling my project and its ksp subproject:
> Task :kspKotlinMingwX64 FAILED
e: Could not find "org.jetbrains.kotlinx:kotlinx-datetime-cinterop-date" in [C:\Users\1\Desktop\kotlin\Cordex, D:\.konan\klib, D:\.konan\kotlin-native-prebuilt-windows-x86_64-1.9.22\klib\common, D:\.konan\kotlin-native-prebuilt-windows-x86_64-1.9.22\klib\platform\mingw_x64]
> Task :kspKotlinMingwX64 FAILED
e: Could not find "org.jetbrains.kotlinx:kotlinx-datetime-cinterop-date" in [C:\Users\1\Desktop\kotlin\Cordex, D:\.konan\klib, D:\.konan\kotlin-native-prebuilt-windows-x86_64-1.9.22\klib\common, D:\.konan\kotlin-native-prebuilt-windows-x86_64-1.9.22\klib\platform\mingw_x64]
...

Running distribution inside docker container?

I built distribution and currently trying to run inside a Docker container but getting such error. Anyone knows what might be the problem? ``` glados-bot-container | Error: Could not find or load main class surik.simyan.glados.MainKt glados-bot-container | Caused by: java.lang.ClassNotFoundException: surik.simyan.glados.MainKt...

How do I add components to an interaction response?

event.interaction.respondEphemeral {
content = ""
}
event.interaction.respondEphemeral {
content = ""
}
...

kord cache method doesn't exist

error https://sourceb.in/rxnUgPpdxO gradle.build ```gradle include implementation("dev.kord:kord-core:0.14.0")...

Unknown message/webhook/interaction null

All of sudden, I started getting this error message from REST, I haven't changed anything in the code, neither in configuration. Source code of the class it occurs in is here: ```kt object ReportModal : ModalExecutor { private val REPORT_ROLE_MENTION = "<@&${dotenv["REPORT_ROLE_ID"]}>"...
Solution:
deferEphemeralMessageUpdate still works though

Avoid to re-render buttons and other things

Hello What's the best solution to avoid, during an interaction, sending to much thing that already rendered and not modified For example, if I have a embed with 2 buttons, but I modified only the embed, I would like to avoid to render button...