1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2025-12-10 00:06:31 +00:00

Compare commits

..

6 Commits

Author SHA1 Message Date
3c1f8421c9 Update CHANGELOG.md 2022-02-27 10:04:28 +06:00
35b20d102c Update gradle.properties 2022-02-26 22:01:41 +06:00
70e6dc8fc9 update dependencies 2022-02-19 23:07:30 +06:00
4f0de376ab MentionTextSource#username 2022-02-19 23:02:58 +06:00
10c52c695c start 0.38.6 2022-02-19 22:54:41 +06:00
2d2c745527 Merge pull request #532 from InsanusMokrassar/0.38.5
0.38.5
2022-02-08 16:53:27 +06:00
3 changed files with 17 additions and 3 deletions

View File

@@ -1,5 +1,14 @@
# TelegramBotAPI changelog
## 0.38.6
* `Common`:
* `Version`:
* `MicroUtils`: `0.9.6` -> `0.9.9`
* `Klock`: `2.4.13` -> `2.5.2`
* `Core`:
* New member of `MentionTextSource` - `username`
## 0.38.5
* `Common`:

View File

@@ -8,11 +8,11 @@ kotlin.incremental.js=true
kotlin_version=1.6.10
kotlin_coroutines_version=1.6.0
kotlin_serialisation_runtime_version=1.3.2
klock_version=2.4.13
klock_version=2.5.2
uuid_version=0.4.0
ktor_version=1.6.7
micro_utils_version=0.9.6
micro_utils_version=0.9.9
javax_activation_version=1.1.1
@@ -20,6 +20,6 @@ javax_activation_version=1.1.1
dokka_version=1.6.10
library_group=dev.inmo
library_version=0.38.5
library_version=0.38.6
github_release_plugin_version=2.2.12

View File

@@ -1,5 +1,6 @@
package dev.inmo.tgbotapi.types.MessageEntity.textsources
import dev.inmo.tgbotapi.types.Username
import dev.inmo.tgbotapi.utils.RiskFeature
import dev.inmo.tgbotapi.utils.extensions.makeString
import dev.inmo.tgbotapi.utils.internal.*
@@ -23,6 +24,7 @@ data class MentionTextSource @RiskFeature(DirectInvocationOfTextSourceConstructo
override val markdown: String by lazy { source.mentionMarkdown() }
override val markdownV2: String by lazy { mentionMarkdownV2() }
override val html: String by lazy { mentionHTML() }
val username: Username = Username(source)
init {
if (!source.startsWith("@")) {
@@ -42,3 +44,6 @@ inline fun mention(vararg parts: TextSource) = mention(parts.toList())
@Suppress("NOTHING_TO_INLINE")
inline fun mention(whoToMention: String) = mention(regular(whoToMention))
@Suppress("NOTHING_TO_INLINE")
inline fun mention(whoToMention: Username) = mention(whoToMention.username.dropWhile { it == '@' })