diff --git a/tgbotapi.core/api/tgbotapi.core.api b/tgbotapi.core/api/tgbotapi.core.api index 43f1f918b3..02e46d5cd5 100644 --- a/tgbotapi.core/api/tgbotapi.core.api +++ b/tgbotapi.core/api/tgbotapi.core.api @@ -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 static final fun strikethrough (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 strikethrough ([Ldev/inmo/tgbotapi/types/message/textsources/TextSource;)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 strikethroughTextSource (Ljava/util/List;)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 { diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/textsources/StrikethroughTextSource.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/textsources/StrikethroughTextSource.kt index 34135e1340..a29df58a66 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/textsources/StrikethroughTextSource.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/types/message/textsources/StrikethroughTextSource.kt @@ -6,7 +6,7 @@ import dev.inmo.tgbotapi.utils.internal.* import kotlinx.serialization.Serializable /** - * @see strikethrough + * @see strikethroughTextSource */ @Serializable data class StrikethroughTextSource @RiskFeature(DirectInvocationOfTextSourceConstructor) constructor ( @@ -18,6 +18,6 @@ data class StrikethroughTextSource @RiskFeature(DirectInvocationOfTextSourceCons override val markdown: String by lazy { source.strikethroughMarkdown() } } -inline fun strikethrough(parts: TextSourcesList) = StrikethroughTextSource(parts.makeString(), parts) -inline fun strikethrough(vararg parts: TextSource) = strikethrough(parts.toList()) -inline fun strikethrough(text: String) = strikethrough(regularTextSource(text)) +inline fun strikethroughTextSource(parts: TextSourcesList) = StrikethroughTextSource(parts.makeString(), parts) +inline fun strikethroughTextSource(vararg parts: TextSource) = strikethroughTextSource(parts.toList()) +inline fun strikethroughTextSource(text: String) = strikethroughTextSource(regularTextSource(text)) diff --git a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/EntitiesBuilder.kt b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/EntitiesBuilder.kt index 3021f82c4f..b3e6265014 100644 --- a/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/EntitiesBuilder.kt +++ b/tgbotapi.core/src/commonMain/kotlin/dev/inmo/tgbotapi/utils/EntitiesBuilder.kt @@ -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 */ 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] */ -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) )) /** @@ -570,17 +570,17 @@ inline fun EntitiesBuilder.strikethrough(noinline init: EntitiesBuilderBody) = a */ 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 */ 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 */ diff --git a/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/MessageEntity/StringFormattingTests.kt b/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/MessageEntity/StringFormattingTests.kt index b6e4bc4214..92b6a58651 100644 --- a/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/MessageEntity/StringFormattingTests.kt +++ b/tgbotapi.core/src/commonTest/kotlin/dev/inmo/tgbotapi/types/MessageEntity/StringFormattingTests.kt @@ -42,7 +42,7 @@ class StringFormattingTests { val sources: TextSourcesList = regularTextSource("It (is?) ") + boldTextSource(italicTextSource("is") + " " + - strikethrough(underlineTextSource("simple"))) + + strikethroughTextSource(underlineTextSource("simple"))) + " " + spoilerTextSource("hello world") + " with " +