mirror of
https://github.com/mamoe/mirai.git
synced 2025-03-03 15:10:14 +08:00
[Review] Add FlashImage.from(Image), remove deprecated FriendImage.flash and GroupImage.flash
This commit is contained in:
parent
cbbb6f27af
commit
b17c269b62
@ -345,6 +345,14 @@ public data class FlashImage(
|
|||||||
*/
|
*/
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
public fun from(imageId: String): FlashImage = FlashImage(Image(imageId))
|
public fun from(imageId: String): FlashImage = FlashImage(Image(imageId))
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 将普通图片转换为闪照.
|
||||||
|
*
|
||||||
|
* @see Image.flash
|
||||||
|
*/
|
||||||
|
@JvmStatic
|
||||||
|
public inline fun from(image: Image): FlashImage = FlashImage(image)
|
||||||
}
|
}
|
||||||
|
|
||||||
private val stringValue: String by lazy(LazyThreadSafetyMode.NONE) { "[mirai:flash:${image.imageId}]" }
|
private val stringValue: String by lazy(LazyThreadSafetyMode.NONE) { "[mirai:flash:${image.imageId}]" }
|
||||||
@ -369,16 +377,4 @@ public inline fun FlashImage(imageId: String): FlashImage = FlashImage.from(imag
|
|||||||
* 将普通图片转换为闪照.
|
* 将普通图片转换为闪照.
|
||||||
*/
|
*/
|
||||||
@JvmSynthetic
|
@JvmSynthetic
|
||||||
public inline fun Image.flash(): FlashImage = FlashImage(this)
|
public inline fun Image.flash(): FlashImage = FlashImage(this)
|
||||||
|
|
||||||
/**
|
|
||||||
* 将普通图片转换为闪照.
|
|
||||||
*/
|
|
||||||
@JvmSynthetic
|
|
||||||
public inline fun GroupImage.flash(): FlashImage = FlashImage(this)
|
|
||||||
|
|
||||||
/**
|
|
||||||
* 将普通图片转换为闪照.
|
|
||||||
*/
|
|
||||||
@JvmSynthetic
|
|
||||||
public inline fun FriendImage.flash(): FlashImage = FlashImage(this)
|
|
@ -204,15 +204,15 @@ internal abstract class AbstractImage : Image { // make sealed in 1.3.0 ?
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
internal interface ConstOriginUrlAware : Image {
|
internal interface ConstOriginUrlAware {
|
||||||
val originUrl: String
|
val originUrl: String
|
||||||
}
|
}
|
||||||
|
|
||||||
internal interface DeferredOriginUrlAware : Image {
|
internal interface DeferredOriginUrlAware {
|
||||||
fun getUrl(bot: Bot): String
|
fun getUrl(bot: Bot): String
|
||||||
}
|
}
|
||||||
|
|
||||||
internal interface SuspendDeferredOriginUrlAware : Image {
|
internal interface SuspendDeferredOriginUrlAware {
|
||||||
suspend fun getUrl(bot: Bot): String
|
suspend fun getUrl(bot: Bot): String
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user