Commit 7f347fee authored by Him188's avatar Him188

Deprecate openChannel

parent fa211cab
...@@ -651,6 +651,9 @@ internal abstract class QQAndroidBotBase constructor( ...@@ -651,6 +651,9 @@ internal abstract class QQAndroidBotBase constructor(
else -> error("unsupported image class: ${image::class.simpleName}") 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 { override suspend fun openChannel(image: Image): ByteReadChannel {
return MiraiPlatformUtils.Http.get<HttpResponse>(queryImageUrl(image)).content.toKotlinByteReadChannel() return MiraiPlatformUtils.Http.get<HttpResponse>(queryImageUrl(image)).content.toKotlinByteReadChannel()
} }
......
...@@ -177,6 +177,9 @@ abstract class Bot : CoroutineScope, LowLevelBotAPIAccessor, BotJavaFriendlyAPI( ...@@ -177,6 +177,9 @@ abstract class Bot : CoroutineScope, LowLevelBotAPIAccessor, BotJavaFriendlyAPI(
* @see ByteReadChannel.copyAndClose * @see ByteReadChannel.copyAndClose
* @see ByteReadChannel.copyTo * @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 @JvmSynthetic
abstract suspend fun openChannel(image: Image): ByteReadChannel abstract suspend fun openChannel(image: Image): ByteReadChannel
......
...@@ -195,6 +195,9 @@ abstract class MessagePacketBase<out TSender : QQ, out TSubject : Contact> : Pac ...@@ -195,6 +195,9 @@ abstract class MessagePacketBase<out TSender : QQ, out TSubject : Contact> : Pac
* @see ByteReadChannel.copyAndClose * @see ByteReadChannel.copyAndClose
* @see ByteReadChannel.copyTo * @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) suspend inline fun Image.channel(): ByteReadChannel = bot.openChannel(this)
// endregion // endregion
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment