This commit is contained in:
@@ -10,4 +10,5 @@ class JdaConfiguration {
|
|||||||
var onlineStatus: OnlineStatus = OnlineStatus.ONLINE
|
var onlineStatus: OnlineStatus = OnlineStatus.ONLINE
|
||||||
var cacheFlags: Set<CacheFlag> = emptySet()
|
var cacheFlags: Set<CacheFlag> = emptySet()
|
||||||
var activity: String? = null
|
var activity: String? = null
|
||||||
|
var guildId: String? = null
|
||||||
}
|
}
|
||||||
@@ -55,9 +55,16 @@ class JdaService(
|
|||||||
|
|
||||||
val commandDataList = contextCommands.map { it.toCommandData() }
|
val commandDataList = contextCommands.map { it.toCommandData() }
|
||||||
|
|
||||||
jda.updateCommands()
|
if (jdaConfiguration.guildId != null) {
|
||||||
.addCommands(commandDataList)
|
jda.getGuildById(jdaConfiguration.guildId!!)
|
||||||
.queue()
|
?.updateCommands()
|
||||||
|
?.addCommands(commandDataList)
|
||||||
|
?.queue()
|
||||||
|
} else {
|
||||||
|
jda.updateCommands()
|
||||||
|
.addCommands(commandDataList)
|
||||||
|
.queue()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@EventListener(SlashCommandInteractionEvent::class)
|
@EventListener(SlashCommandInteractionEvent::class)
|
||||||
|
|||||||
Reference in New Issue
Block a user