Change BotNudgedEvent.from to UserOrBot

This commit is contained in:
Him188 2020-12-16 21:32:29 +08:00
parent 8fa6189138
commit 0888cd3f5b

View File

@ -125,7 +125,7 @@ public sealed class BotNudgedEvent : AbstractEvent(), BotEvent, Packet {
/** /**
* 戳一戳的发起人 [Bot] 的某一好友, 或某一群员, [Bot.asFriend] * 戳一戳的发起人 [Bot] 的某一好友, 或某一群员, [Bot.asFriend]
*/ */
public abstract val from: User public abstract val from: UserOrBot
/** 戳一戳的动作名称 */ /** 戳一戳的动作名称 */
public abstract val action: String public abstract val action: String
@ -235,7 +235,7 @@ public data class BotNudgedEvent internal constructor(
* @see MessageEvent.subject * @see MessageEvent.subject
*/ */
@MiraiExperimentalApi @MiraiExperimentalApi
public val BotNudgedEvent.subject: Contact public val BotNudgedEvent.subject: ContactOrBot
get() = when (val inlineFrom = from) { get() = when (val inlineFrom = from) {
is Member -> inlineFrom.group is Member -> inlineFrom.group
else -> inlineFrom else -> inlineFrom