mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-26 03:58:44 +00:00
fix of #294
This commit is contained in:
parent
3a53f41f66
commit
4449893608
@ -2,6 +2,9 @@
|
|||||||
|
|
||||||
## 0.32.5
|
## 0.32.5
|
||||||
|
|
||||||
|
* `Core`:
|
||||||
|
* Add `mention` variants for user ids and receiver variants ([#294](https://github.com/InsanusMokrassar/TelegramBotAPI/issues/294))
|
||||||
|
|
||||||
## 0.32.4
|
## 0.32.4
|
||||||
|
|
||||||
* `Common`:
|
* `Common`:
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
package dev.inmo.tgbotapi.types.MessageEntity.textsources
|
package dev.inmo.tgbotapi.types.MessageEntity.textsources
|
||||||
|
|
||||||
import dev.inmo.tgbotapi.CommonAbstracts.*
|
import dev.inmo.tgbotapi.CommonAbstracts.*
|
||||||
import dev.inmo.tgbotapi.types.User
|
import dev.inmo.tgbotapi.types.*
|
||||||
import dev.inmo.tgbotapi.utils.RiskFeature
|
import dev.inmo.tgbotapi.utils.RiskFeature
|
||||||
import dev.inmo.tgbotapi.utils.internal.*
|
import dev.inmo.tgbotapi.utils.internal.*
|
||||||
|
|
||||||
@ -21,6 +21,26 @@ data class TextMentionTextSource @RiskFeature(DirectInvocationOfTextSourceConstr
|
|||||||
@Suppress("NOTHING_TO_INLINE")
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
inline fun mention(parts: List<TextSource>, user: User) = TextMentionTextSource(parts.makeString(), user, parts)
|
inline fun mention(parts: List<TextSource>, user: User) = TextMentionTextSource(parts.makeString(), user, parts)
|
||||||
@Suppress("NOTHING_TO_INLINE")
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
|
inline fun User.mention(parts: List<TextSource>) = mention(parts, this)
|
||||||
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
|
inline fun mention(parts: List<TextSource>, userId: UserId) = mention(parts, CommonUser(userId, ""))
|
||||||
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
|
inline fun UserId.mention(parts: List<TextSource>) = mention(parts, this)
|
||||||
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
|
inline fun mention(parts: List<TextSource>, id: Identifier) = mention(parts, UserId(id))
|
||||||
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
|
inline fun Identifier.mention(parts: List<TextSource>) = mention(parts, this)
|
||||||
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
inline fun mention(user: User, vararg parts: TextSource) = mention(parts.toList(), user)
|
inline fun mention(user: User, vararg parts: TextSource) = mention(parts.toList(), user)
|
||||||
@Suppress("NOTHING_TO_INLINE")
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
inline fun mention(text: String, user: User) = mention(user, regular(text))
|
inline fun mention(text: String, user: User) = mention(user, regular(text))
|
||||||
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
|
inline fun User.mention(text: String) = mention(this, regular(text))
|
||||||
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
|
inline fun mention(text: String, userId: UserId) = mention(text, CommonUser(userId, ""))
|
||||||
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
|
inline fun UserId.mention(text: String) = mention(text, this)
|
||||||
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
|
inline fun mention(text: String, id: Identifier) = mention(text, UserId(id))
|
||||||
|
@Suppress("NOTHING_TO_INLINE")
|
||||||
|
inline fun Identifier.mention(text: String) = mention(text, this)
|
||||||
|
Loading…
Reference in New Issue
Block a user