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