Commit e52c3411 authored by Him188's avatar Him188

Arise deprecation level

parent f5165f7d
......@@ -462,14 +462,14 @@ open class MessageSubscribersBuilder<M : MessageEvent, out Ret, R : RR, RR>(
/** 启动这个监听器, 在满足条件时回复原消息 */
@PlannedRemoval("1.2.0")
@Deprecated("use reply instead", ReplaceWith("this.reply(message)"))
@Deprecated("use reply instead", ReplaceWith("this.reply(message)"), level = DeprecationLevel.ERROR)
@JvmName("reply3")
@MessageDsl
open infix fun ListeningFilter.`->`(toReply: String): Ret = this.reply(toReply)
/** 启动这个监听器, 在满足条件时回复原消息 */
@PlannedRemoval("1.2.0")
@Deprecated("use reply instead", ReplaceWith("this.reply(message)"))
@Deprecated("use reply instead", ReplaceWith("this.reply(message)"), level = DeprecationLevel.ERROR)
@JvmName("reply3")
@MessageDsl
open infix fun ListeningFilter.`->`(message: Message): Ret = this.reply(message)
......
......@@ -47,14 +47,6 @@ import kotlin.jvm.JvmName
//
//
@PlannedRemoval("1.1.0")
@Deprecated(
"use AbstractEvent and implement CancellableEvent",
level = DeprecationLevel.ERROR,
replaceWith = ReplaceWith("AbstractEvent", "net.mamoe.mirai.event.AbstractEvent")
)
abstract class AbstractCancellableEvent : AbstractEvent(), CancellableEvent
@PlannedRemoval("1.3.0")
@Suppress("DeprecatedCallableAddReplaceWith")
......
......@@ -80,7 +80,7 @@ interface MessageChain : Message, List<SingleMessage>, RandomAccess {
* @see MessageChain.getOrFail 在找不到此类型的元素时抛出 [NoSuchElementException]
*/
@JvmName("first")
final operator fun <M : Message> get(key: Message.Key<M>): M? = firstOrNull(key)
operator fun <M : Message> get(key: Message.Key<M>): M? = firstOrNull(key)
/**
* 遍历每一个有内容的消息, 即 [At], [AtAll], [PlainText], [Image], [Face] 等
......@@ -88,21 +88,16 @@ interface MessageChain : Message, List<SingleMessage>, RandomAccess {
*/
@JvmName("forEachContent")
@JavaFriendlyAPI
final fun __forEachContentForJava__(block: (Message) -> Unit) = this.forEachContent(block)
@PlannedRemoval("1.1.0")
@Deprecated("use Java 8 API", level = DeprecationLevel.HIDDEN)
@JvmName("forEach")
@JavaFriendlyAPI
@JvmSynthetic
@kotlin.internal.LowPriorityInOverloadResolution
final fun __forEachForJava__(block: (Message) -> Unit) = this.forEach(block)
fun __forEachContentForJava__(block: (Message) -> Unit) = this.forEachContent(block)
@PlannedRemoval("1.2.0")
@JvmName("firstOrNull")
@Deprecated("use get instead. This is going to be removed in mirai 1.2.0", ReplaceWith("get(key)"))
final fun <M : Message> getOrNull(key: Message.Key<M>): M? = get(key)
@Deprecated(
"use get instead. This is going to be removed in mirai 1.2.0",
ReplaceWith("get(key)"),
level = DeprecationLevel.ERROR
)
fun <M : Message> getOrNull(key: Message.Key<M>): M? = get(key)
}
// region accessors
......
......@@ -30,7 +30,7 @@ data class PlainText(
@PlannedRemoval("1.2.0")
@Deprecated(
"use content instead for clearer semantics",
level = DeprecationLevel.WARNING,
level = DeprecationLevel.ERROR,
replaceWith = ReplaceWith("content")
)
val stringValue: String
......
......@@ -13,8 +13,6 @@ package net.mamoe.mirai.utils
import kotlinx.io.core.Input
import net.mamoe.mirai.Bot
import net.mamoe.mirai.message.data.Message
import net.mamoe.mirai.message.data.MessageChain
import net.mamoe.mirai.utils.internal.DeferredReusableInput
import net.mamoe.mirai.utils.internal.asReusableInput
import java.awt.image.BufferedImage
......@@ -67,25 +65,25 @@ fun Input.toExternalImage(): ExternalImage = ExternalImage(DeferredReusableInput
@PlannedRemoval("1.2.0")
@Suppress("RedundantSuspendModifier")
@Deprecated("no need", ReplaceWith("toExternalImage()"))
@Deprecated("no need", ReplaceWith("toExternalImage()"), level = DeprecationLevel.ERROR)
suspend fun Input.suspendToExternalImage(): ExternalImage = toExternalImage()
@Suppress("RedundantSuspendModifier")
@PlannedRemoval("1.2.0")
@Deprecated("no need", ReplaceWith("toExternalImage()"))
@Deprecated("no need", ReplaceWith("toExternalImage()"), level = DeprecationLevel.ERROR)
suspend fun InputStream.suspendToExternalImage(): ExternalImage = toExternalImage()
@Suppress("RedundantSuspendModifier")
@PlannedRemoval("1.2.0")
@Deprecated("no need", ReplaceWith("toExternalImage()"))
@Deprecated("no need", ReplaceWith("toExternalImage()"), level = DeprecationLevel.ERROR)
suspend fun URL.suspendToExternalImage(): ExternalImage = toExternalImage()
@Suppress("RedundantSuspendModifier")
@PlannedRemoval("1.2.0")
@Deprecated("no need", ReplaceWith("toExternalImage()"))
@Deprecated("no need", ReplaceWith("toExternalImage()"), level = DeprecationLevel.ERROR)
suspend fun File.suspendToExternalImage(): ExternalImage = toExternalImage()
@Suppress("RedundantSuspendModifier")
@PlannedRemoval("1.2.0")
@Deprecated("no need", ReplaceWith("toExternalImage()"))
@Deprecated("no need", ReplaceWith("toExternalImage()"), level = DeprecationLevel.ERROR)
suspend fun BufferedImage.suspendToExternalImage(): ExternalImage = toExternalImage()
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