Fix nudge

This commit is contained in:
Him188 2020-09-16 09:44:05 +08:00
parent b76c23e647
commit 1717501d85
2 changed files with 7 additions and 1 deletions

View File

@ -351,8 +351,13 @@ public abstract class Bot internal constructor(
@JvmSynthetic
public abstract suspend fun ignoreInvitedJoinGroupRequest(event: BotInvitedJoinGroupRequestEvent)
@Deprecated(
"use member function.",
replaceWith = ReplaceWith("nudge.sendTo(contact)"),
level = DeprecationLevel.ERROR
)
@SinceMirai("1.3.0")
internal abstract suspend fun sendNudge(nudge: Nudge, receiver: Contact): Boolean
public abstract suspend fun sendNudge(nudge: Nudge, receiver: Contact): Boolean
// endregion

View File

@ -54,6 +54,7 @@ public sealed class Nudge {
@JvmBlockingBridge
@MiraiExperimentalAPI
public suspend fun sendTo(receiver: Contact): Boolean {
@Suppress("DEPRECATION_ERROR")
return receiver.bot.sendNudge(this, receiver)
}