1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-12-27 19:17:12 +00:00

rename old strikethrough factory

This commit is contained in:
InsanusMokrassar 2024-12-25 11:09:16 +06:00
parent a95f556a5c
commit 9a0793d81c
4 changed files with 16 additions and 16 deletions

View File

@ -22946,9 +22946,9 @@ public final class dev/inmo/tgbotapi/types/message/textsources/StrikethroughText
} }
public final class dev/inmo/tgbotapi/types/message/textsources/StrikethroughTextSourceKt { public final class dev/inmo/tgbotapi/types/message/textsources/StrikethroughTextSourceKt {
public static final fun strikethrough (Ljava/lang/String;)Ldev/inmo/tgbotapi/types/message/textsources/StrikethroughTextSource; public static final fun strikethroughTextSource (Ljava/lang/String;)Ldev/inmo/tgbotapi/types/message/textsources/StrikethroughTextSource;
public static final fun strikethrough (Ljava/util/List;)Ldev/inmo/tgbotapi/types/message/textsources/StrikethroughTextSource; public static final fun strikethroughTextSource (Ljava/util/List;)Ldev/inmo/tgbotapi/types/message/textsources/StrikethroughTextSource;
public static final fun strikethrough ([Ldev/inmo/tgbotapi/types/message/textsources/TextSource;)Ldev/inmo/tgbotapi/types/message/textsources/StrikethroughTextSource; public static final fun strikethroughTextSource ([Ldev/inmo/tgbotapi/types/message/textsources/TextSource;)Ldev/inmo/tgbotapi/types/message/textsources/StrikethroughTextSource;
} }
public final class dev/inmo/tgbotapi/types/message/textsources/TextLinkTextSource : dev/inmo/tgbotapi/types/message/textsources/TextSource { public final class dev/inmo/tgbotapi/types/message/textsources/TextLinkTextSource : dev/inmo/tgbotapi/types/message/textsources/TextSource {

View File

@ -6,7 +6,7 @@ import dev.inmo.tgbotapi.utils.internal.*
import kotlinx.serialization.Serializable import kotlinx.serialization.Serializable
/** /**
* @see strikethrough * @see strikethroughTextSource
*/ */
@Serializable @Serializable
data class StrikethroughTextSource @RiskFeature(DirectInvocationOfTextSourceConstructor) constructor ( data class StrikethroughTextSource @RiskFeature(DirectInvocationOfTextSourceConstructor) constructor (
@ -18,6 +18,6 @@ data class StrikethroughTextSource @RiskFeature(DirectInvocationOfTextSourceCons
override val markdown: String by lazy { source.strikethroughMarkdown() } override val markdown: String by lazy { source.strikethroughMarkdown() }
} }
inline fun strikethrough(parts: TextSourcesList) = StrikethroughTextSource(parts.makeString(), parts) inline fun strikethroughTextSource(parts: TextSourcesList) = StrikethroughTextSource(parts.makeString(), parts)
inline fun strikethrough(vararg parts: TextSource) = strikethrough(parts.toList()) inline fun strikethroughTextSource(vararg parts: TextSource) = strikethroughTextSource(parts.toList())
inline fun strikethrough(text: String) = strikethrough(regularTextSource(text)) inline fun strikethroughTextSource(text: String) = strikethroughTextSource(regularTextSource(text))

View File

@ -550,18 +550,18 @@ inline fun EntitiesBuilder.regularln(text: String) = regular(text) + newLine
/** /**
* Add strikethrough using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.strikethrough] * Add strikethrough using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.strikethroughTextSource]
*/ */
inline fun EntitiesBuilder.strikethrough(parts: TextSourcesList) = add(dev.inmo.tgbotapi.types.message.textsources.strikethrough(parts)) inline fun EntitiesBuilder.strikethrough(parts: TextSourcesList) = add(dev.inmo.tgbotapi.types.message.textsources.strikethroughTextSource(parts))
/** /**
* Version of [EntitiesBuilder.strikethrough] with new line at the end * Version of [EntitiesBuilder.strikethrough] with new line at the end
*/ */
inline fun EntitiesBuilder.strikethroughln(parts: TextSourcesList) = strikethrough(parts) + newLine inline fun EntitiesBuilder.strikethroughln(parts: TextSourcesList) = strikethrough(parts) + newLine
/** /**
* Add strikethrough using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.strikethrough]. * Add strikethrough using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.strikethroughTextSource].
* Will reuse separator config from [buildEntities] * Will reuse separator config from [buildEntities]
*/ */
inline fun EntitiesBuilder.strikethrough(noinline init: EntitiesBuilderBody) = add(dev.inmo.tgbotapi.types.message.textsources.strikethrough( inline fun EntitiesBuilder.strikethrough(noinline init: EntitiesBuilderBody) = add(dev.inmo.tgbotapi.types.message.textsources.strikethroughTextSource(
buildEntities(separator, init) buildEntities(separator, init)
)) ))
/** /**
@ -570,17 +570,17 @@ inline fun EntitiesBuilder.strikethrough(noinline init: EntitiesBuilderBody) = a
*/ */
inline fun EntitiesBuilder.strikethroughln(noinline init: EntitiesBuilderBody) = strikethrough(init) + newLine inline fun EntitiesBuilder.strikethroughln(noinline init: EntitiesBuilderBody) = strikethrough(init) + newLine
/** /**
* Add strikethrough using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.strikethrough] * Add strikethrough using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.strikethroughTextSource]
*/ */
inline fun EntitiesBuilder.strikethrough(vararg parts: TextSource) = add(dev.inmo.tgbotapi.types.message.textsources.strikethrough(*parts)) inline fun EntitiesBuilder.strikethrough(vararg parts: TextSource) = add(dev.inmo.tgbotapi.types.message.textsources.strikethroughTextSource(*parts))
/** /**
* Version of [EntitiesBuilder.strikethrough] with new line at the end * Version of [EntitiesBuilder.strikethrough] with new line at the end
*/ */
inline fun EntitiesBuilder.strikethroughln(vararg parts: TextSource) = strikethrough(*parts) + newLine inline fun EntitiesBuilder.strikethroughln(vararg parts: TextSource) = strikethrough(*parts) + newLine
/** /**
* Add strikethrough using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.strikethrough] * Add strikethrough using [EntitiesBuilder.add] with [dev.inmo.tgbotapi.types.message.textsources.strikethroughTextSource]
*/ */
inline fun EntitiesBuilder.strikethrough(text: String) = add(dev.inmo.tgbotapi.types.message.textsources.strikethrough(text)) inline fun EntitiesBuilder.strikethrough(text: String) = add(dev.inmo.tgbotapi.types.message.textsources.strikethroughTextSource(text))
/** /**
* Version of [EntitiesBuilder.strikethrough] with new line at the end * Version of [EntitiesBuilder.strikethrough] with new line at the end
*/ */

View File

@ -42,7 +42,7 @@ class StringFormattingTests {
val sources: TextSourcesList = regularTextSource("It (is?) ") + val sources: TextSourcesList = regularTextSource("It (is?) ") +
boldTextSource(italicTextSource("is") + boldTextSource(italicTextSource("is") +
" " + " " +
strikethrough(underlineTextSource("simple"))) + strikethroughTextSource(underlineTextSource("simple"))) +
" " + " " +
spoilerTextSource("hello world") + spoilerTextSource("hello world") +
" with " + " with " +