mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-20 15:24:45 +08:00
Deprecate openChannel
This commit is contained in:
parent
fa211cab5c
commit
7f347feedd
@ -651,6 +651,9 @@ internal abstract class QQAndroidBotBase constructor(
|
||||
else -> error("unsupported image class: ${image::class.simpleName}")
|
||||
}
|
||||
|
||||
@Suppress("DeprecatedCallableAddReplaceWith")
|
||||
@PlannedRemoval("1.0.0")
|
||||
@Deprecated("use your own Http clients, this is going to be removed in 1.0.0", level = DeprecationLevel.WARNING)
|
||||
override suspend fun openChannel(image: Image): ByteReadChannel {
|
||||
return MiraiPlatformUtils.Http.get<HttpResponse>(queryImageUrl(image)).content.toKotlinByteReadChannel()
|
||||
}
|
||||
|
@ -177,6 +177,9 @@ abstract class Bot : CoroutineScope, LowLevelBotAPIAccessor, BotJavaFriendlyAPI(
|
||||
* @see ByteReadChannel.copyAndClose
|
||||
* @see ByteReadChannel.copyTo
|
||||
*/
|
||||
@PlannedRemoval("1.0.0")
|
||||
@Deprecated("use your own Http clients, this is going to be removed in 1.0.0", level = DeprecationLevel.WARNING)
|
||||
@MiraiExperimentalAPI
|
||||
@JvmSynthetic
|
||||
abstract suspend fun openChannel(image: Image): ByteReadChannel
|
||||
|
||||
|
@ -195,6 +195,9 @@ abstract class MessagePacketBase<out TSender : QQ, out TSubject : Contact> : Pac
|
||||
* @see ByteReadChannel.copyAndClose
|
||||
* @see ByteReadChannel.copyTo
|
||||
*/
|
||||
@Suppress("DeprecatedCallableAddReplaceWith", "DEPRECATION")
|
||||
@PlannedRemoval("1.0.0")
|
||||
@Deprecated("use your own Http clients, this is going to be removed in 1.0.0", level = DeprecationLevel.WARNING)
|
||||
suspend inline fun Image.channel(): ByteReadChannel = bot.openChannel(this)
|
||||
// endregion
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user