mirror of
https://github.com/mamoe/mirai.git
synced 2025-01-11 02:50:15 +08:00
Rename AnsiMessageBuilder.builder
to create
This commit is contained in:
parent
480666e3f0
commit
04c1d951aa
@ -30,7 +30,7 @@ public open class AnsiMessageBuilder public constructor(
|
|||||||
* @param code Ansi 操作码
|
* @param code Ansi 操作码
|
||||||
*
|
*
|
||||||
* @see from
|
* @see from
|
||||||
* @see builder
|
* @see create
|
||||||
*/
|
*/
|
||||||
public open fun ansi(code: String): AnsiMessageBuilder = append(code)
|
public open fun ansi(code: String): AnsiMessageBuilder = append(code)
|
||||||
|
|
||||||
@ -142,7 +142,7 @@ public open class AnsiMessageBuilder public constructor(
|
|||||||
*/
|
*/
|
||||||
@JvmStatic
|
@JvmStatic
|
||||||
@JvmOverloads
|
@JvmOverloads
|
||||||
public fun builder(
|
public fun create(
|
||||||
capacity: Int = 16,
|
capacity: Int = 16,
|
||||||
noAnsi: Boolean = false
|
noAnsi: Boolean = false
|
||||||
): AnsiMessageBuilder = from(StringBuilder(capacity), noAnsi)
|
): AnsiMessageBuilder = from(StringBuilder(capacity), noAnsi)
|
||||||
@ -195,7 +195,7 @@ public fun AnsiMessageBuilder(capacity: Int = 16): AnsiMessageBuilder = AnsiMess
|
|||||||
public inline fun buildAnsiMessage(
|
public inline fun buildAnsiMessage(
|
||||||
capacity: Int = 16,
|
capacity: Int = 16,
|
||||||
action: AnsiMessageBuilder.() -> Unit
|
action: AnsiMessageBuilder.() -> Unit
|
||||||
): String = AnsiMessageBuilder.builder(capacity, false).apply(action).toString()
|
): String = AnsiMessageBuilder.create(capacity, false).apply(action).toString()
|
||||||
|
|
||||||
// 不在 top-level 使用者会得到 Internal error: Couldn't inline sendAnsiMessage
|
// 不在 top-level 使用者会得到 Internal error: Couldn't inline sendAnsiMessage
|
||||||
|
|
||||||
@ -209,7 +209,7 @@ public suspend inline fun CommandSender.sendAnsiMessage(
|
|||||||
builder: AnsiMessageBuilder.() -> Unit
|
builder: AnsiMessageBuilder.() -> Unit
|
||||||
) {
|
) {
|
||||||
sendMessage(
|
sendMessage(
|
||||||
AnsiMessageBuilder.builder(capacity, noAnsi = !AnsiMessageBuilder.isAnsiSupported(this))
|
AnsiMessageBuilder.create(capacity, noAnsi = !AnsiMessageBuilder.isAnsiSupported(this))
|
||||||
.apply(builder)
|
.apply(builder)
|
||||||
.toString()
|
.toString()
|
||||||
)
|
)
|
||||||
|
Loading…
Reference in New Issue
Block a user