Rename uploadGroupVoice to uploadVoice

This commit is contained in:
Him188 2020-08-18 09:01:45 +08:00
parent 80debd962a
commit 370e139221
2 changed files with 11 additions and 5 deletions

View File

@ -12,7 +12,9 @@
package net.mamoe.mirai.qqandroid.contact
import kotlinx.coroutines.*
import kotlinx.coroutines.Job
import kotlinx.coroutines.SupervisorJob
import kotlinx.coroutines.launch
import kotlinx.io.core.Closeable
import net.mamoe.mirai.LowLevelAPI
import net.mamoe.mirai.contact.*
@ -373,8 +375,10 @@ internal class GroupImpl(
source.ensureSequenceIdAvailable()
} catch (e: Exception) {
bot.network.logger.warning {
"Timeout awaiting sequenceId for group message(${message.contentToString()
.take(10)}). Some features may not work properly"
"Timeout awaiting sequenceId for group message(${
message.contentToString()
.take(10)
}). Some features may not work properly"
}
bot.network.logger.warning(e)
}
@ -453,7 +457,8 @@ internal class GroupImpl(
*/
@JvmSynthetic
@MiraiExperimentalAPI
override suspend fun uploadGroupVoice(input: InputStream): Voice {
@SinceMirai("1.2.0")
override suspend fun uploadVoice(input: InputStream): Voice {
val content = ByteArray(input.available())
input.read(content)
if (content.size > 1048576) {

View File

@ -182,7 +182,8 @@ public abstract class Group : Contact(), CoroutineScope {
*/
@JvmSynthetic
@MiraiExperimentalAPI
public abstract suspend fun uploadGroupVoice(input: InputStream): Voice
@SinceMirai("1.2.0")
public abstract suspend fun uploadVoice(input: InputStream): Voice
public companion object {