work on the translation stuff in kordex that is required as of version 2.3
This commit is contained in:
parent
e36e5a2586
commit
1800f44941
2
.idea/kotlinc.xml
generated
2
.idea/kotlinc.xml
generated
@ -1,6 +1,6 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<project version="4">
|
<project version="4">
|
||||||
<component name="KotlinJpsPluginSettings">
|
<component name="KotlinJpsPluginSettings">
|
||||||
<option name="version" value="2.0.20" />
|
<option name="version" value="2.0.21" />
|
||||||
</component>
|
</component>
|
||||||
</project>
|
</project>
|
@ -32,8 +32,7 @@ dependencies {
|
|||||||
}
|
}
|
||||||
|
|
||||||
kordEx {
|
kordEx {
|
||||||
kordExVersion = "2.2.1-SNAPSHOT"
|
kordExVersion = "2.3.1-SNAPSHOT"
|
||||||
kordVersion = "0.16.0-SNAPSHOT"
|
|
||||||
jvmTarget = 21
|
jvmTarget = 21
|
||||||
|
|
||||||
bot {
|
bot {
|
||||||
@ -42,6 +41,11 @@ kordEx {
|
|||||||
|
|
||||||
mainClass = "dev.jansel.feixiao.AppKt"
|
mainClass = "dev.jansel.feixiao.AppKt"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
i18n {
|
||||||
|
classPackage = "dev.jansel.feixiao.i18n"
|
||||||
|
translationBundle = "feixiao.strings"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Automatically generate a Dockerfile. Set `generateOnBuild` to `false` if you'd prefer to manually run the
|
// Automatically generate a Dockerfile. Set `generateOnBuild` to `false` if you'd prefer to manually run the
|
||||||
@ -85,6 +89,6 @@ docker {
|
|||||||
}
|
}
|
||||||
|
|
||||||
tasks.wrapper {
|
tasks.wrapper {
|
||||||
gradleVersion = "8.10.2"
|
gradleVersion = "8.11.1"
|
||||||
distributionType = Wrapper.DistributionType.BIN
|
distributionType = Wrapper.DistributionType.BIN
|
||||||
}
|
}
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
[versions]
|
[versions]
|
||||||
kotlin = "2.0.20" # Note: Plugin versions must be updated in the settings.gradle.kts too
|
kotlin = "2.0.21" # Note: Plugin versions must be updated in the settings.gradle.kts too
|
||||||
|
|
||||||
groovy = "3.0.22"
|
groovy = "3.0.22"
|
||||||
jansi = "2.4.1"
|
jansi = "2.4.1"
|
||||||
|
@ -1,14 +1,20 @@
|
|||||||
pluginManagement {
|
pluginManagement {
|
||||||
plugins {
|
plugins {
|
||||||
// Update this in libs.version.toml when you change it here.
|
// Update this in libs.version.toml when you change it here.
|
||||||
kotlin("jvm") version "2.0.20"
|
kotlin("jvm") version "2.0.21"
|
||||||
kotlin("plugin.serialization") version "2.0.20"
|
kotlin("plugin.serialization") version "2.0.21"
|
||||||
|
|
||||||
id("com.github.jakemarsden.git-hooks") version "0.0.2"
|
|
||||||
id("com.github.johnrengelman.shadow") version "8.1.1"
|
id("com.github.johnrengelman.shadow") version "8.1.1"
|
||||||
|
|
||||||
id("dev.kordex.gradle.docker") version "1.4.2"
|
id("dev.kordex.gradle.docker") version "1.5.8"
|
||||||
id("dev.kordex.gradle.kordex") version "1.4.2"
|
id("dev.kordex.gradle.kordex") version "1.5.8"
|
||||||
|
}
|
||||||
|
repositories {
|
||||||
|
gradlePluginPortal()
|
||||||
|
mavenCentral()
|
||||||
|
|
||||||
|
maven("https://snapshots-repo.kordex.dev")
|
||||||
|
maven("https://releases-repo.kordex.dev")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -13,6 +13,7 @@ import dev.jansel.feixiao.extensions.StreamerCommand
|
|||||||
import dev.jansel.feixiao.utils.*
|
import dev.jansel.feixiao.utils.*
|
||||||
import dev.kord.core.entity.channel.GuildMessageChannel
|
import dev.kord.core.entity.channel.GuildMessageChannel
|
||||||
import dev.kordex.core.ExtensibleBot
|
import dev.kordex.core.ExtensibleBot
|
||||||
|
import dev.kordex.core.i18n.SupportedLocales
|
||||||
import io.github.oshai.kotlinlogging.KotlinLogging
|
import io.github.oshai.kotlinlogging.KotlinLogging
|
||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
import kotlinx.coroutines.runBlocking
|
import kotlinx.coroutines.runBlocking
|
||||||
@ -27,6 +28,9 @@ suspend fun main() {
|
|||||||
add(::EventHooks)
|
add(::EventHooks)
|
||||||
add(::StreamerCommand)
|
add(::StreamerCommand)
|
||||||
}
|
}
|
||||||
|
i18n {
|
||||||
|
applicationCommandLocale(SupportedLocales.ENGLISH, SupportedLocales.GERMAN)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
twitchClient = TwitchClientBuilder.builder()
|
twitchClient = TwitchClientBuilder.builder()
|
||||||
.withEnableHelix(true)
|
.withEnableHelix(true)
|
||||||
|
@ -1,6 +1,7 @@
|
|||||||
package dev.jansel.feixiao.extensions
|
package dev.jansel.feixiao.extensions
|
||||||
|
|
||||||
import dev.jansel.feixiao.database.collections.StreamerCollection
|
import dev.jansel.feixiao.database.collections.StreamerCollection
|
||||||
|
import dev.jansel.feixiao.i18n.Translations
|
||||||
import dev.jansel.feixiao.twitchClient
|
import dev.jansel.feixiao.twitchClient
|
||||||
import dev.kord.common.entity.Permission
|
import dev.kord.common.entity.Permission
|
||||||
import dev.kordex.core.checks.anyGuild
|
import dev.kordex.core.checks.anyGuild
|
||||||
@ -18,12 +19,12 @@ class StreamerCommand : Extension() {
|
|||||||
override val name = "streaming"
|
override val name = "streaming"
|
||||||
override suspend fun setup() {
|
override suspend fun setup() {
|
||||||
publicSlashCommand {
|
publicSlashCommand {
|
||||||
name = "streamer"
|
name = Translations.Streamer.Command.name
|
||||||
description = "Streamer commands"
|
description = Translations.Streamer.Command.description
|
||||||
|
|
||||||
publicSubCommand(::AddStreamerArgs) {
|
publicSubCommand(::AddStreamerArgs) {
|
||||||
name = "add"
|
name = Translations.Streamer.Command.Add.name
|
||||||
description = "Add a streamer to the listener of this server"
|
description = Translations.Streamer.Command.Add.description
|
||||||
check {
|
check {
|
||||||
anyGuild()
|
anyGuild()
|
||||||
hasPermission(Permission.ManageGuild)
|
hasPermission(Permission.ManageGuild)
|
||||||
@ -39,8 +40,8 @@ class StreamerCommand : Extension() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
publicSubCommand(::RemoveStreamerArgs) {
|
publicSubCommand(::RemoveStreamerArgs) {
|
||||||
name = "remove"
|
name = Translations.Streamer.Command.Remove.name
|
||||||
description = "Remove a streamer from the listener of this server"
|
description = Translations.Streamer.Command.Remove.description
|
||||||
check {
|
check {
|
||||||
anyGuild()
|
anyGuild()
|
||||||
hasPermission(Permission.ManageGuild)
|
hasPermission(Permission.ManageGuild)
|
||||||
@ -58,29 +59,29 @@ class StreamerCommand : Extension() {
|
|||||||
|
|
||||||
inner class AddStreamerArgs : Arguments() {
|
inner class AddStreamerArgs : Arguments() {
|
||||||
val streamer by string {
|
val streamer by string {
|
||||||
name = "streamer"
|
name = Translations.Streamer.Command.Arguments.Add.Streamer.name
|
||||||
description = "The streamer to add"
|
description = Translations.Streamer.Command.Arguments.Add.Streamer.description
|
||||||
require(true)
|
require(true)
|
||||||
}
|
}
|
||||||
val channel by channel {
|
val channel by channel {
|
||||||
name = "announcechannel"
|
name = Translations.Streamer.Command.Arguments.Add.Channel.name
|
||||||
description = "Channel where the bot will send a message when the streamer goes live"
|
description = Translations.Streamer.Command.Arguments.Add.Channel.description
|
||||||
require(true)
|
require(true)
|
||||||
}
|
}
|
||||||
val role by optionalRole {
|
val role by optionalRole {
|
||||||
name = "role"
|
name = Translations.Streamer.Command.Arguments.Add.Role.name
|
||||||
description = "Role to ping when the streamer goes live"
|
description = Translations.Streamer.Command.Arguments.Add.Role.description
|
||||||
}
|
}
|
||||||
val message by optionalString {
|
val message by optionalString {
|
||||||
name = "message"
|
name = Translations.Streamer.Command.Arguments.Add.Message.name
|
||||||
description = "Possible placeholders (put in curly braces!!): url, name, title, category, role (if set)"
|
description = Translations.Streamer.Command.Arguments.Add.Message.description
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
inner class RemoveStreamerArgs : Arguments() {
|
inner class RemoveStreamerArgs : Arguments() {
|
||||||
val streamer by string {
|
val streamer by string {
|
||||||
name = "streamer"
|
name = Translations.Streamer.Command.Arguments.Remove.name
|
||||||
description = "The streamer to remove"
|
description = Translations.Streamer.Command.Arguments.Remove.description
|
||||||
require(true)
|
require(true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
16
src/main/resources/translations/feixiao/strings.properties
Normal file
16
src/main/resources/translations/feixiao/strings.properties
Normal file
@ -0,0 +1,16 @@
|
|||||||
|
streamer.command.name=streamer
|
||||||
|
streamer.command.description=A bundle of Streamer commands
|
||||||
|
streamer.command.add.name=add
|
||||||
|
streamer.command.add.description=Add a new streamer to the listener
|
||||||
|
streamer.command.remove.name=remove
|
||||||
|
streamer.command.remove.description=Remove a streamer from the listener
|
||||||
|
streamer.command.arguments.add.streamer.name=streamer
|
||||||
|
streamer.command.arguments.add.streamer.description=The streamer to add
|
||||||
|
streamer.command.arguments.add.channel.name=channel
|
||||||
|
streamer.command.arguments.add.channel.description=The channel to add the streamer to
|
||||||
|
streamer.command.arguments.add.role.name=role
|
||||||
|
streamer.command.arguments.add.role.description=The role to assign to the streamer
|
||||||
|
streamer.command.arguments.add.message.name=message
|
||||||
|
streamer.command.arguments.add.message.description=Custom Announce message. Placeholders (in curly braces): url, name, title, category, role (if set)
|
||||||
|
streamer.command.arguments.remove.name=streamer
|
||||||
|
streamer.command.arguments.remove.description=The streamer to remove
|
Loading…
x
Reference in New Issue
Block a user