Skip to content

Commit

Permalink
Imports, formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
lukellmann committed Sep 12, 2024
1 parent a08068b commit 10834bf
Show file tree
Hide file tree
Showing 10 changed files with 7 additions and 13 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ mapping of the Voice API on Kotlin/JVM
| [core-voice](core-voice) | [core-voice](https://kordlib.github.io/kord/core-voice) | `kord-core-voice`¹ ||| ✅² |

¹ These artifacts only supports Gradle Version 5.3 or higher, for older Gradle versions and Maven please append `-jvm`
² Currently not on Windows(MinGW) targets, see #69
² Currently not on Windows(MinGW) targets, see #69

## Installation

Expand Down
1 change: 1 addition & 0 deletions gradle/libs.versions.toml
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ buildconfig = "5.4.0" # https://github.com/gmazzo/gradle-buildconfig-plugin
kord-gradle-tools = "1.6.2" # https://github.com/kordlib/gradle-tools/blob/main/build.gradle.kts#L10
maven-publish-plugin = "0.29.0" # https://github.com/vanniktech/gradle-maven-publish-plugin


[libraries]

# cache
Expand Down
2 changes: 0 additions & 2 deletions rest/src/commonTest/kotlin/request/MessageRequests.kt
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,9 @@ import dev.kord.common.entity.optional.Optional
import dev.kord.rest.json.readFile
import dev.kord.rest.service.ChannelService
import dev.kord.test.IgnoreOnSimulatorPlatforms
import dev.kord.test.Platform
import io.ktor.client.*
import io.ktor.client.engine.mock.*
import io.ktor.client.request.forms.*
import io.ktor.utils.io.*
import kotlinx.coroutines.test.runTest
import kotlinx.datetime.Clock
import kotlinx.serialization.encodeToString
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ suspend fun main(args: Array<String>) {
gateway.events.filterIsInstance<MessageCreate>().onEach {
val words = it.message.content.split(' ')
when (words.firstOrNull()) {
"!close" -> gateway.stop()
"!close" -> gateway.stop()
"!detach" -> gateway.detach()
"!status" -> when (words.getOrNull(1)) {
"playing" -> gateway.editPresence {
Expand All @@ -29,7 +29,7 @@ suspend fun main(args: Array<String>) {
}
}

"!ping" -> gateway.editPresence {
"!ping" -> gateway.editPresence {
status = PresenceStatus.Online
afk = false
listening("a ${gateway.ping.value?.inWholeMilliseconds} ms ping")
Expand Down
4 changes: 1 addition & 3 deletions samples/src/jvmMain/kotlin/runMain.jvm.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,6 @@
import kotlinx.coroutines.CoroutineScope
import kotlinx.coroutines.GlobalScope
import kotlinx.coroutines.launch
import kotlinx.coroutines.runBlocking

actual fun runMain(block: suspend CoroutineScope.() -> Unit) {
runBlocking { block() }
}
}
1 change: 0 additions & 1 deletion voice/src/commonMain/kotlin/udp/DefaultAudioFrameSender.kt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import dev.kord.voice.AudioProvider
import dev.kord.voice.FrameInterceptor
import dev.kord.voice.encryption.strategies.NonceStrategy
import io.github.oshai.kotlinlogging.KotlinLogging
import io.ktor.utils.io.core.*
import kotlinx.coroutines.channels.Channel
import kotlinx.coroutines.coroutineScope
import kotlinx.coroutines.flow.*
Expand Down
3 changes: 1 addition & 2 deletions voice/src/commonMain/kotlin/udp/ipDiscovery.kt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,6 @@ package dev.kord.voice.udp
import dev.kord.voice.io.mutableCursor
import dev.kord.voice.io.view
import io.github.oshai.kotlinlogging.KotlinLogging
import io.ktor.utils.io.core.*
import kotlinx.io.readByteArray
import kotlinx.io.readUShort

Expand Down Expand Up @@ -39,4 +38,4 @@ public suspend fun VoiceUdpSocket.discoverIP(address: SocketAddress, ssrc: Int):

SocketAddress(ip, port)
}
}
}
1 change: 0 additions & 1 deletion voice/src/jsMain/kotlin/udp/VoiceUdpSocket.js.kt
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package dev.kord.voice.udp

import dev.kord.common.annotation.KordVoice
import dev.kord.voice.io.ByteArrayView
import io.ktor.utils.io.core.*
import js.typedarrays.toUint8Array
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@ import com.iwebpp.crypto.TweetNaclFast.SecretBox.boxzerobytesLength
import com.iwebpp.crypto.TweetNaclFast.SecretBox.zerobytesLength
import dev.kord.voice.io.MutableByteArrayCursor


// https://datatracker.ietf.org/doc/html/rfc6716#section-3.2.1
private const val OPUS_MAX_LENGTH = 1276

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
@file:JvmName("DefaultStreamsJvm")

package dev.kord.voice.streams

import com.iwebpp.crypto.TweetNaclFast
Expand Down

0 comments on commit 10834bf

Please sign in to comment.