BeforeImageUploadEvent

data class BeforeImageUploadEvent @MiraiInternalApi constructor(val target: Contact, val source: ExternalResource) : AbstractEvent, BotEvent, BotActiveEvent, CancellableEvent, VerboseEvent

图片上传前. 可以阻止上传.

此事件总是在 ImageUploadEvent 之前广播. 若此事件被取消, ImageUploadEvent 不会广播.

See also

上传图片. 为广播这个事件的唯一途径

Constructors

Link copied to clipboard
fun BeforeImageUploadEvent(target: Contact, source: ExternalResource)

Functions

Link copied to clipboard
fun cancel()
Link copied to clipboard
abstract fun intercept()

拦截这个事件

Properties

Link copied to clipboard
var _intercepted: Boolean = false
Link copied to clipboard
open override val bot: Bot
Link copied to clipboard
val broadCastLock: Mutex

限制一个事件实例不能并行广播. (适用于 object 广播的情况)

Link copied to clipboard
val isCancelled: Boolean
Link copied to clipboard
abstract val isIntercepted: Boolean

事件是否已被拦截.

Link copied to clipboard
val source: ExternalResource
Link copied to clipboard
val target: Contact