Skip to content

Commit

Permalink
Fix breaking changes from Kord Kotlin/JS support (#211)
Browse files Browse the repository at this point in the history
  • Loading branch information
lukellmann authored Apr 5, 2023
1 parent d5488a7 commit 1c28327
Show file tree
Hide file tree
Showing 10 changed files with 14 additions and 9 deletions.
6 changes: 1 addition & 5 deletions kord-extensions/build.gradle.kts
Original file line number Diff line number Diff line change
Expand Up @@ -27,11 +27,7 @@ dependencies {
api(libs.koin.core)
api(libs.koin.logger)

api(libs.kord) {
capabilities {
requireCapability(libs.kord.voice.get().toString())
}
}
api(libs.kord)

api(libs.logging) // Basic logging setup
api(libs.kx.ser)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ import com.kotlindiscord.kord.extensions.utils.getKoin
import com.kotlindiscord.kord.extensions.utils.loadModule
import dev.kord.cache.api.DataCache
import dev.kord.common.Color
import dev.kord.common.asJavaLocale
import dev.kord.common.entity.PresenceStatus
import dev.kord.common.entity.Snowflake
import dev.kord.core.ClientResources
Expand All @@ -40,6 +41,7 @@ import dev.kord.core.behavior.UserBehavior
import dev.kord.core.behavior.channel.ChannelBehavior
import dev.kord.core.builder.kord.KordBuilder
import dev.kord.core.cache.KordCacheBuilder
import dev.kord.core.cache.lruCache
import dev.kord.core.entity.interaction.Interaction
import dev.kord.core.event.message.MessageCreateEvent
import dev.kord.core.supplier.EntitySupplier
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import com.kotlindiscord.kord.extensions.extensions.Extension
import com.kotlindiscord.kord.extensions.koin.KordExKoinComponent
import com.kotlindiscord.kord.extensions.utils.MutableStringKeyedMap
import com.kotlindiscord.kord.extensions.utils.getLocale
import dev.kord.common.asJavaLocale
import dev.kord.common.entity.ApplicationCommandType
import dev.kord.common.entity.Permission
import dev.kord.common.entity.Permissions
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,7 @@ import com.kotlindiscord.kord.extensions.i18n.TranslationsProvider
import com.kotlindiscord.kord.extensions.koin.KordExKoinComponent
import dev.kord.common.annotation.KordExperimental
import dev.kord.common.annotation.KordUnsafe
import dev.kord.common.asJavaLocale
import dev.kord.common.entity.ApplicationCommandType
import dev.kord.common.entity.Choice
import dev.kord.common.entity.Snowflake
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ import dev.kord.common.entity.ChannelType
import java.util.*

/** Given a [ChannelType], return a string representing its translation key. **/
@Suppress("DEPRECATION_ERROR")
public fun ChannelType.toTranslationKey(): String = when (this) {
ChannelType.DM -> "channelType.dm"
ChannelType.GroupDM -> "channelType.groupDm"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public fun Permission.toTranslationKey(): String? = when (this) {
Permission.EmbedLinks -> "permission.embedLinks"
Permission.KickMembers -> "permission.kickMembers"
Permission.ManageChannels -> "permission.manageChannels"
Permission.ManageEmojisAndStickers -> "permission.manageEmojisAndStickers"
Permission.ManageGuildExpressions, Permission.ManageEmojisAndStickers -> "permission.manageEmojisAndStickers"
Permission.ManageEvents -> "permission.manageEvents"
Permission.ManageGuild -> "permission.manageGuild"
Permission.ManageMessages -> "permission.manageMessages"
Expand Down Expand Up @@ -57,6 +57,8 @@ public fun Permission.toTranslationKey(): String? = when (this) {

Permission.UseExternalStickers -> "permission.useExternalStickers"
Permission.UseEmbeddedActivities -> "permission.useEmbeddedActivities"
Permission.ViewCreatorMonetizationAnalytics -> "permission.viewCreatorMonetizationAnalytics"
Permission.UseSoundboard -> "permission.useSoundboard"

is Permission.Unknown -> null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,9 +205,11 @@ permission.useApplicationCommands=Use Application Commands
permission.useEmbeddedActivities=Use Activities
permission.useExternalEmojis=Use External Emojis
permission.useExternalStickers=Use External Stickers
permission.useSoundboard=Use Soundboard
permission.useVAD=Use Voice Activity
permission.viewAuditLog=View Audit Log
permission.viewChannel=View Channel
permission.viewCreatorMonetizationAnalytics=View Creator Monetization Analytics
permission.viewGuildInsights=View Server Insights
utils.message.useThisChannel=Please use {0} for this command.
utils.message.commandNotAvailableInDm=This command is not available via private message.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -198,9 +198,11 @@ permission.useApplicationCommands=Use Application Commands
permission.useEmbeddedActivities=Use Activities
permission.useExternalEmojis=Use External Emojis
permission.useExternalStickers=Use External Stickers
permission.useSoundboard=Use Soundboard
permission.useVAD=Use Voice Activity
permission.viewAuditLog=View Audit Log
permission.viewChannel=View Channel
permission.viewCreatorMonetizationAnalytics=View Creator Monetization Analytics
permission.viewGuildInsights=View Server Insights
utils.message.useThisChannel=Please use {0} for this command.
utils.message.commandNotAvailableInDm=This command is not available via private message.
Expand Down
3 changes: 1 addition & 2 deletions libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,7 @@ koin-test = { module = "io.insert-koin:koin-test", version.ref = "koin" }
konf-core = { module = "com.uchuhimo:konf", version.ref = "konf" }
konf-toml = { module = "com.uchuhimo:konf-toml", version.ref = "konf" }

kord = { module = "dev.kord:kord-core", version.ref = "kord" }
kord-voice = { module = "dev.kord:core-voice", version.ref = "kord" }
kord = { module = "dev.kord:kord-core-voice", version.ref = "kord" }

kotlinpoet = { module = "com.squareup:kotlinpoet", version.ref = "kotlinpoet" }
kotlin-stdlib = { module = "org.jetbrains.kotlin:kotlin-stdlib-jdk8" }
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ import com.kotlindiscord.kord.extensions.extensions.Extension
import com.kotlindiscord.kord.extensions.extensions.ephemeralSlashCommand
import com.kotlindiscord.kord.extensions.extensions.publicSlashCommand
import com.kotlindiscord.kord.extensions.types.respond
import dev.kord.common.asJavaLocale
import dev.kord.core.behavior.interaction.suggestString
import dev.kord.core.event.interaction.ChatInputCommandInteractionCreateEvent

Expand Down

0 comments on commit 1c28327

Please sign in to comment.