diff --git a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/internal/InternalEventListeners.kt b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/internal/InternalEventListeners.kt index 3b1034336..d7eca4ad0 100644 --- a/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/internal/InternalEventListeners.kt +++ b/mirai-core/src/commonMain/kotlin/net.mamoe.mirai/event/internal/InternalEventListeners.kt @@ -25,8 +25,8 @@ import kotlin.coroutines.coroutineContext import kotlin.jvm.JvmField import kotlin.reflect.KClass -@MiraiInternalAPI -fun , E : Event> KClass.subscribeInternal(listener: L): L { +@PublishedApi +internal fun , E : Event> KClass.subscribeInternal(listener: L): L { with(this.listeners()) { addLast(listener) listener.invokeOnCompletion { diff --git a/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/event/internal/EventInternalJvm.kt b/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/event/internal/EventInternalJvm.kt index 5fe4131de..d2f3a979c 100644 --- a/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/event/internal/EventInternalJvm.kt +++ b/mirai-core/src/jvmMain/kotlin/net/mamoe/mirai/event/internal/EventInternalJvm.kt @@ -22,9 +22,8 @@ import java.util.function.Consumer import java.util.function.Function import kotlin.coroutines.EmptyCoroutineContext -@MiraiInternalAPI @Suppress("FunctionName") -fun Class._subscribeEventForJaptOnly( +internal fun Class._subscribeEventForJaptOnly( scope: CoroutineScope, onEvent: Function ): Listener { @@ -35,9 +34,8 @@ fun Class._subscribeEventForJaptOnly( ) { withContext(Dispatchers.IO) { onEvent.apply(it) } }) } -@MiraiInternalAPI @Suppress("FunctionName") -fun Class._subscribeEventForJaptOnly(scope: CoroutineScope, onEvent: Consumer): Listener { +internal fun Class._subscribeEventForJaptOnly(scope: CoroutineScope, onEvent: Consumer): Listener { return this.kotlin.subscribeInternal( scope.Handler( EmptyCoroutineContext,