mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-12-22 16:47:13 +00:00
deprecations removed
This commit is contained in:
parent
7825ec3010
commit
fe1831fc19
@ -2,6 +2,8 @@
|
||||
|
||||
## 0.35.0
|
||||
|
||||
**ALL PREVIOUS DEPRECATIONS HAVE BEEN REMOVED**
|
||||
|
||||
* `Common`:
|
||||
* `Version`:
|
||||
* `Kotlin`: `1.4.72` -> `1.5.10`
|
||||
|
@ -1,20 +0,0 @@
|
||||
package dev.inmo.tgbotapi.CommonAbstracts
|
||||
|
||||
const val CaptionDeprecation = "Captioned interface and others will be removed soon and not recommended to use"
|
||||
|
||||
@Deprecated(CaptionDeprecation)
|
||||
interface Captioned : Texted {
|
||||
@Deprecated(CaptionDeprecation)
|
||||
val caption: String?
|
||||
get() = text
|
||||
}
|
||||
|
||||
@Deprecated(CaptionDeprecation)
|
||||
interface CaptionedInput : Captioned, TextedInput {
|
||||
/**
|
||||
* Full list of entities. This list WILL contain [TextPart]s with [dev.inmo.tgbotapi.types.MessageEntity.textsources.RegularTextSource]
|
||||
*/
|
||||
@Deprecated(CaptionDeprecation)
|
||||
val captionEntities: List<TextPart>
|
||||
get() = textEntities
|
||||
}
|
@ -1,26 +0,0 @@
|
||||
package dev.inmo.tgbotapi.CommonAbstracts
|
||||
|
||||
@Deprecated("Will be removed soon")
|
||||
interface Explained : Texted {
|
||||
val explanation: String?
|
||||
get() = text
|
||||
}
|
||||
|
||||
@Deprecated("Will be removed soon")
|
||||
interface ParsableExplainedOutput : Explained, TextedOutput
|
||||
|
||||
@Deprecated("Will be removed soon")
|
||||
interface EntitiesExplainedOutput : Explained, EntitiesOutput
|
||||
|
||||
@Deprecated("Will be removed soon")
|
||||
interface ExplainedOutput : ParsableExplainedOutput, EntitiesExplainedOutput
|
||||
|
||||
@Deprecated("Will be removed soon")
|
||||
interface ExplainedInput : Explained {
|
||||
val textSources: TextSourcesList
|
||||
/**
|
||||
* Full list of entities. This list WILL contain [TextPart]s with [dev.inmo.tgbotapi.types.MessageEntity.textsources.RegularTextSource]
|
||||
*/
|
||||
val explanationEntities: List<TextPart>
|
||||
get() = textSources.toTextParts()
|
||||
}
|
@ -66,7 +66,7 @@ fun List<dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSource>.separateF
|
||||
"Replaced",
|
||||
ReplaceWith("separateForCaption", "dev.inmo.tgbotapi.types.MessageEntity.textsources.separateForCaption")
|
||||
)
|
||||
fun List<dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSource>.separateForCaption() = separateForCaption()
|
||||
fun List<TextSource>.separateForCaption() = separateForCaption()
|
||||
|
||||
/**
|
||||
* This method will prepare [TextSource]s list for messages with [textLength]
|
||||
|
@ -356,7 +356,7 @@ data class SendQuizPoll internal constructor(
|
||||
override val allowSendingWithoutReply: Boolean? = null,
|
||||
@SerialName(replyMarkupField)
|
||||
override val replyMarkup: KeyboardMarkup? = null
|
||||
) : SendPoll(), ExplainedOutput, TextedOutput {
|
||||
) : SendPoll(), TextedOutput {
|
||||
override val type: String = quizPollType
|
||||
override val requestSerializer: SerializationStrategy<*>
|
||||
get() = serializer()
|
||||
|
@ -1,7 +1,6 @@
|
||||
package dev.inmo.tgbotapi.types.ChatMember
|
||||
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.ChatMember.abstracts.ChatMember
|
||||
import dev.inmo.tgbotapi.types.ChatMember.abstracts.LeftChatMember
|
||||
import kotlinx.serialization.*
|
||||
|
||||
|
@ -1,9 +1,6 @@
|
||||
package dev.inmo.tgbotapi.types.InlineQueries.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery
|
||||
import dev.inmo.tgbotapi.types.InlineQueryIdentifier
|
||||
import dev.inmo.tgbotapi.types.User
|
||||
import dev.inmo.tgbotapi.types.chat.ChatType
|
||||
|
||||
@Deprecated("Replaced", ReplaceWith("InlineQuery", "dev.inmo.tgbotapi.types.InlineQueries.query.InlineQuery"))
|
||||
typealias InlineQuery = InlineQuery
|
||||
|
@ -1,8 +1,6 @@
|
||||
package dev.inmo.tgbotapi.types.InlineQueries.abstracts
|
||||
|
||||
import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputMessageContent
|
||||
import dev.inmo.tgbotapi.types.InlineQueries.InputMessageContentSerializer
|
||||
import kotlinx.serialization.Serializable
|
||||
|
||||
@Deprecated("Replaced", ReplaceWith("InputMessageContent", "dev.inmo.tgbotapi.types.InlineQueries.InputMessageContent.InputMessageContent"))
|
||||
typealias InputMessageContent = InputMessageContent
|
||||
|
@ -28,8 +28,6 @@ internal object BotActionSerializer: KSerializer<BotAction> {
|
||||
UploadPhotoAction.actionName -> UploadPhotoAction
|
||||
RecordVideoAction.actionName -> RecordVideoAction
|
||||
UploadVideoAction.actionName -> UploadVideoAction
|
||||
RecordAudioAction.actionName -> RecordAudioAction
|
||||
UploadAudioAction.actionName -> UploadAudioAction
|
||||
RecordVoiceAction.actionName -> RecordVoiceAction
|
||||
UploadVoiceAction.actionName -> UploadVoiceAction
|
||||
UploadDocumentAction.actionName -> UploadDocumentAction
|
||||
@ -85,52 +83,6 @@ inline val uploadVideo
|
||||
get() = UploadVideoAction
|
||||
inline fun BotAction.asUploadVideo() = this as? UploadVideoAction
|
||||
|
||||
/**
|
||||
* Will notify user that bot is recording some audio
|
||||
*/
|
||||
@Serializable(BotActionSerializer::class)
|
||||
@Deprecated(
|
||||
"Deprecated according to https://core.telegram.org/bots/api-changelog#april-26-2021",
|
||||
ReplaceWith("RecordVoiceAction", "dev.inmo.tgbotapi.types.actions.RecordVoiceAction")
|
||||
)
|
||||
object RecordAudioAction : BotAction {
|
||||
override val actionName: String = "record_audio"
|
||||
}
|
||||
@Deprecated(
|
||||
"Deprecated according to https://core.telegram.org/bots/api-changelog#april-26-2021",
|
||||
ReplaceWith("recordVoice", "dev.inmo.tgbotapi.types.actions.recordVoice")
|
||||
)
|
||||
inline val recordAudio
|
||||
get() = RecordAudioAction
|
||||
@Deprecated(
|
||||
"Deprecated according to https://core.telegram.org/bots/api-changelog#april-26-2021",
|
||||
ReplaceWith("asRecordVoice", "dev.inmo.tgbotapi.types.actions.asRecordVoice")
|
||||
)
|
||||
inline fun BotAction.asRecordAudio() = this as? RecordAudioAction
|
||||
|
||||
/**
|
||||
* Will notify user that bot is uploading some audio
|
||||
*/
|
||||
@Serializable(BotActionSerializer::class)
|
||||
@Deprecated(
|
||||
"Deprecated according to https://core.telegram.org/bots/api-changelog#april-26-2021",
|
||||
ReplaceWith("UploadVoiceAction", "dev.inmo.tgbotapi.types.actions.UploadVoiceAction")
|
||||
)
|
||||
object UploadAudioAction : BotAction {
|
||||
override val actionName: String = "upload_audio"
|
||||
}
|
||||
@Deprecated(
|
||||
"Deprecated according to https://core.telegram.org/bots/api-changelog#april-26-2021",
|
||||
ReplaceWith("uploadVoice", "dev.inmo.tgbotapi.types.actions.uploadVoice")
|
||||
)
|
||||
inline val uploadAudio
|
||||
get() = UploadAudioAction
|
||||
@Deprecated(
|
||||
"Deprecated according to https://core.telegram.org/bots/api-changelog#april-26-2021",
|
||||
ReplaceWith("asUploadVoice", "dev.inmo.tgbotapi.types.actions.asUploadVoice")
|
||||
)
|
||||
inline fun BotAction.asUploadAudio() = this as? UploadAudioAction
|
||||
|
||||
/**
|
||||
* Will notify user that bot is recording some audio
|
||||
*/
|
||||
|
@ -1,6 +1,5 @@
|
||||
package dev.inmo.tgbotapi.types.files
|
||||
|
||||
import dev.inmo.tgbotapi.CommonAbstracts.TextSourcesList
|
||||
import dev.inmo.tgbotapi.requests.abstracts.FileId
|
||||
import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.InputMedia.InputMediaVideo
|
||||
|
@ -1,6 +1,7 @@
|
||||
package dev.inmo.tgbotapi.types.games
|
||||
|
||||
import dev.inmo.tgbotapi.CommonAbstracts.*
|
||||
import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.files.AnimationFile
|
||||
import dev.inmo.tgbotapi.types.files.Photo
|
||||
|
||||
@ -11,4 +12,4 @@ data class Game(
|
||||
override val text: String? = null,
|
||||
override val textSources: TextSourcesList = emptyList(),
|
||||
val animation: AnimationFile? = null
|
||||
) : Titled, CaptionedInput, TextedInput
|
||||
) : Titled, TextedInput
|
||||
|
@ -1,6 +1,5 @@
|
||||
package dev.inmo.tgbotapi.types.message.content
|
||||
|
||||
import dev.inmo.tgbotapi.CommonAbstracts.TextSourcesList
|
||||
import dev.inmo.tgbotapi.CommonAbstracts.TextedInput
|
||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||
import dev.inmo.tgbotapi.requests.send.SendTextMessage
|
||||
|
@ -4,7 +4,7 @@ import dev.inmo.tgbotapi.CommonAbstracts.CaptionedInput
|
||||
import dev.inmo.tgbotapi.CommonAbstracts.TextedInput
|
||||
import dev.inmo.tgbotapi.types.InputMedia.*
|
||||
|
||||
interface MediaGroupContent : MediaContent, CaptionedInput, TextedInput {
|
||||
interface MediaGroupContent : MediaContent, TextedInput {
|
||||
fun toMediaGroupMemberInputMedia(): MediaGroupMemberInputMedia
|
||||
}
|
||||
|
||||
|
@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||
import dev.inmo.tgbotapi.requests.send.media.SendAnimation
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.InputMedia.InputMediaAnimation
|
||||
import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.files.AnimationFile
|
||||
@ -17,7 +18,7 @@ data class AnimationContent(
|
||||
val includedDocument: DocumentFile?,
|
||||
override val text: String?,
|
||||
override val textSources: TextSourcesList = emptyList()
|
||||
) : MediaContent, CaptionedInput, TextedInput {
|
||||
) : MediaContent, TextedInput {
|
||||
override fun createResend(
|
||||
chatId: ChatIdentifier,
|
||||
disableNotification: Boolean,
|
||||
|
@ -1,6 +1,5 @@
|
||||
package dev.inmo.tgbotapi.types.message.content.media
|
||||
|
||||
import dev.inmo.tgbotapi.CommonAbstracts.TextSourcesList
|
||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||
import dev.inmo.tgbotapi.requests.send.media.SendAudio
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
|
@ -1,12 +1,12 @@
|
||||
package dev.inmo.tgbotapi.types.message.content.media
|
||||
|
||||
import dev.inmo.tgbotapi.CommonAbstracts.TextSourcesList
|
||||
import dev.inmo.tgbotapi.CommonAbstracts.TextedInput
|
||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||
import dev.inmo.tgbotapi.requests.send.media.SendDocument
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.InputMedia.InputMediaDocument
|
||||
import dev.inmo.tgbotapi.types.InputMedia.toInputMediaDocument
|
||||
import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.files.DocumentFile
|
||||
|
@ -1,11 +1,11 @@
|
||||
package dev.inmo.tgbotapi.types.message.content.media
|
||||
|
||||
import dev.inmo.tgbotapi.CommonAbstracts.TextSourcesList
|
||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||
import dev.inmo.tgbotapi.requests.send.media.SendPhoto
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.InputMedia.InputMediaPhoto
|
||||
import dev.inmo.tgbotapi.types.InputMedia.toInputMediaPhoto
|
||||
import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.files.*
|
||||
|
@ -1,10 +1,10 @@
|
||||
package dev.inmo.tgbotapi.types.message.content.media
|
||||
|
||||
import dev.inmo.tgbotapi.CommonAbstracts.TextSourcesList
|
||||
import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||
import dev.inmo.tgbotapi.requests.send.media.SendVideo
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.InputMedia.InputMediaVideo
|
||||
import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.files.VideoFile
|
||||
|
@ -5,6 +5,7 @@ import dev.inmo.tgbotapi.requests.abstracts.Request
|
||||
import dev.inmo.tgbotapi.requests.send.media.SendVoice
|
||||
import dev.inmo.tgbotapi.types.ChatIdentifier
|
||||
import dev.inmo.tgbotapi.types.InputMedia.InputMediaAudio
|
||||
import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSourcesList
|
||||
import dev.inmo.tgbotapi.types.MessageIdentifier
|
||||
import dev.inmo.tgbotapi.types.buttons.KeyboardMarkup
|
||||
import dev.inmo.tgbotapi.types.files.VoiceFile
|
||||
@ -15,7 +16,7 @@ data class VoiceContent(
|
||||
override val media: VoiceFile,
|
||||
override val text: String? = null,
|
||||
override val textSources: TextSourcesList = emptyList()
|
||||
) : MediaContent, CaptionedInput, TextedInput {
|
||||
) : MediaContent, TextedInput {
|
||||
override fun createResend(
|
||||
chatId: ChatIdentifier,
|
||||
disableNotification: Boolean,
|
||||
|
@ -20,8 +20,6 @@ class BotActionTests {
|
||||
UploadPhotoAction -> example.botAction.actionName
|
||||
RecordVideoAction -> example.botAction.actionName
|
||||
UploadVideoAction -> example.botAction.actionName
|
||||
RecordAudioAction -> example.botAction.actionName
|
||||
UploadAudioAction -> example.botAction.actionName
|
||||
RecordVoiceAction -> example.botAction.actionName
|
||||
UploadVoiceAction -> example.botAction.actionName
|
||||
UploadDocumentAction -> example.botAction.actionName
|
||||
@ -51,8 +49,6 @@ class BotActionTests {
|
||||
UploadPhotoAction.example(),
|
||||
RecordVideoAction.example(),
|
||||
UploadVideoAction.example(),
|
||||
RecordAudioAction.example(),
|
||||
UploadAudioAction.example(),
|
||||
RecordVoiceAction.example(),
|
||||
UploadVoiceAction.example(),
|
||||
UploadDocumentAction.example(),
|
||||
|
@ -35,22 +35,6 @@ suspend fun TelegramBot.sendActionUploadVideo(
|
||||
chatId: ChatIdentifier
|
||||
) = sendBotAction(chatId, UploadVideoAction)
|
||||
|
||||
@Deprecated(
|
||||
"Deprecated according to https://core.telegram.org/bots/api-changelog#april-26-2021",
|
||||
ReplaceWith("sendActionRecordVoice", "dev.inmo.tgbotapi.extensions.api.send.sendActionRecordVoice")
|
||||
)
|
||||
suspend fun TelegramBot.sendActionRecordAudio(
|
||||
chatId: ChatIdentifier
|
||||
) = sendBotAction(chatId, RecordAudioAction)
|
||||
|
||||
@Deprecated(
|
||||
"Deprecated according to https://core.telegram.org/bots/api-changelog#april-26-2021",
|
||||
ReplaceWith("sendActionUploadVoice", "dev.inmo.tgbotapi.extensions.api.send.sendActionUploadVoice")
|
||||
)
|
||||
suspend fun TelegramBot.sendActionUploadAudio(
|
||||
chatId: ChatIdentifier
|
||||
) = sendBotAction(chatId, UploadAudioAction)
|
||||
|
||||
suspend fun TelegramBot.sendActionRecordVoice(
|
||||
chatId: ChatIdentifier
|
||||
) = sendBotAction(chatId, RecordVoiceAction)
|
||||
@ -92,22 +76,6 @@ suspend fun TelegramBot.sendActionUploadVideo(
|
||||
chat: Chat
|
||||
) = sendBotAction(chat, UploadVideoAction)
|
||||
|
||||
@Deprecated(
|
||||
"Deprecated according to https://core.telegram.org/bots/api-changelog#april-26-2021",
|
||||
ReplaceWith("sendActionRecordVoice", "dev.inmo.tgbotapi.extensions.api.send.sendActionRecordVoice")
|
||||
)
|
||||
suspend fun TelegramBot.sendActionRecordAudio(
|
||||
chat: Chat
|
||||
) = sendBotAction(chat, RecordAudioAction)
|
||||
|
||||
@Deprecated(
|
||||
"Deprecated according to https://core.telegram.org/bots/api-changelog#april-26-2021",
|
||||
ReplaceWith("sendActionUploadVoice", "dev.inmo.tgbotapi.extensions.api.send.sendActionUploadVoice")
|
||||
)
|
||||
suspend fun TelegramBot.sendActionUploadAudio(
|
||||
chat: Chat
|
||||
) = sendBotAction(chat, UploadAudioAction)
|
||||
|
||||
suspend fun TelegramBot.sendActionRecordVoice(
|
||||
chat: Chat
|
||||
) = sendBotAction(chat, RecordVoiceAction)
|
||||
|
@ -56,16 +56,6 @@ suspend fun <T> TelegramBot.withTypingAction(chatId: ChatId, block: TelegramBotA
|
||||
suspend fun <T> TelegramBot.withUploadPhotoAction(chatId: ChatId, block: TelegramBotActionCallback<T>) = withAction(chatId, UploadPhotoAction, block)
|
||||
suspend fun <T> TelegramBot.withRecordVideoAction(chatId: ChatId, block: TelegramBotActionCallback<T>) = withAction(chatId, RecordVideoAction, block)
|
||||
suspend fun <T> TelegramBot.withUploadVideoAction(chatId: ChatId, block: TelegramBotActionCallback<T>) = withAction(chatId, UploadVideoAction, block)
|
||||
@Deprecated(
|
||||
"Deprecated according to https://core.telegram.org/bots/api-changelog#april-26-2021",
|
||||
ReplaceWith("withRecordVoiceAction", "dev.inmo.tgbotapi.extensions.api.send.withRecordVoiceAction")
|
||||
)
|
||||
suspend fun <T> TelegramBot.withRecordAudioAction(chatId: ChatId, block: TelegramBotActionCallback<T>) = withAction(chatId, RecordAudioAction, block)
|
||||
@Deprecated(
|
||||
"Deprecated according to https://core.telegram.org/bots/api-changelog#april-26-2021",
|
||||
ReplaceWith("withUploadVoiceAction", "dev.inmo.tgbotapi.extensions.api.send.withUploadVoiceAction")
|
||||
)
|
||||
suspend fun <T> TelegramBot.withUploadAudioAction(chatId: ChatId, block: TelegramBotActionCallback<T>) = withAction(chatId, UploadAudioAction, block)
|
||||
suspend fun <T> TelegramBot.withRecordVoiceAction(chatId: ChatId, block: TelegramBotActionCallback<T>) = withAction(chatId, RecordVoiceAction, block)
|
||||
suspend fun <T> TelegramBot.withUploadVoiceAction(chatId: ChatId, block: TelegramBotActionCallback<T>) = withAction(chatId, UploadVoiceAction, block)
|
||||
suspend fun <T> TelegramBot.withUploadDocumentAction(chatId: ChatId, block: TelegramBotActionCallback<T>) = withAction(chatId, UploadDocumentAction, block)
|
||||
@ -78,16 +68,6 @@ suspend fun <T> TelegramBot.withTypingAction(chat: Chat, block: TelegramBotActio
|
||||
suspend fun <T> TelegramBot.withUploadPhotoAction(chat: Chat, block: TelegramBotActionCallback<T>) = withAction(chat, UploadPhotoAction, block)
|
||||
suspend fun <T> TelegramBot.withRecordVideoAction(chat: Chat, block: TelegramBotActionCallback<T>) = withAction(chat, RecordVideoAction, block)
|
||||
suspend fun <T> TelegramBot.withUploadVideoAction(chat: Chat, block: TelegramBotActionCallback<T>) = withAction(chat, UploadVideoAction, block)
|
||||
@Deprecated(
|
||||
"Deprecated according to https://core.telegram.org/bots/api-changelog#april-26-2021",
|
||||
ReplaceWith("withRecordVoiceAction", "dev.inmo.tgbotapi.extensions.api.send.withRecordVoiceAction")
|
||||
)
|
||||
suspend fun <T> TelegramBot.withRecordAudioAction(chat: Chat, block: TelegramBotActionCallback<T>) = withAction(chat, RecordAudioAction, block)
|
||||
@Deprecated(
|
||||
"Deprecated according to https://core.telegram.org/bots/api-changelog#april-26-2021",
|
||||
ReplaceWith("withUploadVoiceAction", "dev.inmo.tgbotapi.extensions.api.send.withUploadVoiceAction")
|
||||
)
|
||||
suspend fun <T> TelegramBot.withUploadAudioAction(chat: Chat, block: TelegramBotActionCallback<T>) = withAction(chat, UploadAudioAction, block)
|
||||
suspend fun <T> TelegramBot.withRecordVoiceAction(chat: Chat, block: TelegramBotActionCallback<T>) = withAction(chat, RecordVoiceAction, block)
|
||||
suspend fun <T> TelegramBot.withUploadVoiceAction(chat: Chat, block: TelegramBotActionCallback<T>) = withAction(chat, UploadVoiceAction, block)
|
||||
suspend fun <T> TelegramBot.withUploadDocumentAction(chat: Chat, block: TelegramBotActionCallback<T>) = withAction(chat, UploadDocumentAction, block)
|
||||
|
@ -7,6 +7,7 @@ import dev.inmo.tgbotapi.types.*
|
||||
import dev.inmo.tgbotapi.types.CallbackQuery.*
|
||||
import dev.inmo.tgbotapi.types.ChatMember.*
|
||||
import dev.inmo.tgbotapi.types.ChatMember.abstracts.*
|
||||
import dev.inmo.tgbotapi.types.ChatMember.abstracts.MemberChatMember
|
||||
import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.*
|
||||
import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.*
|
||||
import dev.inmo.tgbotapi.types.InlineQueries.InlineQueryResult.abstracts.results.audio.*
|
||||
@ -23,6 +24,8 @@ import dev.inmo.tgbotapi.types.InlineQueries.query.BaseInlineQuery
|
||||
import dev.inmo.tgbotapi.types.InlineQueries.query.LocationInlineQuery
|
||||
import dev.inmo.tgbotapi.types.InputMedia.*
|
||||
import dev.inmo.tgbotapi.types.MessageEntity.textsources.*
|
||||
import dev.inmo.tgbotapi.types.MessageEntity.textsources.MultilevelTextSource
|
||||
import dev.inmo.tgbotapi.types.MessageEntity.textsources.TextSource
|
||||
import dev.inmo.tgbotapi.types.actions.*
|
||||
import dev.inmo.tgbotapi.types.buttons.*
|
||||
import dev.inmo.tgbotapi.types.buttons.InlineKeyboardButtons.*
|
||||
@ -521,10 +524,6 @@ inline fun BotAction.asFindLocationAction(): FindLocationAction? = this as? Find
|
||||
@PreviewFeature
|
||||
inline fun BotAction.requireFindLocationAction(): FindLocationAction = this as FindLocationAction
|
||||
@PreviewFeature
|
||||
inline fun BotAction.asRecordAudioAction(): RecordAudioAction? = this as? RecordAudioAction
|
||||
@PreviewFeature
|
||||
inline fun BotAction.requireRecordAudioAction(): RecordAudioAction = this as RecordAudioAction
|
||||
@PreviewFeature
|
||||
inline fun BotAction.asRecordVoiceAction(): RecordVoiceAction? = this as? RecordVoiceAction
|
||||
@PreviewFeature
|
||||
inline fun BotAction.requireRecordVoiceAction(): RecordVoiceAction = this as RecordVoiceAction
|
||||
@ -541,10 +540,6 @@ inline fun BotAction.asTypingAction(): TypingAction? = this as? TypingAction
|
||||
@PreviewFeature
|
||||
inline fun BotAction.requireTypingAction(): TypingAction = this as TypingAction
|
||||
@PreviewFeature
|
||||
inline fun BotAction.asUploadAudioAction(): UploadAudioAction? = this as? UploadAudioAction
|
||||
@PreviewFeature
|
||||
inline fun BotAction.requireUploadAudioAction(): UploadAudioAction = this as UploadAudioAction
|
||||
@PreviewFeature
|
||||
inline fun BotAction.asUploadVoiceAction(): UploadVoiceAction? = this as? UploadVoiceAction
|
||||
@PreviewFeature
|
||||
inline fun BotAction.requireUploadVoiceAction(): UploadVoiceAction = this as UploadVoiceAction
|
||||
|
@ -55,18 +55,21 @@ fun TextSourcesList.toMarkdownCaptions(): List<String> = createMarkdownText(
|
||||
this,
|
||||
captionLength.last
|
||||
)
|
||||
|
||||
fun CaptionedInput.toMarkdownCaptions(): List<String> = textSources.toMarkdownCaptions()
|
||||
|
||||
fun TextSourcesList.toMarkdownTexts(): List<String> = createMarkdownText(
|
||||
this,
|
||||
textLength.last
|
||||
)
|
||||
|
||||
fun TextContent.toMarkdownTexts(): List<String> = textSources.toMarkdownTexts()
|
||||
|
||||
fun TextSourcesList.toMarkdownExplanations(): List<String> = createMarkdownText(
|
||||
this,
|
||||
explanationLimit.last
|
||||
)
|
||||
|
||||
fun ExplainedInput.toMarkdownExplanations(): List<String> = textSources.toMarkdownTexts()
|
||||
|
||||
|
||||
@ -79,18 +82,21 @@ fun TextSourcesList.toMarkdownV2Captions(): List<String> = createMarkdownV2Text(
|
||||
this,
|
||||
captionLength.last
|
||||
)
|
||||
|
||||
fun CaptionedInput.toMarkdownV2Captions(): List<String> = textSources.toMarkdownV2Captions()
|
||||
|
||||
fun TextSourcesList.toMarkdownV2Texts(): List<String> = createMarkdownV2Text(
|
||||
this,
|
||||
textLength.last
|
||||
)
|
||||
|
||||
fun TextContent.toMarkdownV2Texts(): List<String> = textSources.toMarkdownV2Texts()
|
||||
|
||||
fun TextSourcesList.toMarkdownV2Explanations(): List<String> = createMarkdownV2Text(
|
||||
this,
|
||||
explanationLimit.last
|
||||
)
|
||||
|
||||
fun ExplainedInput.toMarkdownV2Explanations(): List<String> = textSources.toMarkdownV2Texts()
|
||||
|
||||
|
||||
@ -103,18 +109,21 @@ fun TextSourcesList.toHtmlCaptions(): List<String> = createHtmlText(
|
||||
this,
|
||||
captionLength.last
|
||||
)
|
||||
|
||||
fun CaptionedInput.toHtmlCaptions(): List<String> = textSources.toHtmlCaptions()
|
||||
|
||||
fun TextSourcesList.toHtmlTexts(): List<String> = createHtmlText(
|
||||
this,
|
||||
textLength.last
|
||||
)
|
||||
|
||||
fun TextContent.toHtmlTexts(): List<String> = textSources.toHtmlTexts()
|
||||
|
||||
fun TextSourcesList.toHtmlExplanations(): List<String> = createHtmlText(
|
||||
this,
|
||||
explanationLimit.last
|
||||
)
|
||||
|
||||
fun ExplainedInput.toHtmlExplanations(): List<String> = textSources.toHtmlTexts()
|
||||
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user