feat: add guild Id
All checks were successful
Release / release (push) Successful in 1m58s

This commit is contained in:
lucasdpt
2025-12-17 11:40:46 +01:00
parent 7c74bd153e
commit eddd857a20
2 changed files with 11 additions and 3 deletions

View File

@@ -10,4 +10,5 @@ class JdaConfiguration {
var onlineStatus: OnlineStatus = OnlineStatus.ONLINE
var cacheFlags: Set<CacheFlag> = emptySet()
var activity: String? = null
var guildId: String? = null
}

View File

@@ -55,9 +55,16 @@ class JdaService(
val commandDataList = contextCommands.map { it.toCommandData() }
jda.updateCommands()
.addCommands(commandDataList)
.queue()
if (jdaConfiguration.guildId != null) {
jda.getGuildById(jdaConfiguration.guildId!!)
?.updateCommands()
?.addCommands(commandDataList)
?.queue()
} else {
jda.updateCommands()
.addCommands(commandDataList)
.queue()
}
}
@EventListener(SlashCommandInteractionEvent::class)