Error with kordex connection with spring
I need make rest controllers for micro-services and i need connect controllers to discord bot
```> Task :prepareKotlinBuildScriptModel UP-TO-DATE
Could not resolve: org.springframework.boot:spring-boot-starter-data-jpa
Could not resolve: org.springframework.boot:spring-boot-starter-web...
Error registering slash commands
Hey, how can I fix this error?
Command:
```kotlin
import dev.kordex.core.extensions.Extension...
Solution:
also as a tip: when working with the modals returned values, use the .value function.
Message Not Public
Sign In & Join Server To View
Gradle plugin does not work
Hey, I want to try out Kordex, but if I want to apply the Gradle Plugin, I get this error:
```java
Build file '/Users/xyz/Developer/GitHub/sharkbot/build.gradle.kts' line: 2
...
Solution:
Ah, the current version of the plugin is 1.6.0
How send message to user by id?
I need send message to user/channel by it id
How i can do it? I try get guild and when get channel id, but i don`t see methods to get guild/user by id...
Solution:
kordRef
on that objectIt's that time again
It's that time where I need to make another discord bot, where can I look to get started with voice?
Get guild id from channel/event
I using ButtonInteractionCreateEvent and i need check guild id similar, event object don`t have param for guild id. How i can get it from channel?
Solution:
you'd have to cast it to a guild channel type using to
of
or ofOrNull
functionsWhy event called twice when i send message?
I linked without send message, called once
Solution:
You get that event both when the thread is created and when the bot is added to the thread https://discord.com/developers/docs/events/gateway-events#thread-create
Channel change perms
Which method is responsible for issuing access to the channel? I need that when creating a thread (on a forum), only the owner and the administration can write there.
Solution:
You can use
channel.edit
to modify the permission overridesHow send modal respond when modal window sended?
I need send text when user send modal window
Solution:
result.createEphemeralFollowup {
content = "Заявка успешно отправлена."
}?...
Error with rewrite server logic
Again...
When i start discord bot it overwrite minecraft logic :hvh:...
Solution:
I ran the bot in a separate thread and it worked :hvh:
I18n is from default?
It take a key from i18n, but i have only ru ppl
Solution:
you can get one from a string using
.toKey()
if you really need toWhat event was called when bot started?
I can`t found it(
Solution:
then listen for the
ButtonInteractionCreateEvent
How i can start kordex on 21 jdk?
I need add a discord bot to my Minecraft plugin for version 1.21.1.
Minecraft plugin need 21 jdk, but kordex 13...
Solution:
heyo, you can solve that as explained in the FAQ here: https://discord.com/channels/1121419906995458098/1121523729734840350/1302560008671858709
basically just add the
jvmTarget
property to the kordEx
builder
```kotlin...Build fails with SocketException when adding module("data-mongodb")
Uncaught exception from fetching Maven metadata?
Can I load a .env file for a module instead of the whole project?
There are some utils for loading .env files, can this support the above?
Or do I need to use my own solution here....
Solution:
I see what you mean, I'll change the working directory in the IDEA run configuration
Production instance's caching behaving very differently
So this one is a very odd one for me. I have different parts of my code where caching works fine on my test bot (5 servers) vs my production bot (16k servers).
One example is this command where I'm using
guild.getMemberOrNull
to display a list of users (IDs coming from my DB) into strings with their usernames. The problem is that it takes a long time to resolve the response. I would understand if it took long to resolve once, and then subsequent calls didn't, because they are supposed to be cached (EntitySupplyStrategy.cacheWithCachingRestFallback
), but every time, it takes a long time. We have tried to switching strategies for this particular command, like using cache only, and it would result in a lot of users just not being found.
Now, recently, I added some channel permission checks to some task I have. And I noticed that since then, the task is taking a long time to complete. Upon checking my logs, I see a bunch of requests to https://discord.com/api/v10/guilds/<guildId>/members/<myBotId>
, sometimes even making two calls within the same second (there is another permission check further down the task's execution)...Solution:
How long do user commands take to register?
How long do user commands take to register?
Solution:
Well that's message commands
ephemeralStringSelectMenu option values
I'm trying to get the value of a selected option in the
ephemeralStringSelectMenu
from the components builder in the action
. is this possible using conventional means? if not, what should be done instead?
for reference, I'm trying to dynamically get something from my database with the value from the string select menu, which does not have static options and is also dynamically made...Solution:
oh it's
selected
how does defaultGuild interact with user apps?
I can't seem to test user commands with defaultGuild being set, is there a workaround for this?