mirror of
https://github.com/mamoe/mirai.git
synced 2025-02-13 20:02:57 +08:00
Remove redundant checks
This commit is contained in:
parent
9c6780d5c4
commit
b482590ce1
@ -240,10 +240,8 @@ public interface ExternalResource : Closeable {
|
|||||||
@JvmStatic
|
@JvmStatic
|
||||||
@JvmBlockingBridge
|
@JvmBlockingBridge
|
||||||
@JvmOverloads
|
@JvmOverloads
|
||||||
public suspend fun File.uploadAsImage(contact: Contact, formatName: String? = null): Image {
|
public suspend fun File.uploadAsImage(contact: Contact, formatName: String? = null): Image =
|
||||||
require(this.isFile && this.exists() && this.canRead()) { "file ${this.path} is not readable" }
|
toExternalResource(formatName).withUse { uploadAsImage(contact) }
|
||||||
return toExternalResource(formatName).withUse { uploadAsImage(contact) }
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user