mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-11 04:40:10 +08:00
Fix reply
function prohibition in MessageSelectBuilder
This commit is contained in:
parent
7f1b14f636
commit
5c6ee12b68
@ -128,6 +128,9 @@ abstract class MessageSelectBuilder<M : MessagePacket<*, *>, R> @PublishedApi in
|
|||||||
onEvent: @MessageDsl suspend M.(N) -> R
|
onEvent: @MessageDsl suspend M.(N) -> R
|
||||||
) = error("prohibited")
|
) = error("prohibited")
|
||||||
|
|
||||||
|
@Deprecated("Use `default` instead", level = DeprecationLevel.HIDDEN)
|
||||||
|
override fun always(onEvent: MessageListener<M, Any?>) = error("prohibited")
|
||||||
|
|
||||||
@Deprecated("Using `reply` DSL in message selection is prohibited", level = DeprecationLevel.HIDDEN)
|
@Deprecated("Using `reply` DSL in message selection is prohibited", level = DeprecationLevel.HIDDEN)
|
||||||
override infix fun MessageSelectionTimeoutChecker.reply(block: suspend () -> Any?): Nothing = error("prohibited")
|
override infix fun MessageSelectionTimeoutChecker.reply(block: suspend () -> Any?): Nothing = error("prohibited")
|
||||||
|
|
||||||
@ -203,9 +206,7 @@ abstract class MessageSelectBuilderUnit<M : MessagePacket<*, *>, R> @PublishedAp
|
|||||||
abstract fun default(onEvent: MessageListener<M, R>) // 需要后置默认监听器
|
abstract fun default(onEvent: MessageListener<M, R>) // 需要后置默认监听器
|
||||||
|
|
||||||
@Deprecated("Use `default` instead", level = DeprecationLevel.HIDDEN)
|
@Deprecated("Use `default` instead", level = DeprecationLevel.HIDDEN)
|
||||||
override fun always(onEvent: MessageListener<M, Any?>) {
|
override fun always(onEvent: MessageListener<M, Any?>) = error("prohibited")
|
||||||
super.always(onEvent)
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 限制本次 select 的最长等待时间, 当超时后抛出 [TimeoutCancellationException]
|
* 限制本次 select 的最长等待时间, 当超时后抛出 [TimeoutCancellationException]
|
||||||
|
Loading…
Reference in New Issue
Block a user