mirai-core / net.mamoe.mirai.contact / User / uploadImage

uploadImage

abstract suspend fun uploadImage(image: ExternalImage): OfflineFriendImage

上传一个图片以备发送.

Exceptions

EventCancelledException - 当发送消息事件被取消

OverFileSizeMaxException - 当图片文件过大而被服务器拒绝上传时. (最大大小约为 20 MB)

See Also

BeforeImageUploadEvent

ImageUploadEvent