mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2025-11-19 05:45:40 +00:00
Compare commits
61 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| dafd0a8ece | |||
| bee9d82372 | |||
| ec6cf0f029 | |||
| 9cee22165d | |||
| a58aad1198 | |||
| aa78d99179 | |||
| 603efe9259 | |||
| 21e3e10222 | |||
| 34eb6eb4bf | |||
| 565a724b9c | |||
| e87c4a0126 | |||
| 9b16d5d82b | |||
| 9747c8bff1 | |||
| 3ee84700f4 | |||
| 04a463f42c | |||
| 668a201789 | |||
| b336b17eef | |||
| 76b25d719a | |||
| a4d077dd17 | |||
| 469712150b | |||
| fad27ede78 | |||
| 1de90412b3 | |||
| 215c8793e1 | |||
| 54835f97d1 | |||
| 923e929670 | |||
| 37488e92e6 | |||
| 830ca8122d | |||
| fbb2758bdb | |||
| a5c3e06f1c | |||
| c6fb50c4a6 | |||
| 976c0b86dc | |||
| fee5d8f925 | |||
| 808746e12d | |||
| 3fb80dd475 | |||
| db8ea0da94 | |||
| fbdfb714a3 | |||
| 1facfbc2b7 | |||
| 914a0662a9 | |||
| eda3003b7d | |||
| 459942de36 | |||
| 17f64f9b48 | |||
| 3f896c2240 | |||
| 94f8c971c5 | |||
| c43109c063 | |||
| f6058e29b4 | |||
| 3a37311331 | |||
| 9fe1472e64 | |||
| f1480c40a7 | |||
| 88eebdc448 | |||
| 8c76283db5 | |||
| 7668c48081 | |||
| 35d2135f73 | |||
| 1cb0e096be | |||
| 31f7c7f31b | |||
| 82d3b3bc48 | |||
| b3734a5c2a | |||
| 55b8736d50 | |||
| 3334fd3ca6 | |||
|
|
e2416b405a | ||
| 14f012fbfa | |||
| 1ff55057f2 |
108
CHANGELOG.md
108
CHANGELOG.md
@@ -1,5 +1,87 @@
|
|||||||
# TelegramBotAPI changelog
|
# TelegramBotAPI changelog
|
||||||
|
|
||||||
|
## 0.27.0
|
||||||
|
|
||||||
|
* `Common`:
|
||||||
|
* Versions updates:
|
||||||
|
* `Kotlin`: `1.3.71` -> `1.3.72`
|
||||||
|
* `Klock`: `1.10.3` -> `1.10.5`
|
||||||
|
* `TelegramBotAPI`:
|
||||||
|
* Typealias `LongSeconds` was added for correct explanation of seconds in `Long` primitive type
|
||||||
|
* Several new fields was added:
|
||||||
|
* `explanationField`
|
||||||
|
* `explanationEntitiesField`
|
||||||
|
* `openPeriodField`
|
||||||
|
* `closeDateField`
|
||||||
|
* Extension `List<TextPart>#justTextSources` was added for mapping of `List<TextPart>` to `List<TextSource>`
|
||||||
|
* Field `SendPoll#closeInfo` was added
|
||||||
|
* Range `openPeriodPollSecondsLimit` was added and used in all `SendPoll` requests for checking income data
|
||||||
|
* `SendQuizPoll` now able to use fields `caption` and `parseMode` for `explanation` functionality
|
||||||
|
* `quizPollExplanationLimit` was added for checking `QuizPoll` explanation size
|
||||||
|
* Field `TextLinkTextSource#url` was added
|
||||||
|
* Field `TextMentionTextSource#user` was added
|
||||||
|
* Sealed class `ScheduledCloseInfo` was added
|
||||||
|
* Class `ExactScheduledCloseInfo` was added for cases with `close_date`
|
||||||
|
* Class `ApproximateScheduledCloseInfo` was added for cases with `open_period`
|
||||||
|
* Field `Poll#scheduledCloseInfo` was added
|
||||||
|
* Sealed class `MultipleAnswersPoll` was added
|
||||||
|
* Class `RegularPoll` now extends `MultipleAnswersPoll`
|
||||||
|
* `Dice` class was replaced into new package
|
||||||
|
* Sealed class `DiceAnimationType` was added
|
||||||
|
* Field `Dice#animationType` was added as `emoji` API representation
|
||||||
|
* `SendDice` now receive `animationType` as second parameter
|
||||||
|
* For `List<TextSource>` was added several extensions:
|
||||||
|
* `toMarkdownCaptions`
|
||||||
|
* `toMarkdownTexts`
|
||||||
|
* `toMarkdownV2Captions`
|
||||||
|
* `toMarkdownV2Texts`
|
||||||
|
* `toHtmlCaptions`
|
||||||
|
* `toHtmlTexts`
|
||||||
|
* `TelegramBotAPI-extensions-api`:
|
||||||
|
* All `RequestsExecutor#sendDice` extensions now accept `DiceAnimationType?` as second parameter
|
||||||
|
* All `RequestsExecutor#sendRegularPoll` extensions now accept `ScheduledCloseInfo` fourth parameter
|
||||||
|
* All `RequestsExecutor#sendQuizPoll` extensions now accept additional parameters `caption: String` and
|
||||||
|
`parseMode: ParseMode` for `explanation` functionality and `closeInfo: ScheduledCloseInfo?` for autoclose poll
|
||||||
|
functionality
|
||||||
|
* `TelegramBotAPI-extensions-utils`:
|
||||||
|
* Several shortcuts for `ScheduledCloseInfo` was added:
|
||||||
|
* `closePollExactAt`
|
||||||
|
* `closePollExactAfter`
|
||||||
|
* `closePollAfter`
|
||||||
|
|
||||||
|
### 0.27.2
|
||||||
|
|
||||||
|
* `Common`:
|
||||||
|
* Versions:
|
||||||
|
* Coroutines: `1.3.5` -> `1.3.6`
|
||||||
|
* Klock: `1.10.5` -> `1.11.1`
|
||||||
|
* `TelegramBotAPI`:
|
||||||
|
* Expected class `MimeType` was added
|
||||||
|
* Field `MimeTyped#mimeType` now typed by `MimeType` instead of `String`
|
||||||
|
* `MediaGroupMemberInputMedia` children now can be deserialized (but only those ones who are declared inside library)
|
||||||
|
* `TelegramBotAPI-extensions-utils`:
|
||||||
|
* Chat events splitters added:
|
||||||
|
* Extension `Flow<ChatEventMessage>#onlyChannelEvents` was added
|
||||||
|
* Extension `Flow<ChatEventMessage>#onlyGroupEvents` was added
|
||||||
|
* Extension `Flow<ChatEventMessage>#onlySupergroupEvents` was added
|
||||||
|
|
||||||
|
### 0.27.1
|
||||||
|
|
||||||
|
* `TelegramBotAPI`:
|
||||||
|
* Interface `Explained` and subsinterfaces `ExplainedInput` and `ExplainedOutput` was added
|
||||||
|
* Class `QuizPoll` now implement `ExplainedInput`
|
||||||
|
* In `QuizPoll#caption` and `QuizPoll#captionEntities` are deprecated now
|
||||||
|
* Class `SendQuizPoll` now implement `ExplainedOutput`
|
||||||
|
* In `SendQuizPoll#caption` is deprecated now
|
||||||
|
* `explanationLimit` range was added as future replacement of `quizPollExplanationLimit`
|
||||||
|
* `quizPollExplanationLimit` now is deprecated
|
||||||
|
* Extensions `toMarkdownExplanations`, `toMarkdownV2Explanations` and `toHtmlExplanations` was added
|
||||||
|
* Typealias `FullTextSourcesList` was added
|
||||||
|
* All extensions `fullEntitiesList` now return `FullTextSourcesList`
|
||||||
|
* All extensions of `List<TextSource>` now are extensions for `FullTextSourcesList`
|
||||||
|
* `TelegramBotAPI-extensions-api`:
|
||||||
|
* `sendQuizPoll` now is using `explanation` parameter instead of `caption`
|
||||||
|
|
||||||
## 0.26.0
|
## 0.26.0
|
||||||
|
|
||||||
* `Common`:
|
* `Common`:
|
||||||
@@ -38,6 +120,32 @@
|
|||||||
and size of retrieved updates is equal to 100 (max count of retrieved updates)
|
and size of retrieved updates is equal to 100 (max count of retrieved updates)
|
||||||
* Extensions `getUpdates` now will receive only not nullable `limit` parameter
|
* Extensions `getUpdates` now will receive only not nullable `limit` parameter
|
||||||
|
|
||||||
|
### 0.26.4
|
||||||
|
|
||||||
|
* `TelegramBotAPI`:
|
||||||
|
* Now any getting of updates will return `UnknownUpdateType` when inside of deserialization will be
|
||||||
|
`SerializationException` or `NotImplemented` error
|
||||||
|
* `CallbackGame` currently is an object
|
||||||
|
* It is possible to use `CallbackGame` for now
|
||||||
|
* `CallbackGameInlineKeyboardButton` now will not accept `callbackGame` as income object
|
||||||
|
* Now it is possible to pass exception handler in webhook
|
||||||
|
|
||||||
|
### 0.26.3
|
||||||
|
|
||||||
|
* `TelegramBotAPI`:
|
||||||
|
* `CallbackGameInlineKeyboardButton` was added
|
||||||
|
([Issue-79](https://github.com/InsanusMokrassar/TelegramBotAPI/issues/79),
|
||||||
|
[PR-80](https://github.com/InsanusMokrassar/TelegramBotAPI/pull/80))
|
||||||
|
* `UnknownInlineKeyboardButton` was added. It is unavailable for creating, but you can receive it, for example, in
|
||||||
|
`InlineQueryResult`
|
||||||
|
* `Update` now will be created even if was `SerializationException` inside of creating the update instance - in this
|
||||||
|
case will be created `UnknownUpdateType`
|
||||||
|
* `UnknownUpdateType$rawJson` value now is included (`JsonElement`)
|
||||||
|
* **EXPERIMENTALLY** `BaseEditMessageUpdate#data` now is `CommonMessage<*>`
|
||||||
|
* Suspend inline function `handleSafely` was added
|
||||||
|
* `KtorRequestsExecutor` now use `handleSafely` instead of `try` with `supervisorScope`
|
||||||
|
* `UpdatesPolling` now use `handleSafely` instead of `try` with `supervisorScope`
|
||||||
|
|
||||||
### 0.26.2
|
### 0.26.2
|
||||||
|
|
||||||
* `TelegramBotAPI`:
|
* `TelegramBotAPI`:
|
||||||
|
|||||||
43
README.md
43
README.md
@@ -19,6 +19,47 @@ work with commands, updates and other different things
|
|||||||
Most part of some specific solves or unuseful
|
Most part of some specific solves or unuseful
|
||||||
moments are describing by official [Telegram Bot API](https://core.telegram.org/bots/api).
|
moments are describing by official [Telegram Bot API](https://core.telegram.org/bots/api).
|
||||||
|
|
||||||
|
## JavaScript notes
|
||||||
|
|
||||||
|
In case if you are want to use this library inside of browser, you will need additional settings (thanks for help to [Alexander Nozik](https://research.jetbrains.org/researchers/altavir)):
|
||||||
|
|
||||||
|
<details>
|
||||||
|
<summary>Gradle build script help</summary>
|
||||||
|
|
||||||
|
```groovy
|
||||||
|
dependencies {
|
||||||
|
/* ... */
|
||||||
|
|
||||||
|
implementation "com.github.insanusmokrassar:TelegramBotAPI:$tgbot_api_version"
|
||||||
|
implementation "com.github.insanusmokrassar:TelegramBotAPI-extensions-api:$tgbot_api_version" // optional
|
||||||
|
implementation "com.github.insanusmokrassar:TelegramBotAPI-extensions-utils:$tgbot_api_version" // optional
|
||||||
|
|
||||||
|
/* Block of dependencies for correct building in browser */
|
||||||
|
implementation(npm("fs"))
|
||||||
|
implementation(npm("bufferutil"))
|
||||||
|
implementation(npm("utf-8-validate"))
|
||||||
|
implementation(npm("abort-controller"))
|
||||||
|
implementation(npm("text-encoding"))
|
||||||
|
}
|
||||||
|
|
||||||
|
/* ... */
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
target {
|
||||||
|
browser {
|
||||||
|
/* Block for fix of exception in absence of some functionality, https://github.com/ktorio/ktor/issues/1339 */
|
||||||
|
dceTask {
|
||||||
|
dceOptions {
|
||||||
|
keep("ktor-ktor-io.\$\$importsForInline\$\$.ktor-ktor-io.io.ktor.utils.io")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
```
|
||||||
|
|
||||||
|
</details>
|
||||||
|
|
||||||
## Ok, where should I start?
|
## Ok, where should I start?
|
||||||
|
|
||||||
In most cases, the most simple way will be to implement
|
In most cases, the most simple way will be to implement
|
||||||
@@ -31,5 +72,5 @@ Anyway, all libraries are very typical inside of them. Examples:
|
|||||||
|
|
||||||
* In `TelegramBotAPI` common request look like `requestsExecutor.execute(SomeRequest())`
|
* In `TelegramBotAPI` common request look like `requestsExecutor.execute(SomeRequest())`
|
||||||
* `TelegramBotAPI-extensions-api` typical syntax look like `requestsExecutor.someRequest()` (in most cases it would be
|
* `TelegramBotAPI-extensions-api` typical syntax look like `requestsExecutor.someRequest()` (in most cases it would be
|
||||||
better to understand to use `bot` name instead of `requestsExecutor`)
|
better to use `bot` name instead of `requestsExecutor`)
|
||||||
* `TelegramBotAPI-extensions-utils` will look like `filter.filterBaseMessageUpdates(chatId).filterExactCommands(Regex("^.*$"))...`
|
* `TelegramBotAPI-extensions-utils` will look like `filter.filterBaseMessageUpdates(chatId).filterExactCommands(Regex("^.*$"))...`
|
||||||
|
|||||||
@@ -6,19 +6,22 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
|
|||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier
|
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
|
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
|
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.types.dice.DiceAnimationType
|
||||||
|
|
||||||
suspend fun RequestsExecutor.sendDice(
|
suspend fun RequestsExecutor.sendDice(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
|
animationType: DiceAnimationType? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendDice(chatId, disableNotification, replyToMessageId, replyMarkup)
|
SendDice(chatId, animationType, disableNotification, replyToMessageId, replyMarkup)
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun RequestsExecutor.sendDice(
|
suspend fun RequestsExecutor.sendDice(
|
||||||
chat: Chat,
|
chat: Chat,
|
||||||
|
animationType: DiceAnimationType? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendDice(chat.id, disableNotification, replyToMessageId, replyMarkup)
|
) = sendDice(chat.id, animationType, disableNotification, replyToMessageId, replyMarkup)
|
||||||
|
|||||||
@@ -5,10 +5,10 @@ import com.github.insanusmokrassar.TelegramBotAPI.requests.send.polls.SendQuizPo
|
|||||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.polls.SendRegularPoll
|
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.polls.SendRegularPoll
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
|
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier
|
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
|
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
|
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.polls.QuizPoll
|
import com.github.insanusmokrassar.TelegramBotAPI.types.polls.*
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.polls.RegularPoll
|
|
||||||
|
|
||||||
suspend fun RequestsExecutor.sendRegularPoll(
|
suspend fun RequestsExecutor.sendRegularPoll(
|
||||||
chatId: ChatIdentifier,
|
chatId: ChatIdentifier,
|
||||||
@@ -17,12 +17,13 @@ suspend fun RequestsExecutor.sendRegularPoll(
|
|||||||
isAnonymous: Boolean = true,
|
isAnonymous: Boolean = true,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
allowMultipleAnswers: Boolean = false,
|
allowMultipleAnswers: Boolean = false,
|
||||||
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendRegularPoll(
|
SendRegularPoll(
|
||||||
chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, disableNotification, replyToMessageId, replyMarkup
|
chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, disableNotification, replyToMessageId, replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
suspend fun RequestsExecutor.sendRegularPoll(
|
suspend fun RequestsExecutor.sendRegularPoll(
|
||||||
@@ -33,12 +34,13 @@ suspend fun RequestsExecutor.sendRegularPoll(
|
|||||||
options: List<String> = poll.options.map { it.text },
|
options: List<String> = poll.options.map { it.text },
|
||||||
isAnonymous: Boolean = poll.isAnonymous,
|
isAnonymous: Boolean = poll.isAnonymous,
|
||||||
allowMultipleAnswers: Boolean = poll.allowMultipleAnswers,
|
allowMultipleAnswers: Boolean = poll.allowMultipleAnswers,
|
||||||
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendRegularPoll(
|
SendRegularPoll(
|
||||||
chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, disableNotification, replyToMessageId, replyMarkup
|
chatId, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, disableNotification, replyToMessageId, replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -49,11 +51,12 @@ suspend fun RequestsExecutor.sendRegularPoll(
|
|||||||
isAnonymous: Boolean = true,
|
isAnonymous: Boolean = true,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
allowMultipleAnswers: Boolean = false,
|
allowMultipleAnswers: Boolean = false,
|
||||||
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendRegularPoll(
|
) = sendRegularPoll(
|
||||||
chat.id, question, options, isAnonymous, isClosed, allowMultipleAnswers, disableNotification, replyToMessageId, replyMarkup
|
chat.id, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, disableNotification, replyToMessageId, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun RequestsExecutor.sendRegularPoll(
|
suspend fun RequestsExecutor.sendRegularPoll(
|
||||||
@@ -64,11 +67,12 @@ suspend fun RequestsExecutor.sendRegularPoll(
|
|||||||
options: List<String> = poll.options.map { it.text },
|
options: List<String> = poll.options.map { it.text },
|
||||||
isAnonymous: Boolean = poll.isAnonymous,
|
isAnonymous: Boolean = poll.isAnonymous,
|
||||||
allowMultipleAnswers: Boolean = poll.allowMultipleAnswers,
|
allowMultipleAnswers: Boolean = poll.allowMultipleAnswers,
|
||||||
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendRegularPoll(
|
) = sendRegularPoll(
|
||||||
chat.id, question, options, isAnonymous, isClosed, allowMultipleAnswers, disableNotification, replyToMessageId, replyMarkup
|
chat.id, question, options, isAnonymous, isClosed, allowMultipleAnswers, closeInfo, disableNotification, replyToMessageId, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|
||||||
@@ -79,12 +83,15 @@ suspend fun RequestsExecutor.sendQuizPoll(
|
|||||||
correctOptionId: Int,
|
correctOptionId: Int,
|
||||||
isAnonymous: Boolean = true,
|
isAnonymous: Boolean = true,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
|
explanation: String? = null,
|
||||||
|
parseMode: ParseMode? = null,
|
||||||
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendQuizPoll(
|
SendQuizPoll(
|
||||||
chatId, question, options, correctOptionId, isAnonymous, isClosed, disableNotification, replyToMessageId, replyMarkup
|
chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, disableNotification, replyToMessageId, replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -95,11 +102,14 @@ suspend fun RequestsExecutor.sendQuizPoll(
|
|||||||
correctOptionId: Int,
|
correctOptionId: Int,
|
||||||
isAnonymous: Boolean = true,
|
isAnonymous: Boolean = true,
|
||||||
isClosed: Boolean = false,
|
isClosed: Boolean = false,
|
||||||
|
explanation: String? = null,
|
||||||
|
parseMode: ParseMode? = null,
|
||||||
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(
|
) = sendQuizPoll(
|
||||||
chat.id, question, options, correctOptionId, isAnonymous, isClosed, disableNotification, replyToMessageId, replyMarkup
|
chat.id, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, disableNotification, replyToMessageId, replyMarkup
|
||||||
)
|
)
|
||||||
|
|
||||||
suspend fun RequestsExecutor.sendQuizPoll(
|
suspend fun RequestsExecutor.sendQuizPoll(
|
||||||
@@ -110,12 +120,15 @@ suspend fun RequestsExecutor.sendQuizPoll(
|
|||||||
options: List<String> = quizPoll.options.map { it.text },
|
options: List<String> = quizPoll.options.map { it.text },
|
||||||
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
|
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
|
||||||
isAnonymous: Boolean = quizPoll.isAnonymous,
|
isAnonymous: Boolean = quizPoll.isAnonymous,
|
||||||
|
explanation: String? = null,
|
||||||
|
parseMode: ParseMode? = null,
|
||||||
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = execute(
|
) = execute(
|
||||||
SendQuizPoll(
|
SendQuizPoll(
|
||||||
chatId, question, options, correctOptionId, isAnonymous, isClosed, disableNotification, replyToMessageId, replyMarkup
|
chatId, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, disableNotification, replyToMessageId, replyMarkup
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
@@ -127,9 +140,12 @@ suspend fun RequestsExecutor.sendQuizPoll(
|
|||||||
options: List<String> = quizPoll.options.map { it.text },
|
options: List<String> = quizPoll.options.map { it.text },
|
||||||
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
|
correctOptionId: Int = quizPoll.correctOptionId ?: error("Correct option ID must be provided by income QuizPoll or by developer"),
|
||||||
isAnonymous: Boolean = quizPoll.isAnonymous,
|
isAnonymous: Boolean = quizPoll.isAnonymous,
|
||||||
|
explanation: String? = null,
|
||||||
|
parseMode: ParseMode? = null,
|
||||||
|
closeInfo: ScheduledCloseInfo? = null,
|
||||||
disableNotification: Boolean = false,
|
disableNotification: Boolean = false,
|
||||||
replyToMessageId: MessageIdentifier? = null,
|
replyToMessageId: MessageIdentifier? = null,
|
||||||
replyMarkup: KeyboardMarkup? = null
|
replyMarkup: KeyboardMarkup? = null
|
||||||
) = sendQuizPoll(
|
) = sendQuizPoll(
|
||||||
chat.id, question, options, correctOptionId, isAnonymous, isClosed, disableNotification, replyToMessageId, replyMarkup
|
chat.id, question, options, correctOptionId, isAnonymous, isClosed, explanation, parseMode, closeInfo, disableNotification, replyToMessageId, replyMarkup
|
||||||
)
|
)
|
||||||
|
|||||||
@@ -11,7 +11,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.update.MediaGroupUpdates
|
|||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.Update
|
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.Update
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.updateshandlers.*
|
import com.github.insanusmokrassar.TelegramBotAPI.updateshandlers.*
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.utils.PreviewFeature
|
import com.github.insanusmokrassar.TelegramBotAPI.utils.PreviewFeature
|
||||||
import io.ktor.client.features.HttpRequestTimeoutException
|
import com.github.insanusmokrassar.TelegramBotAPI.utils.handleSafely
|
||||||
import kotlinx.coroutines.*
|
import kotlinx.coroutines.*
|
||||||
|
|
||||||
fun RequestsExecutor.startGettingOfUpdates(
|
fun RequestsExecutor.startGettingOfUpdates(
|
||||||
@@ -24,8 +24,14 @@ fun RequestsExecutor.startGettingOfUpdates(
|
|||||||
var lastUpdateIdentifier: UpdateIdentifier? = null
|
var lastUpdateIdentifier: UpdateIdentifier? = null
|
||||||
|
|
||||||
while (isActive) {
|
while (isActive) {
|
||||||
try {
|
handleSafely(
|
||||||
supervisorScope {
|
{ e ->
|
||||||
|
exceptionsHandler ?.invoke(e)
|
||||||
|
if (e is RequestException) {
|
||||||
|
delay(1000L)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
) {
|
||||||
val updates = getUpdates(
|
val updates = getUpdates(
|
||||||
offset = lastUpdateIdentifier?.plus(1),
|
offset = lastUpdateIdentifier?.plus(1),
|
||||||
timeout = timeoutSeconds,
|
timeout = timeoutSeconds,
|
||||||
@@ -45,7 +51,7 @@ fun RequestsExecutor.startGettingOfUpdates(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
supervisorScope {
|
handleSafely {
|
||||||
for (update in updates) {
|
for (update in updates) {
|
||||||
updatesReceiver(update)
|
updatesReceiver(update)
|
||||||
|
|
||||||
@@ -53,14 +59,6 @@ fun RequestsExecutor.startGettingOfUpdates(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e: HttpRequestTimeoutException) {
|
|
||||||
exceptionsHandler ?.invoke(e) // it is ok due to mechanism of long polling
|
|
||||||
} catch (e: RequestException) {
|
|
||||||
exceptionsHandler ?.invoke(e) // it is not ok, but in most cases it will mean that there is some limit for requests count
|
|
||||||
delay(1000L)
|
|
||||||
} catch (e: Exception) {
|
|
||||||
exceptionsHandler ?.invoke(e)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -70,7 +68,9 @@ fun RequestsExecutor.startGettingOfUpdates(
|
|||||||
* [kotlinx.coroutines.flow.Flow.collect] on one of [FlowsUpdatesFilter] flows. To avoid it, you can pass
|
* [kotlinx.coroutines.flow.Flow.collect] on one of [FlowsUpdatesFilter] flows. To avoid it, you can pass
|
||||||
* [flowUpdatesPreset] lambda - it will be called BEFORE starting updates getting
|
* [flowUpdatesPreset] lambda - it will be called BEFORE starting updates getting
|
||||||
*/
|
*/
|
||||||
|
@FlowPreview
|
||||||
@PreviewFeature
|
@PreviewFeature
|
||||||
|
@Suppress("unused")
|
||||||
fun RequestsExecutor.startGettingFlowsUpdates(
|
fun RequestsExecutor.startGettingFlowsUpdates(
|
||||||
timeoutSeconds: Seconds = 30,
|
timeoutSeconds: Seconds = 30,
|
||||||
scope: CoroutineScope = CoroutineScope(Dispatchers.Default),
|
scope: CoroutineScope = CoroutineScope(Dispatchers.Default),
|
||||||
@@ -139,6 +139,7 @@ fun RequestsExecutor.startGettingOfUpdates(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Suppress("unused")
|
||||||
fun RequestsExecutor.startGettingOfUpdates(
|
fun RequestsExecutor.startGettingOfUpdates(
|
||||||
messageCallback: UpdateReceiver<MessageUpdate>? = null,
|
messageCallback: UpdateReceiver<MessageUpdate>? = null,
|
||||||
mediaGroupCallback: UpdateReceiver<MediaGroupUpdate>? = null,
|
mediaGroupCallback: UpdateReceiver<MediaGroupUpdate>? = null,
|
||||||
|
|||||||
@@ -67,15 +67,102 @@ val filter = bot.startGettingUpdates(
|
|||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Getting of only text incoming messages
|
### Filters
|
||||||
|
|
||||||
|
There are several filters for flows.
|
||||||
|
|
||||||
|
#### Sent messages
|
||||||
|
|
||||||
|
All sent messages can be filtered for three types:
|
||||||
|
|
||||||
|
| Type | Description | Flow extension |
|
||||||
|
|:---- |:----------- |:-------------- |
|
||||||
|
| Common messages | Simple messages with text, media, location, etc. | `asContentMessagesFlow` |
|
||||||
|
| Chat actions | New chat member, rename of chat, etc. | `asChatEventsFlow` |
|
||||||
|
| Unknown events | Any other messages, that contain unsupported data | `asUnknownMessagesFlow` |
|
||||||
|
|
||||||
|
##### Common messages
|
||||||
|
|
||||||
|
Unfortunately, due to the erasing of generic types, when you are using `asContentMessagesFlow` you will retrieve
|
||||||
|
data with type `ContentMessage<*>`. For correct filtering of content type for retrieved objects, was created special
|
||||||
|
filters:
|
||||||
|
|
||||||
|
| Content type | Result type | Flow extension |
|
||||||
|
|:---- |:----------- |:-------------- |
|
||||||
|
| Animation | `ContentMessage<AnimationContent>`| `onlyAnimationContentMessages` |
|
||||||
|
| Audio | `ContentMessage<AudioContent>` | `onlyAudioContentMessages` |
|
||||||
|
| Contact | `ContentMessage<ContactContent>` | `onlyContactContentMessages` |
|
||||||
|
| Dice | `ContentMessage<DiceContent>` | `onlyDiceContentMessages` |
|
||||||
|
| Document | `ContentMessage<DocumentContent>` | `onlyDocumentContentMessages` |
|
||||||
|
| Game | `ContentMessage<GameContent>` | `onlyGameContentMessages` |
|
||||||
|
| Invoice | `ContentMessage<InvoiceContent>` | `onlyInvoiceContentMessages` |
|
||||||
|
| Location | `ContentMessage<LocationContent>` | `onlyLocationContentMessages` |
|
||||||
|
| Photo | `ContentMessage<PhotoContent>` | `onlyPhotoContentMessages` |
|
||||||
|
| Poll | `ContentMessage<PollContent>` | `onlyPollContentMessages` |
|
||||||
|
| Sticker | `ContentMessage<StickerContent>` | `onlyStickerContentMessages` |
|
||||||
|
| Text | `ContentMessage<TextContent>` | `onlyTextContentMessages` |
|
||||||
|
| Venue | `ContentMessage<VenueContent>` | `onlyVenueContentMessages` |
|
||||||
|
| Video | `ContentMessage<VideoContent>` | `onlyVideoContentMessages` |
|
||||||
|
| VideoNote | `ContentMessage<VideoNoteContent>` | `onlyVideoNoteContentMessages` |
|
||||||
|
| Voice | `ContentMessage<VoiceContent>` | `onlyVoiceContentMessages` |
|
||||||
|
|
||||||
|
For example, if you wish to get only photo messages from private chats of groups, you should call next code:
|
||||||
|
|
||||||
```kotlin
|
```kotlin
|
||||||
filter.asContentMessagesFlow().onlyTextContentMessages().onEach {
|
filter.messageFlow.asContentMessagesFlow().onlyPhotoContentMessages().onEach {
|
||||||
println(it.content)
|
println(it.content)
|
||||||
println(it.fullEntitiesList())
|
|
||||||
}.launchIn(
|
}.launchIn(
|
||||||
CoroutineScope(Dispatchers.Default)
|
CoroutineScope(Dispatchers.Default)
|
||||||
)
|
)
|
||||||
```
|
```
|
||||||
|
|
||||||
As a result, each received message which will be just text message will be printed out with full list of its internal entities
|
##### Chat actions
|
||||||
|
|
||||||
|
Chat actions can be divided for three types of events source:
|
||||||
|
|
||||||
|
| Type | Flow extension |
|
||||||
|
|:---- |:-------------- |
|
||||||
|
| Channel events | `onlyChannelEvents` |
|
||||||
|
| Group events | `onlyGroupEvents` |
|
||||||
|
| Supergroup events | `onlySupergroupEvents` |
|
||||||
|
|
||||||
|
According to this table, if you want to add filtering by supergroup events, you will use code like this:
|
||||||
|
|
||||||
|
```kotlin
|
||||||
|
filter.messageFlow.asChatEventsFlow().onlySupergroupEvents().onEach {
|
||||||
|
println(it.chatEvent)
|
||||||
|
}.launchIn(
|
||||||
|
CoroutineScope(Dispatchers.Default)
|
||||||
|
)
|
||||||
|
```
|
||||||
|
|
||||||
|
## Shortcuts
|
||||||
|
|
||||||
|
With shortcuts you are able to use simple factories for several things.
|
||||||
|
|
||||||
|
### ScheduledCloseInfo
|
||||||
|
|
||||||
|
In case if you are creating some poll, you able to use next shortcuts.
|
||||||
|
|
||||||
|
Next sample will use info with closing at the 10 seconds after now:
|
||||||
|
|
||||||
|
```kotlin
|
||||||
|
closePollExactAt(DateTime.now() + TimeSpan(10000.0))
|
||||||
|
```
|
||||||
|
|
||||||
|
In this example we will do the same, but in another way:
|
||||||
|
|
||||||
|
```kotlin
|
||||||
|
closePollExactAfter(10)
|
||||||
|
```
|
||||||
|
|
||||||
|
Here we have passed `10` seconds and will get the same result object.
|
||||||
|
|
||||||
|
In opposite to previous shortcuts, the next one will create `approximate` closing schedule:
|
||||||
|
|
||||||
|
```kotlin
|
||||||
|
closePollAfter(10)
|
||||||
|
```
|
||||||
|
|
||||||
|
The main difference here is that the last one will be closed after 10 seconds since the sending. With first samples
|
||||||
|
will be created **exact** time for closing of poll
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.github.insanusmokrassar.TelegramBotAPI.extensions.utils.chat_events
|
||||||
|
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.*
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.ChatEventMessage
|
||||||
|
import kotlinx.coroutines.flow.Flow
|
||||||
|
import kotlinx.coroutines.flow.mapNotNull
|
||||||
|
import kotlin.reflect.KClass
|
||||||
|
|
||||||
|
|
||||||
|
fun <T : ChatEventMessage> Flow<ChatEventMessage>.divideBySource(contentType: KClass<T>) = mapNotNull {
|
||||||
|
if (contentType.isInstance(it)) {
|
||||||
|
@Suppress("UNCHECKED_CAST")
|
||||||
|
it as T
|
||||||
|
} else {
|
||||||
|
null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fun Flow<ChatEventMessage>.onlyChannelEvents() = divideBySource(ChannelEventMessage::class)
|
||||||
|
fun Flow<ChatEventMessage>.onlyGroupEvents() = divideBySource(GroupEventMessage::class)
|
||||||
|
fun Flow<ChatEventMessage>.onlySupergroupEvents() = divideBySource(SupergroupEventMessage::class)
|
||||||
@@ -0,0 +1,35 @@
|
|||||||
|
package com.github.insanusmokrassar.TelegramBotAPI.extensions.utils.shortcuts
|
||||||
|
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.types.LongSeconds
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.types.Seconds
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.types.polls.ApproximateScheduledCloseInfo
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.types.polls.ExactScheduledCloseInfo
|
||||||
|
import com.soywiz.klock.DateTime
|
||||||
|
import com.soywiz.klock.TimeSpan
|
||||||
|
|
||||||
|
fun closePollExactAt(
|
||||||
|
dateTime: DateTime
|
||||||
|
) = ExactScheduledCloseInfo(
|
||||||
|
dateTime
|
||||||
|
)
|
||||||
|
|
||||||
|
fun closePollExactAfter(
|
||||||
|
seconds: LongSeconds
|
||||||
|
) = closePollExactAt(
|
||||||
|
DateTime.now() + TimeSpan(seconds.toDouble() * 1000L)
|
||||||
|
)
|
||||||
|
fun closePollExactAfter(
|
||||||
|
seconds: Seconds
|
||||||
|
) = closePollExactAfter(
|
||||||
|
seconds.toLong()
|
||||||
|
)
|
||||||
|
|
||||||
|
fun closePollAfter(
|
||||||
|
seconds: LongSeconds
|
||||||
|
) = ApproximateScheduledCloseInfo(
|
||||||
|
TimeSpan(seconds.toDouble() * 1000L)
|
||||||
|
)
|
||||||
|
|
||||||
|
fun closePollAfter(
|
||||||
|
seconds: Seconds
|
||||||
|
) = closePollAfter(seconds.toLong())
|
||||||
@@ -5,12 +5,21 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.update.CallbackQueryUpda
|
|||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.coroutines.flow.mapNotNull
|
import kotlinx.coroutines.flow.mapNotNull
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @return New [Flow] with [DataCallbackQuery] type, got from [CallbackQueryUpdate.data] field
|
||||||
|
*/
|
||||||
fun Flow<CallbackQueryUpdate>.asDataCallbackQueryFlow() = mapNotNull {
|
fun Flow<CallbackQueryUpdate>.asDataCallbackQueryFlow() = mapNotNull {
|
||||||
it.data as? DataCallbackQuery
|
it.data as? DataCallbackQuery
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @return New [Flow] with [GameShortNameCallbackQuery] type, got from [CallbackQueryUpdate.data] field
|
||||||
|
*/
|
||||||
fun Flow<CallbackQueryUpdate>.asGameShortNameCallbackQueryFlow() = mapNotNull {
|
fun Flow<CallbackQueryUpdate>.asGameShortNameCallbackQueryFlow() = mapNotNull {
|
||||||
it.data as? GameShortNameCallbackQuery
|
it.data as? GameShortNameCallbackQuery
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* @return New [Flow] with [UnknownCallbackQueryType] type, got from [CallbackQueryUpdate.data] field
|
||||||
|
*/
|
||||||
fun Flow<CallbackQueryUpdate>.asUnknownCallbackQueryFlow() = mapNotNull {
|
fun Flow<CallbackQueryUpdate>.asUnknownCallbackQueryFlow() = mapNotNull {
|
||||||
it.data as? UnknownCallbackQueryType
|
it.data as? UnknownCallbackQueryType
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,12 +8,37 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.fullEnti
|
|||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.BaseSentMessageUpdate
|
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.BaseSentMessageUpdate
|
||||||
import kotlinx.coroutines.flow.*
|
import kotlinx.coroutines.flow.*
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert incoming [com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.ContentMessage.content] of
|
||||||
|
* messages with [fullEntitiesList] and check that incoming message contains ONLY ONE [TextSource] and that is
|
||||||
|
* [BotCommandTextSource]. Besides, it is checking that [BotCommandTextSource.command] [Regex.matches] with incoming
|
||||||
|
* [commandRegex]
|
||||||
|
*
|
||||||
|
* @return The same message in case if it contains only [BotCommandTextSource] with [Regex.matches]
|
||||||
|
* [BotCommandTextSource.command]
|
||||||
|
*
|
||||||
|
* @see fullEntitiesList
|
||||||
|
* @see asContentMessagesFlow
|
||||||
|
* @see onlyTextContentMessages
|
||||||
|
*/
|
||||||
fun <T : BaseSentMessageUpdate> Flow<T>.filterExactCommands(
|
fun <T : BaseSentMessageUpdate> Flow<T>.filterExactCommands(
|
||||||
commandRegex: Regex
|
commandRegex: Regex
|
||||||
) = asContentMessagesFlow().onlyTextContentMessages().filter { contentMessage ->
|
) = asContentMessagesFlow().onlyTextContentMessages().filter { contentMessage ->
|
||||||
(contentMessage.content.fullEntitiesList().singleOrNull() as? BotCommandTextSource) ?.let { commandRegex.matches(it.command) } == true
|
(contentMessage.content.fullEntitiesList().singleOrNull() as? BotCommandTextSource) ?.let { commandRegex.matches(it.command) } == true
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert incoming [com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.ContentMessage.content] of
|
||||||
|
* messages with [fullEntitiesList] and check that incoming message contains [BotCommandTextSource]. Besides, it is
|
||||||
|
* checking that [BotCommandTextSource.command] [Regex.matches] with incoming [commandRegex]
|
||||||
|
*
|
||||||
|
* @return The same message in case if it contains somewhere in text [BotCommandTextSource] with [Regex.matches]
|
||||||
|
* [BotCommandTextSource.command]
|
||||||
|
*
|
||||||
|
* @see fullEntitiesList
|
||||||
|
* @see asContentMessagesFlow
|
||||||
|
* @see onlyTextContentMessages
|
||||||
|
*/
|
||||||
fun <T : BaseSentMessageUpdate> Flow<T>.filterCommandsInsideTextMessages(
|
fun <T : BaseSentMessageUpdate> Flow<T>.filterCommandsInsideTextMessages(
|
||||||
commandRegex: Regex
|
commandRegex: Regex
|
||||||
) = asContentMessagesFlow().onlyTextContentMessages().filter { contentMessage ->
|
) = asContentMessagesFlow().onlyTextContentMessages().filter { contentMessage ->
|
||||||
@@ -23,10 +48,18 @@ fun <T : BaseSentMessageUpdate> Flow<T>.filterCommandsInsideTextMessages(
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return Result [Flow] will emit all [TextSource]s to the collector ONLY IN CASE if first [TextSource] is
|
* Convert incoming [com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.ContentMessage.content] of
|
||||||
* [BotCommandTextSource] and its [BotCommandTextSource.command] is [Regex.matches] to incoming [commandRegex]. Internal
|
* messages with [fullEntitiesList] and check that incoming message contains first [TextSource] as
|
||||||
* behaviour contains next rules: all incoming text sources will be passed as is, [RegularTextSource] will be divided
|
* [BotCommandTextSource]. Besides, it is checking that [BotCommandTextSource.command] [Regex.matches] with incoming
|
||||||
* by " " for several [RegularTextSource] which will contains not empty args without spaces
|
* [commandRegex] and for other [TextSource] objects used next rules: all incoming text sources will be passed as is,
|
||||||
|
* [RegularTextSource] will be split by " " for several [RegularTextSource] which will contains not empty args without
|
||||||
|
* spaces.
|
||||||
|
*
|
||||||
|
* @return Converted list with first entity [BotCommandTextSource] and than all others according to rules in description
|
||||||
|
*
|
||||||
|
* @see fullEntitiesList
|
||||||
|
* @see asContentMessagesFlow
|
||||||
|
* @see onlyTextContentMessages
|
||||||
*/
|
*/
|
||||||
fun <T : BaseSentMessageUpdate> Flow<T>.filterCommandsWithArgs(
|
fun <T : BaseSentMessageUpdate> Flow<T>.filterCommandsWithArgs(
|
||||||
commandRegex: Regex
|
commandRegex: Regex
|
||||||
|
|||||||
@@ -5,14 +5,23 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.BaseSen
|
|||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.coroutines.flow.mapNotNull
|
import kotlinx.coroutines.flow.mapNotNull
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will map incoming [BaseSentMessageUpdate]s to [ContentMessage] from [BaseSentMessageUpdate.data]
|
||||||
|
*/
|
||||||
fun <T : BaseSentMessageUpdate> Flow<T>.asContentMessagesFlow() = mapNotNull {
|
fun <T : BaseSentMessageUpdate> Flow<T>.asContentMessagesFlow() = mapNotNull {
|
||||||
it.data as? ContentMessage<*>
|
it.data as? ContentMessage<*>
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will map incoming [BaseSentMessageUpdate]s to [ChatEventMessage] from [BaseSentMessageUpdate.data]
|
||||||
|
*/
|
||||||
fun <T : BaseSentMessageUpdate> Flow<T>.asChatEventsFlow() = mapNotNull {
|
fun <T : BaseSentMessageUpdate> Flow<T>.asChatEventsFlow() = mapNotNull {
|
||||||
it.data as? ChatEventMessage
|
it.data as? ChatEventMessage
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will map incoming [BaseSentMessageUpdate]s to [UnknownMessageType] from [BaseSentMessageUpdate.data]
|
||||||
|
*/
|
||||||
fun <T : BaseSentMessageUpdate> Flow<T>.asUnknownMessagesFlow() = mapNotNull {
|
fun <T : BaseSentMessageUpdate> Flow<T>.asUnknownMessagesFlow() = mapNotNull {
|
||||||
it.data as? UnknownMessageType
|
it.data as? UnknownMessageType
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,18 +2,30 @@ package com.github.insanusmokrassar.TelegramBotAPI.extensions.utils.updates
|
|||||||
|
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatId
|
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatId
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
|
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.Chat
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.update.MediaGroupUpdates.*
|
import com.github.insanusmokrassar.TelegramBotAPI.types.update.MediaGroupUpdates.SentMediaGroupUpdate
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.BaseMessageUpdate
|
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.BaseMessageUpdate
|
||||||
import kotlinx.coroutines.flow.Flow
|
import kotlinx.coroutines.flow.Flow
|
||||||
import kotlinx.coroutines.flow.filter
|
import kotlinx.coroutines.flow.filter
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [Flow.filter] incoming [BaseMessageUpdate]s by their [ChatId]
|
||||||
|
*/
|
||||||
fun <T : BaseMessageUpdate> Flow<T>.filterBaseMessageUpdates(chatId: ChatId): Flow<T> = filter {
|
fun <T : BaseMessageUpdate> Flow<T>.filterBaseMessageUpdates(chatId: ChatId): Flow<T> = filter {
|
||||||
it.data.chat.id == chatId
|
it.data.chat.id == chatId
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* [Flow.filter] incoming [BaseMessageUpdate]s by their [ChatId] using [Chat.id] of [chat]
|
||||||
|
*/
|
||||||
fun <T : BaseMessageUpdate> Flow<T>.filterBaseMessageUpdates(chat: Chat): Flow<T> = filterBaseMessageUpdates(chat.id)
|
fun <T : BaseMessageUpdate> Flow<T>.filterBaseMessageUpdates(chat: Chat): Flow<T> = filterBaseMessageUpdates(chat.id)
|
||||||
|
|
||||||
|
|
||||||
|
/**
|
||||||
|
* [Flow.filter] incoming [SentMediaGroupUpdate]s by their [ChatId]
|
||||||
|
*/
|
||||||
fun <T : SentMediaGroupUpdate> Flow<T>.filterSentMediaGroupUpdates(chatId: ChatId): Flow<T> = filter {
|
fun <T : SentMediaGroupUpdate> Flow<T>.filterSentMediaGroupUpdates(chatId: ChatId): Flow<T> = filter {
|
||||||
it.data.first().chat.id == chatId
|
it.data.first().chat.id == chatId
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* [Flow.filter] incoming [SentMediaGroupUpdate]s by their [ChatId] using [Chat.id] of [chat]
|
||||||
|
*/
|
||||||
fun <T : SentMediaGroupUpdate> Flow<T>.filterSentMediaGroupUpdates(chat: Chat): Flow<T> = filterSentMediaGroupUpdates(chat.id)
|
fun <T : SentMediaGroupUpdate> Flow<T>.filterSentMediaGroupUpdates(chat: Chat): Flow<T> = filterSentMediaGroupUpdates(chat.id)
|
||||||
|
|||||||
@@ -10,7 +10,7 @@ moments are describing by official [Telegram Bot API](https://core.telegram.org/
|
|||||||
|
|
||||||
## Compatibility
|
## Compatibility
|
||||||
|
|
||||||
This version compatible with [30th of March 2020 update of TelegramBotAPI (version 4.7)](https://core.telegram.org/bots/api#march-30-2020).
|
This version compatible with [24th of April 2020 update of TelegramBotAPI (version 4.8)](https://core.telegram.org/bots/api#april-24-2020).
|
||||||
There is only one exception of implemented functionality - Telegram Passport API, which was presented in
|
There is only one exception of implemented functionality - Telegram Passport API, which was presented in
|
||||||
[August 2018 update of TelegramBotAPI](https://core.telegram.org/bots/api-changelog#august-27-2018) update. It will be implemented
|
[August 2018 update of TelegramBotAPI](https://core.telegram.org/bots/api-changelog#august-27-2018) update. It will be implemented
|
||||||
as soon as possible.
|
as soon as possible.
|
||||||
|
|||||||
@@ -12,7 +12,15 @@ interface CaptionedOutput : Captioned {
|
|||||||
}
|
}
|
||||||
|
|
||||||
interface CaptionedInput : Captioned {
|
interface CaptionedInput : Captioned {
|
||||||
|
/**
|
||||||
|
* Not full list of entities. This list WILL NOT contain [TextPart]s with [com.github.insanusmokrassar.TelegramBotAPI.types.MessageEntity.textsources.RegularTextSource]
|
||||||
|
* @see [CaptionedInput.fullEntitiesList]
|
||||||
|
*/
|
||||||
val captionEntities: List<TextPart>
|
val captionEntities: List<TextPart>
|
||||||
}
|
}
|
||||||
|
|
||||||
fun CaptionedInput.fullEntitiesList() = caption ?.fullListOfSubSource(captionEntities) ?.map { it.source } ?: emptyList()
|
/**
|
||||||
|
* Convert its [CaptionedInput.captionEntities] to list of [com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.TextSource]
|
||||||
|
* with [com.github.insanusmokrassar.TelegramBotAPI.types.MessageEntity.textsources.RegularTextSource]
|
||||||
|
*/
|
||||||
|
fun CaptionedInput.fullEntitiesList(): FullTextSourcesList = caption ?.fullListOfSubSource(captionEntities) ?.map { it.source } ?: emptyList()
|
||||||
|
|||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts
|
||||||
|
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.utils.fullListOfSubSource
|
||||||
|
|
||||||
|
interface Explained {
|
||||||
|
val explanation: String?
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ExplainedOutput : Explained {
|
||||||
|
val parseMode: ParseMode?
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ExplainedInput : Explained {
|
||||||
|
/**
|
||||||
|
* Not full list of entities. This list WILL NOT contain [TextPart]s with [com.github.insanusmokrassar.TelegramBotAPI.types.MessageEntity.textsources.RegularTextSource]
|
||||||
|
* @see [ExplainedInput.fullEntitiesList]
|
||||||
|
*/
|
||||||
|
val explanationEntities: List<TextPart>
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convert its [ExplainedInput.explanationEntities] to list of [com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.TextSource]
|
||||||
|
* with [com.github.insanusmokrassar.TelegramBotAPI.types.MessageEntity.textsources.RegularTextSource]
|
||||||
|
*/
|
||||||
|
fun ExplainedInput.fullEntitiesList(): FullTextSourcesList = explanation ?.fullListOfSubSource(explanationEntities) ?.map { it.source } ?: emptyList()
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts
|
package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts
|
||||||
|
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.utils.MimeType
|
||||||
|
|
||||||
interface MimeTyped {
|
interface MimeTyped {
|
||||||
val mimeType: String? // TODO::replace by something like enum or interface
|
val mimeType: MimeType?
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,8 @@
|
|||||||
package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts
|
package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts
|
||||||
|
|
||||||
|
typealias FullTextSourcesList = List<TextSource>
|
||||||
|
typealias FullTextPartsList = List<TextPart>
|
||||||
|
|
||||||
interface TextSource {
|
interface TextSource {
|
||||||
val asMarkdownSource: String
|
val asMarkdownSource: String
|
||||||
val asMarkdownV2Source: String
|
val asMarkdownV2Source: String
|
||||||
@@ -16,3 +19,5 @@ data class TextPart(
|
|||||||
val range: IntRange,
|
val range: IntRange,
|
||||||
val source: TextSource
|
val source: TextSource
|
||||||
)
|
)
|
||||||
|
|
||||||
|
fun List<TextPart>.justTextSources() = map { it.source }
|
||||||
|
|||||||
@@ -9,15 +9,13 @@ import com.github.insanusmokrassar.TelegramBotAPI.bot.settings.limiters.RequestL
|
|||||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.Request
|
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.Request
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.Response
|
import com.github.insanusmokrassar.TelegramBotAPI.types.Response
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.RetryAfterError
|
import com.github.insanusmokrassar.TelegramBotAPI.types.RetryAfterError
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.utils.TelegramAPIUrlsKeeper
|
import com.github.insanusmokrassar.TelegramBotAPI.utils.*
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.utils.nonstrictJsonFormat
|
|
||||||
import io.ktor.client.HttpClient
|
import io.ktor.client.HttpClient
|
||||||
import io.ktor.client.call.receive
|
import io.ktor.client.call.receive
|
||||||
import io.ktor.client.features.*
|
import io.ktor.client.features.*
|
||||||
import io.ktor.client.statement.HttpStatement
|
import io.ktor.client.statement.HttpStatement
|
||||||
import io.ktor.client.statement.readText
|
import io.ktor.client.statement.readText
|
||||||
import kotlinx.coroutines.delay
|
import kotlinx.coroutines.delay
|
||||||
import kotlinx.coroutines.supervisorScope
|
|
||||||
import kotlinx.serialization.json.Json
|
import kotlinx.serialization.json.Json
|
||||||
|
|
||||||
class KtorRequestsExecutor(
|
class KtorRequestsExecutor(
|
||||||
@@ -43,8 +41,21 @@ class KtorRequestsExecutor(
|
|||||||
}
|
}
|
||||||
|
|
||||||
override suspend fun <T : Any> execute(request: Request<T>): T {
|
override suspend fun <T : Any> execute(request: Request<T>): T {
|
||||||
return try {
|
return handleSafely(
|
||||||
supervisorScope {
|
{ e ->
|
||||||
|
throw if (e is ClientRequestException) {
|
||||||
|
val content = e.response.readText()
|
||||||
|
val responseObject = jsonFormatter.parse(Response.serializer(), content)
|
||||||
|
newRequestException(
|
||||||
|
responseObject,
|
||||||
|
content,
|
||||||
|
"Can't get result object from $content"
|
||||||
|
)
|
||||||
|
} else {
|
||||||
|
e
|
||||||
|
}
|
||||||
|
}
|
||||||
|
) {
|
||||||
requestsLimiter.limit {
|
requestsLimiter.limit {
|
||||||
var statement: HttpStatement? = null
|
var statement: HttpStatement? = null
|
||||||
for (factory in callsFactories) {
|
for (factory in callsFactories) {
|
||||||
@@ -81,17 +92,6 @@ class KtorRequestsExecutor(
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
} catch (e: ClientRequestException) {
|
|
||||||
val content = e.response.readText()
|
|
||||||
val responseObject = jsonFormatter.parse(Response.serializer(), content)
|
|
||||||
throw newRequestException(
|
|
||||||
responseObject,
|
|
||||||
content,
|
|
||||||
"Can't get result object from $content"
|
|
||||||
)
|
|
||||||
} catch (e: Exception) {
|
|
||||||
throw e
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun close() {
|
override fun close() {
|
||||||
|
|||||||
@@ -3,12 +3,12 @@ package com.github.insanusmokrassar.TelegramBotAPI.requests
|
|||||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
|
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.SimpleRequest
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.Update
|
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.Update
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.UpdateSerializerWithoutDeserialization
|
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.UpdateSerializerWithoutSerialization
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.*
|
||||||
import kotlinx.serialization.builtins.ListSerializer
|
import kotlinx.serialization.builtins.ListSerializer
|
||||||
|
|
||||||
private val updatesListSerializer = ListSerializer(
|
private val updatesListSerializer = ListSerializer(
|
||||||
UpdateSerializerWithoutDeserialization
|
UpdateSerializerWithoutSerialization
|
||||||
)
|
)
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
|
|||||||
@@ -5,11 +5,6 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
|||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.*
|
||||||
import kotlinx.serialization.builtins.serializer
|
import kotlinx.serialization.builtins.serializer
|
||||||
|
|
||||||
/**
|
|
||||||
* Representation of https://core.telegram.org/bots/api#setchatadministratorcustomtitle
|
|
||||||
*
|
|
||||||
* Please, remember about restrictions for characters in custom title
|
|
||||||
*/
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class SetChatAdministratorCustomTitle(
|
data class SetChatAdministratorCustomTitle(
|
||||||
@SerialName(chatIdField)
|
@SerialName(chatIdField)
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ReplyMes
|
|||||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.ReplyingMarkupSendMessageRequest
|
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.ReplyingMarkupSendMessageRequest
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
|
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.types.dice.DiceAnimationType
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.ContentMessage
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.ContentMessage
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.DiceContent
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.DiceContent
|
||||||
@@ -17,6 +18,8 @@ internal val DiceContentMessageResultDeserializer: DeserializationStrategy<Conte
|
|||||||
data class SendDice(
|
data class SendDice(
|
||||||
@SerialName(chatIdField)
|
@SerialName(chatIdField)
|
||||||
override val chatId: ChatIdentifier,
|
override val chatId: ChatIdentifier,
|
||||||
|
@SerialName(emojiField)
|
||||||
|
val animationType: DiceAnimationType? = null,
|
||||||
@SerialName(disableNotificationField)
|
@SerialName(disableNotificationField)
|
||||||
override val disableNotification: Boolean = false,
|
override val disableNotification: Boolean = false,
|
||||||
@SerialName(replyToMessageIdField)
|
@SerialName(replyToMessageIdField)
|
||||||
|
|||||||
@@ -4,9 +4,6 @@ import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.*
|
|||||||
import kotlinx.serialization.DeserializationStrategy
|
import kotlinx.serialization.DeserializationStrategy
|
||||||
import kotlinx.serialization.json.JsonObject
|
import kotlinx.serialization.json.JsonObject
|
||||||
|
|
||||||
/**
|
|
||||||
* Will be used as SimpleRequest if
|
|
||||||
*/
|
|
||||||
class MultipartRequestImpl<D: DataRequest<R>, F: Files, R: Any>(
|
class MultipartRequestImpl<D: DataRequest<R>, F: Files, R: Any>(
|
||||||
val data: D,
|
val data: D,
|
||||||
val files: F
|
val files: F
|
||||||
|
|||||||
@@ -1,13 +1,19 @@
|
|||||||
package com.github.insanusmokrassar.TelegramBotAPI.requests.send.polls
|
package com.github.insanusmokrassar.TelegramBotAPI.requests.send.polls
|
||||||
|
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.*
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.ReplyingMarkupSendMessageRequest
|
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.ReplyingMarkupSendMessageRequest
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.SendMessageRequest
|
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.abstracts.SendMessageRequest
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.MarkdownV2
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
|
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.ContentMessage
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.ContentMessage
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.TelegramBotAPIMessageDeserializationStrategyClass
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.PollContent
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.PollContent
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.polls.*
|
import com.github.insanusmokrassar.TelegramBotAPI.types.polls.*
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.utils.fullListOfSubSource
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.utils.toMarkdownV2Captions
|
||||||
|
import com.soywiz.klock.DateTime
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.*
|
||||||
|
|
||||||
private val commonResultDeserializer: DeserializationStrategy<ContentMessage<PollContent>> = TelegramBotAPIMessageDeserializationStrategyClass()
|
private val commonResultDeserializer: DeserializationStrategy<ContentMessage<PollContent>> = TelegramBotAPIMessageDeserializationStrategyClass()
|
||||||
@@ -66,6 +72,7 @@ fun Poll.createRequest(
|
|||||||
isAnonymous,
|
isAnonymous,
|
||||||
isClosed,
|
isClosed,
|
||||||
allowMultipleAnswers,
|
allowMultipleAnswers,
|
||||||
|
scheduledCloseInfo,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
@@ -78,6 +85,9 @@ fun Poll.createRequest(
|
|||||||
correctOptionId,
|
correctOptionId,
|
||||||
isAnonymous,
|
isAnonymous,
|
||||||
isClosed,
|
isClosed,
|
||||||
|
explanation ?.fullListOfSubSource(explanationEntities) ?.justTextSources() ?.toMarkdownV2Captions() ?.firstOrNull(),
|
||||||
|
MarkdownV2,
|
||||||
|
scheduledCloseInfo,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
@@ -89,6 +99,7 @@ fun Poll.createRequest(
|
|||||||
isAnonymous,
|
isAnonymous,
|
||||||
isClosed,
|
isClosed,
|
||||||
false,
|
false,
|
||||||
|
scheduledCloseInfo,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
@@ -100,20 +111,35 @@ fun Poll.createRequest(
|
|||||||
isAnonymous,
|
isAnonymous,
|
||||||
isClosed,
|
isClosed,
|
||||||
false,
|
false,
|
||||||
|
scheduledCloseInfo,
|
||||||
disableNotification,
|
disableNotification,
|
||||||
replyToMessageId,
|
replyToMessageId,
|
||||||
replyMarkup
|
replyMarkup
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun ScheduledCloseInfo.checkSendData() {
|
||||||
|
val span = when (this) {
|
||||||
|
is ExactScheduledCloseInfo -> (closeDateTime - DateTime.now()).seconds
|
||||||
|
is ApproximateScheduledCloseInfo -> openDuration.seconds
|
||||||
|
}.toInt()
|
||||||
|
if (span !in openPeriodPollSecondsLimit) {
|
||||||
|
error("Duration of autoclose for polls must be in range $openPeriodPollSecondsLimit, but was $span")
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sealed class SendPoll : SendMessageRequest<ContentMessage<PollContent>>,
|
sealed class SendPoll : SendMessageRequest<ContentMessage<PollContent>>,
|
||||||
ReplyingMarkupSendMessageRequest<ContentMessage<PollContent>> {
|
ReplyingMarkupSendMessageRequest<ContentMessage<PollContent>> {
|
||||||
abstract val question: String
|
abstract val question: String
|
||||||
abstract val options: List<String>
|
abstract val options: List<String>
|
||||||
abstract val isAnonymous: Boolean
|
abstract val isAnonymous: Boolean
|
||||||
abstract val isClosed: Boolean
|
abstract val isClosed: Boolean
|
||||||
|
abstract val closeInfo: ScheduledCloseInfo?
|
||||||
abstract val type: String
|
abstract val type: String
|
||||||
|
|
||||||
|
internal abstract val openPeriod: LongSeconds?
|
||||||
|
internal abstract val closeDate: LongSeconds?
|
||||||
|
|
||||||
override fun method(): String = "sendPoll"
|
override fun method(): String = "sendPoll"
|
||||||
override val resultDeserializer: DeserializationStrategy<ContentMessage<PollContent>>
|
override val resultDeserializer: DeserializationStrategy<ContentMessage<PollContent>>
|
||||||
get() = commonResultDeserializer
|
get() = commonResultDeserializer
|
||||||
@@ -133,6 +159,8 @@ data class SendRegularPoll(
|
|||||||
override val isClosed: Boolean = false,
|
override val isClosed: Boolean = false,
|
||||||
@SerialName(allowsMultipleAnswersField)
|
@SerialName(allowsMultipleAnswersField)
|
||||||
val allowMultipleAnswers: Boolean = false,
|
val allowMultipleAnswers: Boolean = false,
|
||||||
|
@Transient
|
||||||
|
override val closeInfo: ScheduledCloseInfo? = null,
|
||||||
@SerialName(disableNotificationField)
|
@SerialName(disableNotificationField)
|
||||||
override val disableNotification: Boolean = false,
|
override val disableNotification: Boolean = false,
|
||||||
@SerialName(replyToMessageIdField)
|
@SerialName(replyToMessageIdField)
|
||||||
@@ -144,8 +172,17 @@ data class SendRegularPoll(
|
|||||||
override val requestSerializer: SerializationStrategy<*>
|
override val requestSerializer: SerializationStrategy<*>
|
||||||
get() = serializer()
|
get() = serializer()
|
||||||
|
|
||||||
|
@SerialName(openPeriodField)
|
||||||
|
override val openPeriod: LongSeconds?
|
||||||
|
= (closeInfo as? ApproximateScheduledCloseInfo) ?.openDuration ?.millisecondsLong ?.div(1000)
|
||||||
|
|
||||||
|
@SerialName(closeDateField)
|
||||||
|
override val closeDate: LongSeconds?
|
||||||
|
= (closeInfo as? ExactScheduledCloseInfo) ?.closeDateTime ?.unixMillisLong ?.div(1000)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
checkPollInfo(question, options)
|
checkPollInfo(question, options)
|
||||||
|
closeInfo ?.checkSendData()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -163,23 +200,46 @@ data class SendQuizPoll(
|
|||||||
override val isAnonymous: Boolean = true,
|
override val isAnonymous: Boolean = true,
|
||||||
@SerialName(isClosedField)
|
@SerialName(isClosedField)
|
||||||
override val isClosed: Boolean = false,
|
override val isClosed: Boolean = false,
|
||||||
|
@SerialName(explanationField)
|
||||||
|
override val explanation: String? = null,
|
||||||
|
@SerialName(explanationParseModeField)
|
||||||
|
override val parseMode: ParseMode? = null,
|
||||||
|
@Transient
|
||||||
|
override val closeInfo: ScheduledCloseInfo? = null,
|
||||||
@SerialName(disableNotificationField)
|
@SerialName(disableNotificationField)
|
||||||
override val disableNotification: Boolean = false,
|
override val disableNotification: Boolean = false,
|
||||||
@SerialName(replyToMessageIdField)
|
@SerialName(replyToMessageIdField)
|
||||||
override val replyToMessageId: MessageIdentifier? = null,
|
override val replyToMessageId: MessageIdentifier? = null,
|
||||||
@SerialName(replyMarkupField)
|
@SerialName(replyMarkupField)
|
||||||
override val replyMarkup: KeyboardMarkup? = null
|
override val replyMarkup: KeyboardMarkup? = null
|
||||||
) : SendPoll() {
|
) : SendPoll(), CaptionedOutput, ExplainedOutput {
|
||||||
override val type: String = quizPollType
|
override val type: String = quizPollType
|
||||||
override val requestSerializer: SerializationStrategy<*>
|
override val requestSerializer: SerializationStrategy<*>
|
||||||
get() = serializer()
|
get() = serializer()
|
||||||
|
|
||||||
|
@Deprecated("Will be removed in near updates", ReplaceWith("explanation"))
|
||||||
|
override val caption: String?
|
||||||
|
get() = explanation
|
||||||
|
|
||||||
|
@SerialName(openPeriodField)
|
||||||
|
override val openPeriod: LongSeconds?
|
||||||
|
= (closeInfo as? ApproximateScheduledCloseInfo) ?.openDuration ?.millisecondsLong ?.div(1000)
|
||||||
|
|
||||||
|
@SerialName(closeDateField)
|
||||||
|
override val closeDate: LongSeconds?
|
||||||
|
= (closeInfo as? ExactScheduledCloseInfo) ?.closeDateTime ?.unixMillisLong ?.div(1000)
|
||||||
|
|
||||||
init {
|
init {
|
||||||
checkPollInfo(question, options)
|
checkPollInfo(question, options)
|
||||||
|
closeInfo ?.checkSendData()
|
||||||
val correctOptionIdRange = 0 .. options.size
|
val correctOptionIdRange = 0 .. options.size
|
||||||
if (correctOptionId !in correctOptionIdRange) {
|
if (correctOptionId !in correctOptionIdRange) {
|
||||||
throw IllegalArgumentException("Correct option id must be in range of $correctOptionIdRange, but actual " +
|
throw IllegalArgumentException("Correct option id must be in range of $correctOptionIdRange, but actual " +
|
||||||
"value is $correctOptionId")
|
"value is $correctOptionId")
|
||||||
}
|
}
|
||||||
|
if (explanation != null && explanation.length !in explanationLimit) {
|
||||||
|
error("Quiz poll explanation size must be in range $explanationLimit," +
|
||||||
|
"but actual explanation contains ${explanation.length} symbols")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -22,6 +22,7 @@ typealias FileUniqueId = String
|
|||||||
typealias DiceResult = Int
|
typealias DiceResult = Int
|
||||||
|
|
||||||
typealias Seconds = Int
|
typealias Seconds = Int
|
||||||
|
typealias LongSeconds = Long
|
||||||
|
|
||||||
val getUpdatesLimit = 1 .. 100
|
val getUpdatesLimit = 1 .. 100
|
||||||
val callbackQueryAnswerLength = 0 until 200
|
val callbackQueryAnswerLength = 0 until 200
|
||||||
@@ -54,6 +55,12 @@ val botCommandLimit = botCommandLengthLimit
|
|||||||
val botCommandDescriptionLimit = 3 .. 256
|
val botCommandDescriptionLimit = 3 .. 256
|
||||||
val botCommandsLimit = 0 .. 100
|
val botCommandsLimit = 0 .. 100
|
||||||
|
|
||||||
|
val explanationLimit = 0 .. 200
|
||||||
|
@Deprecated("Will be removed in near updates", ReplaceWith("explanationLimit"))
|
||||||
|
val quizPollExplanationLimit = explanationLimit
|
||||||
|
|
||||||
|
val openPeriodPollSecondsLimit = 5 .. 600
|
||||||
|
|
||||||
const val chatIdField = "chat_id"
|
const val chatIdField = "chat_id"
|
||||||
const val messageIdField = "message_id"
|
const val messageIdField = "message_id"
|
||||||
const val updateIdField = "update_id"
|
const val updateIdField = "update_id"
|
||||||
@@ -82,6 +89,7 @@ const val containsMasksField = "contains_masks"
|
|||||||
const val resultIdField = "result_id"
|
const val resultIdField = "result_id"
|
||||||
const val inlineMessageIdField = "inline_message_id"
|
const val inlineMessageIdField = "inline_message_id"
|
||||||
const val callbackDataField = "callback_data"
|
const val callbackDataField = "callback_data"
|
||||||
|
const val callbackGameField = "callback_game"
|
||||||
const val callbackQueryIdField = "callback_query_id"
|
const val callbackQueryIdField = "callback_query_id"
|
||||||
const val inlineQueryIdField = "inline_query_id"
|
const val inlineQueryIdField = "inline_query_id"
|
||||||
const val inlineKeyboardField = "inline_keyboard"
|
const val inlineKeyboardField = "inline_keyboard"
|
||||||
@@ -198,6 +206,7 @@ const val tgsStickerField = "tgs_sticker"
|
|||||||
|
|
||||||
const val okField = "ok"
|
const val okField = "ok"
|
||||||
const val captionField = "caption"
|
const val captionField = "caption"
|
||||||
|
const val explanationField = "explanation"
|
||||||
const val idField = "id"
|
const val idField = "id"
|
||||||
const val pollIdField = "poll_id"
|
const val pollIdField = "poll_id"
|
||||||
const val textField = "text"
|
const val textField = "text"
|
||||||
@@ -249,6 +258,10 @@ const val xShiftField = "x_shift"
|
|||||||
const val yShiftField = "y_shift"
|
const val yShiftField = "y_shift"
|
||||||
const val scaleField = "scale"
|
const val scaleField = "scale"
|
||||||
|
|
||||||
|
const val explanationEntitiesField = "explanation_entities"
|
||||||
|
const val explanationParseModeField = "explanation_parse_mode"
|
||||||
|
const val openPeriodField = "open_period"
|
||||||
|
const val closeDateField = "close_date"
|
||||||
|
|
||||||
const val smallFileIdField = "small_file_id"
|
const val smallFileIdField = "small_file_id"
|
||||||
const val bigFileIdField = "big_file_id"
|
const val bigFileIdField = "big_file_id"
|
||||||
|
|||||||
@@ -1,10 +1,9 @@
|
|||||||
package com.github.insanusmokrassar.TelegramBotAPI.types
|
package com.github.insanusmokrassar.TelegramBotAPI.types
|
||||||
|
|
||||||
import kotlinx.serialization.SerialName
|
import com.github.insanusmokrassar.TelegramBotAPI.types.dice.Dice
|
||||||
import kotlinx.serialization.Serializable
|
|
||||||
|
|
||||||
@Serializable
|
@Deprecated(
|
||||||
data class Dice(
|
"Replaced",
|
||||||
@SerialName(valueField)
|
ReplaceWith("Dice", "com.github.insanusmokrassar.TelegramBotAPI.types.dice.Dice")
|
||||||
val value: DiceResult
|
|
||||||
)
|
)
|
||||||
|
typealias Dice = Dice
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
|
|||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
|
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
|
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField
|
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.utils.MimeType
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@@ -20,7 +21,7 @@ data class InlineQueryResultDocumentImpl(
|
|||||||
@SerialName(titleField)
|
@SerialName(titleField)
|
||||||
override val title: String,
|
override val title: String,
|
||||||
@SerialName(mimeTypeField)
|
@SerialName(mimeTypeField)
|
||||||
override val mimeType: String,
|
override val mimeType: MimeType,
|
||||||
@SerialName(thumbUrlField)
|
@SerialName(thumbUrlField)
|
||||||
override val thumbUrl: String? = null,
|
override val thumbUrl: String? = null,
|
||||||
@SerialName(thumbWidthField)
|
@SerialName(thumbWidthField)
|
||||||
|
|||||||
@@ -8,6 +8,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.ParseMode
|
|||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
|
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
|
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField
|
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.mimeTypeField
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.utils.MimeType
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@@ -20,7 +21,7 @@ data class InlineQueryResultVideoImpl(
|
|||||||
@SerialName(thumbUrlField)
|
@SerialName(thumbUrlField)
|
||||||
override val thumbUrl: String,
|
override val thumbUrl: String,
|
||||||
@SerialName(mimeTypeField)
|
@SerialName(mimeTypeField)
|
||||||
override val mimeType: String,
|
override val mimeType: MimeType,
|
||||||
@SerialName(titleField)
|
@SerialName(titleField)
|
||||||
override val title: String,
|
override val title: String,
|
||||||
@SerialName(videoWidthField)
|
@SerialName(videoWidthField)
|
||||||
|
|||||||
@@ -7,6 +7,8 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.files.PhotoSize
|
|||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.mediaField
|
import com.github.insanusmokrassar.TelegramBotAPI.types.mediaField
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.*
|
||||||
|
|
||||||
|
internal const val photoInputMediaType = "photo"
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class InputMediaPhoto(
|
data class InputMediaPhoto(
|
||||||
override val file: InputFile,
|
override val file: InputFile,
|
||||||
@@ -14,7 +16,7 @@ data class InputMediaPhoto(
|
|||||||
@SerialName(parseModeField)
|
@SerialName(parseModeField)
|
||||||
override val parseMode: ParseMode? = null
|
override val parseMode: ParseMode? = null
|
||||||
) : InputMedia, MediaGroupMemberInputMedia {
|
) : InputMedia, MediaGroupMemberInputMedia {
|
||||||
override val type: String = "photo"
|
override val type: String = photoInputMediaType
|
||||||
|
|
||||||
override fun serialize(format: StringFormat): String = format.stringify(serializer(), this)
|
override fun serialize(format: StringFormat): String = format.stringify(serializer(), this)
|
||||||
|
|
||||||
|
|||||||
@@ -6,6 +6,8 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.parseModeField
|
|||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.mediaField
|
import com.github.insanusmokrassar.TelegramBotAPI.types.mediaField
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.*
|
||||||
|
|
||||||
|
internal const val videoInputMediaType = "video"
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class InputMediaVideo(
|
data class InputMediaVideo(
|
||||||
override val file: InputFile,
|
override val file: InputFile,
|
||||||
@@ -17,7 +19,7 @@ data class InputMediaVideo(
|
|||||||
override val duration: Long? = null,
|
override val duration: Long? = null,
|
||||||
override val thumb: InputFile? = null
|
override val thumb: InputFile? = null
|
||||||
) : InputMedia, SizedInputMedia, DuratedInputMedia, ThumbedInputMedia, MediaGroupMemberInputMedia {
|
) : InputMedia, SizedInputMedia, DuratedInputMedia, ThumbedInputMedia, MediaGroupMemberInputMedia {
|
||||||
override val type: String = "video"
|
override val type: String = videoInputMediaType
|
||||||
|
|
||||||
override fun serialize(format: StringFormat): String = format.stringify(serializer(), this)
|
override fun serialize(format: StringFormat): String = format.stringify(serializer(), this)
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
package com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia
|
package com.github.insanusmokrassar.TelegramBotAPI.types.InputMedia
|
||||||
|
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.types.typeField
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.utils.nonstrictJsonFormat
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.*
|
||||||
|
import kotlinx.serialization.json.JsonObjectSerializer
|
||||||
|
|
||||||
@Serializer(MediaGroupMemberInputMedia::class)
|
@Serializer(MediaGroupMemberInputMedia::class)
|
||||||
internal object MediaGroupMemberInputMediaSerializer : KSerializer<MediaGroupMemberInputMedia> {
|
internal object MediaGroupMemberInputMediaSerializer : KSerializer<MediaGroupMemberInputMedia> {
|
||||||
@@ -13,6 +16,12 @@ internal object MediaGroupMemberInputMediaSerializer : KSerializer<MediaGroupMem
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun deserialize(decoder: Decoder): MediaGroupMemberInputMedia {
|
override fun deserialize(decoder: Decoder): MediaGroupMemberInputMedia {
|
||||||
TODO("not implemented")
|
val json = JsonObjectSerializer.deserialize(decoder)
|
||||||
|
|
||||||
|
return when (json.getPrimitiveOrNull(typeField) ?.contentOrNull) {
|
||||||
|
photoInputMediaType -> nonstrictJsonFormat.fromJson(InputMediaPhoto.serializer(), json)
|
||||||
|
videoInputMediaType -> nonstrictJsonFormat.fromJson(InputMediaVideo.serializer(), json)
|
||||||
|
else -> error("Illegal type of incoming MediaGroupMemberInputMedia")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -5,7 +5,6 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.thumbField
|
|||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
// TODO:: fill thumbed
|
|
||||||
interface ThumbedInputMedia : InputMedia {
|
interface ThumbedInputMedia : InputMedia {
|
||||||
val thumb: InputFile?
|
val thumb: InputFile?
|
||||||
@Serializable
|
@Serializable
|
||||||
|
|||||||
@@ -83,6 +83,28 @@ internal fun createTextPart(from: String, entities: RawMessageEntities): List<Te
|
|||||||
return resultList
|
return resultList
|
||||||
}
|
}
|
||||||
|
|
||||||
|
internal fun List<TextPart>.asRawMessageEntities() = mapNotNull {
|
||||||
|
val source = it.source
|
||||||
|
when (source) {
|
||||||
|
is MentionTextSource -> RawMessageEntity("mention", it.range.first, it.range.last - it.range.first)
|
||||||
|
is HashTagTextSource -> RawMessageEntity("hashtag", it.range.first, it.range.last - it.range.first)
|
||||||
|
is CashTagTextSource -> RawMessageEntity("cashtag", it.range.first, it.range.last - it.range.first)
|
||||||
|
is BotCommandTextSource -> RawMessageEntity("bot_command", it.range.first, it.range.last - it.range.first)
|
||||||
|
is URLTextSource -> RawMessageEntity("url", it.range.first, it.range.last - it.range.first)
|
||||||
|
is EMailTextSource -> RawMessageEntity("email", it.range.first, it.range.last - it.range.first)
|
||||||
|
is PhoneNumberTextSource -> RawMessageEntity("phone_number", it.range.first, it.range.last - it.range.first)
|
||||||
|
is BoldTextSource -> RawMessageEntity("bold", it.range.first, it.range.last - it.range.first)
|
||||||
|
is ItalicTextSource -> RawMessageEntity("italic", it.range.first, it.range.last - it.range.first)
|
||||||
|
is CodeTextSource -> RawMessageEntity("code", it.range.first, it.range.last - it.range.first)
|
||||||
|
is PreTextSource -> RawMessageEntity("pre", it.range.first, it.range.last - it.range.first, language = source.language)
|
||||||
|
is TextLinkTextSource -> RawMessageEntity("text_link", it.range.first, it.range.last - it.range.first, source.url)
|
||||||
|
is TextMentionTextSource -> RawMessageEntity("text_mention", it.range.first, it.range.last - it.range.first, user = source.user)
|
||||||
|
is UnderlineTextSource -> RawMessageEntity("underline", it.range.first, it.range.last - it.range.first)
|
||||||
|
is StrikethroughTextSource -> RawMessageEntity("strikethrough", it.range.first, it.range.last - it.range.first)
|
||||||
|
else -> null
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
internal fun RawMessageEntities.asTextParts(sourceString: String): List<TextPart> = createTextPart(sourceString, this)
|
internal fun RawMessageEntities.asTextParts(sourceString: String): List<TextPart> = createTextPart(sourceString, this)
|
||||||
|
|
||||||
internal typealias RawMessageEntities = List<RawMessageEntity>
|
internal typealias RawMessageEntities = List<RawMessageEntity>
|
||||||
|
|||||||
@@ -5,7 +5,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.utils.*
|
|||||||
|
|
||||||
class TextLinkTextSource(
|
class TextLinkTextSource(
|
||||||
override val source: String,
|
override val source: String,
|
||||||
url: String
|
val url: String
|
||||||
) : TextSource {
|
) : TextSource {
|
||||||
override val asMarkdownSource: String by lazy { source.linkMarkdown(url) }
|
override val asMarkdownSource: String by lazy { source.linkMarkdown(url) }
|
||||||
override val asMarkdownV2Source: String by lazy { source.linkMarkdownV2(url) }
|
override val asMarkdownV2Source: String by lazy { source.linkMarkdownV2(url) }
|
||||||
|
|||||||
@@ -2,16 +2,16 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.MessageEntity.textsourc
|
|||||||
|
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.MultilevelTextSource
|
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.MultilevelTextSource
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.TextPart
|
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.TextPart
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.PrivateChat
|
import com.github.insanusmokrassar.TelegramBotAPI.types.User
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.utils.*
|
import com.github.insanusmokrassar.TelegramBotAPI.utils.*
|
||||||
|
|
||||||
class TextMentionTextSource(
|
class TextMentionTextSource(
|
||||||
override val source: String,
|
override val source: String,
|
||||||
privateChat: PrivateChat,
|
val user: User,
|
||||||
textParts: List<TextPart>
|
textParts: List<TextPart>
|
||||||
) : MultilevelTextSource {
|
) : MultilevelTextSource {
|
||||||
override val textParts: List<TextPart> by lazy { source.fullListOfSubSource(textParts) }
|
override val textParts: List<TextPart> by lazy { source.fullListOfSubSource(textParts) }
|
||||||
override val asMarkdownSource: String by lazy { source.textMentionMarkdown(privateChat.id) }
|
override val asMarkdownSource: String by lazy { source.textMentionMarkdown(user.id) }
|
||||||
override val asMarkdownV2Source: String by lazy { textMentionMarkdownV2(privateChat.id) }
|
override val asMarkdownV2Source: String by lazy { textMentionMarkdownV2(user.id) }
|
||||||
override val asHtmlSource: String by lazy { textMentionHTML(privateChat.id) }
|
override val asHtmlSource: String by lazy { textMentionHTML(user.id) }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.actions
|
|||||||
|
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.*
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Use BotAction objects realisations to notify user about bot actions
|
||||||
|
*/
|
||||||
@Serializable(BotActionSerializer::class)
|
@Serializable(BotActionSerializer::class)
|
||||||
sealed class BotAction {
|
sealed class BotAction {
|
||||||
abstract val actionName: String
|
abstract val actionName: String
|
||||||
@@ -31,54 +34,80 @@ internal object BotActionSerializer: KSerializer<BotAction> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Use BotAction objects realisations to notify user about bot actions
|
* Will notify user that bot is "typing" something
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@Serializable(BotActionSerializer::class)
|
@Serializable(BotActionSerializer::class)
|
||||||
object TypingAction : BotAction() {
|
object TypingAction : BotAction() {
|
||||||
override val actionName: String = "typing"
|
override val actionName: String = "typing"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will notify user that bot is uploading some photo
|
||||||
|
*/
|
||||||
@Serializable(BotActionSerializer::class)
|
@Serializable(BotActionSerializer::class)
|
||||||
object UploadPhotoAction : BotAction() {
|
object UploadPhotoAction : BotAction() {
|
||||||
override val actionName: String = "upload_photo"
|
override val actionName: String = "upload_photo"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will notify user that bot is recording some video
|
||||||
|
*/
|
||||||
@Serializable(BotActionSerializer::class)
|
@Serializable(BotActionSerializer::class)
|
||||||
object RecordVideoAction : BotAction() {
|
object RecordVideoAction : BotAction() {
|
||||||
override val actionName: String = "record_video"
|
override val actionName: String = "record_video"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will notify user that bot is uploading some photo
|
||||||
|
*/
|
||||||
@Serializable(BotActionSerializer::class)
|
@Serializable(BotActionSerializer::class)
|
||||||
object UploadVideoAction : BotAction() {
|
object UploadVideoAction : BotAction() {
|
||||||
override val actionName: String = "upload_video"
|
override val actionName: String = "upload_video"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will notify user that bot is recording some audio
|
||||||
|
*/
|
||||||
@Serializable(BotActionSerializer::class)
|
@Serializable(BotActionSerializer::class)
|
||||||
object RecordAudioAction : BotAction() {
|
object RecordAudioAction : BotAction() {
|
||||||
override val actionName: String = "record_audio"
|
override val actionName: String = "record_audio"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will notify user that bot is uploading some audio
|
||||||
|
*/
|
||||||
@Serializable(BotActionSerializer::class)
|
@Serializable(BotActionSerializer::class)
|
||||||
object UploadAudioAction : BotAction() {
|
object UploadAudioAction : BotAction() {
|
||||||
override val actionName: String = "upload_audio"
|
override val actionName: String = "upload_audio"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will notify user that bot is uploading some document
|
||||||
|
*/
|
||||||
@Serializable(BotActionSerializer::class)
|
@Serializable(BotActionSerializer::class)
|
||||||
object UploadDocumentAction : BotAction() {
|
object UploadDocumentAction : BotAction() {
|
||||||
override val actionName: String = "upload_document"
|
override val actionName: String = "upload_document"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will notify user that bot is trying to find location
|
||||||
|
*/
|
||||||
@Serializable(BotActionSerializer::class)
|
@Serializable(BotActionSerializer::class)
|
||||||
object FindLocationAction : BotAction() {
|
object FindLocationAction : BotAction() {
|
||||||
override val actionName: String = "find_location"
|
override val actionName: String = "find_location"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will notify user that bot is recording video note
|
||||||
|
*/
|
||||||
@Serializable(BotActionSerializer::class)
|
@Serializable(BotActionSerializer::class)
|
||||||
object RecordVideoNoteAction : BotAction() {
|
object RecordVideoNoteAction : BotAction() {
|
||||||
override val actionName: String = "record_video_note"
|
override val actionName: String = "record_video_note"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Will notify user that bot is uploading video note
|
||||||
|
*/
|
||||||
@Serializable(BotActionSerializer::class)
|
@Serializable(BotActionSerializer::class)
|
||||||
object UploadVideoNoteAction : BotAction() {
|
object UploadVideoNoteAction : BotAction() {
|
||||||
override val actionName: String = "upload_video_note"
|
override val actionName: String = "upload_video_note"
|
||||||
|
|||||||
@@ -1,14 +1,22 @@
|
|||||||
package com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardButtons
|
package com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardButtons
|
||||||
|
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.types.games.CallbackGame
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
import kotlinx.serialization.json.JsonElement
|
||||||
|
|
||||||
@Serializable(InlineKeyboardButtonSerializer::class)
|
@Serializable(InlineKeyboardButtonSerializer::class)
|
||||||
sealed class InlineKeyboardButton {
|
sealed class InlineKeyboardButton {
|
||||||
abstract val text: String
|
abstract val text: String
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
data class UnknownInlineKeyboardButton internal constructor(
|
||||||
|
override val text: String,
|
||||||
|
val rawData: JsonElement
|
||||||
|
) : InlineKeyboardButton()
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class PayInlineKeyboardButton(
|
data class PayInlineKeyboardButton(
|
||||||
override val text: String,
|
override val text: String,
|
||||||
@@ -24,6 +32,15 @@ data class CallbackDataInlineKeyboardButton(
|
|||||||
val callbackData: String
|
val callbackData: String
|
||||||
) : InlineKeyboardButton()
|
) : InlineKeyboardButton()
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
data class CallbackGameInlineKeyboardButton(
|
||||||
|
@SerialName(textField)
|
||||||
|
override val text: String
|
||||||
|
) : InlineKeyboardButton() {
|
||||||
|
@SerialName(callbackGameField)
|
||||||
|
private val callbackGame = CallbackGame
|
||||||
|
}
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class LoginURLInlineKeyboardButton(
|
data class LoginURLInlineKeyboardButton(
|
||||||
override val text: String,
|
override val text: String,
|
||||||
|
|||||||
@@ -12,22 +12,25 @@ internal object InlineKeyboardButtonSerializer : KSerializer<InlineKeyboardButto
|
|||||||
PolymorphicKind.SEALED
|
PolymorphicKind.SEALED
|
||||||
)
|
)
|
||||||
|
|
||||||
private fun resolveSerializer(json: JsonObject): KSerializer<out InlineKeyboardButton> {
|
private fun resolveSerializer(json: JsonObject): KSerializer<out InlineKeyboardButton>? {
|
||||||
return when {
|
return when {
|
||||||
json[callbackDataField] != null -> CallbackDataInlineKeyboardButton.serializer()
|
json[callbackDataField] != null -> CallbackDataInlineKeyboardButton.serializer()
|
||||||
|
json[callbackGameField] != null -> CallbackGameInlineKeyboardButton.serializer()
|
||||||
json[loginUrlField] != null -> LoginURLInlineKeyboardButton.serializer()
|
json[loginUrlField] != null -> LoginURLInlineKeyboardButton.serializer()
|
||||||
json[payField] != null -> PayInlineKeyboardButton.serializer()
|
json[payField] != null -> PayInlineKeyboardButton.serializer()
|
||||||
json[switchInlineQueryField] != null -> SwitchInlineQueryInlineKeyboardButton.serializer()
|
json[switchInlineQueryField] != null -> SwitchInlineQueryInlineKeyboardButton.serializer()
|
||||||
json[switchInlineQueryCurrentChatField] != null -> SwitchInlineQueryCurrentChatInlineKeyboardButton.serializer()
|
json[switchInlineQueryCurrentChatField] != null -> SwitchInlineQueryCurrentChatInlineKeyboardButton.serializer()
|
||||||
json[urlField] != null -> URLInlineKeyboardButton.serializer()
|
json[urlField] != null -> URLInlineKeyboardButton.serializer()
|
||||||
else -> throw IllegalArgumentException("Can't find correct serializer for inline button serialized as $json")
|
else -> null
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun deserialize(decoder: Decoder): InlineKeyboardButton {
|
override fun deserialize(decoder: Decoder): InlineKeyboardButton {
|
||||||
val json = JsonElementSerializer.deserialize(decoder)
|
val json = JsonElementSerializer.deserialize(decoder)
|
||||||
|
|
||||||
return nonstrictJsonFormat.fromJson(resolveSerializer(json.jsonObject), json)
|
return (json as? JsonObject) ?.let { resolveSerializer(it) } ?.let {
|
||||||
|
nonstrictJsonFormat.fromJson(it, json)
|
||||||
|
} ?: UnknownInlineKeyboardButton("", json)
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun serialize(encoder: Encoder, value: InlineKeyboardButton) {
|
override fun serialize(encoder: Encoder, value: InlineKeyboardButton) {
|
||||||
@@ -38,6 +41,8 @@ internal object InlineKeyboardButtonSerializer : KSerializer<InlineKeyboardButto
|
|||||||
is SwitchInlineQueryInlineKeyboardButton -> SwitchInlineQueryInlineKeyboardButton.serializer().serialize(encoder, value)
|
is SwitchInlineQueryInlineKeyboardButton -> SwitchInlineQueryInlineKeyboardButton.serializer().serialize(encoder, value)
|
||||||
is SwitchInlineQueryCurrentChatInlineKeyboardButton -> SwitchInlineQueryCurrentChatInlineKeyboardButton.serializer().serialize(encoder, value)
|
is SwitchInlineQueryCurrentChatInlineKeyboardButton -> SwitchInlineQueryCurrentChatInlineKeyboardButton.serializer().serialize(encoder, value)
|
||||||
is URLInlineKeyboardButton -> URLInlineKeyboardButton.serializer().serialize(encoder, value)
|
is URLInlineKeyboardButton -> URLInlineKeyboardButton.serializer().serialize(encoder, value)
|
||||||
|
is CallbackGameInlineKeyboardButton -> CallbackGameInlineKeyboardButton.serializer().serialize(encoder, value)
|
||||||
|
is UnknownInlineKeyboardButton -> JsonElementSerializer.serialize(encoder, value.rawData)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,13 @@
|
|||||||
|
package com.github.insanusmokrassar.TelegramBotAPI.types.dice
|
||||||
|
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||||
|
import kotlinx.serialization.SerialName
|
||||||
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
data class Dice(
|
||||||
|
@SerialName(valueField)
|
||||||
|
val value: DiceResult,
|
||||||
|
@SerialName(emojiField)
|
||||||
|
val animationType: DiceAnimationType
|
||||||
|
)
|
||||||
@@ -0,0 +1,36 @@
|
|||||||
|
package com.github.insanusmokrassar.TelegramBotAPI.types.dice
|
||||||
|
|
||||||
|
import kotlinx.serialization.*
|
||||||
|
|
||||||
|
@Serializable(DiceAnimationTypeSerializer::class)
|
||||||
|
sealed class DiceAnimationType {
|
||||||
|
abstract val emoji: String
|
||||||
|
}
|
||||||
|
@Serializable(DiceAnimationTypeSerializer::class)
|
||||||
|
object CubeDiceAnimationType : DiceAnimationType() {
|
||||||
|
override val emoji: String = "\uD83C\uDFB2"
|
||||||
|
}
|
||||||
|
@Serializable(DiceAnimationTypeSerializer::class)
|
||||||
|
object DartsDiceAnimationType : DiceAnimationType() {
|
||||||
|
override val emoji: String = "\uD83C\uDFAF"
|
||||||
|
}
|
||||||
|
@Serializable(DiceAnimationTypeSerializer::class)
|
||||||
|
class UnknownDiceAnimationType(
|
||||||
|
override val emoji: String
|
||||||
|
) : DiceAnimationType()
|
||||||
|
|
||||||
|
@Serializer(DiceAnimationType::class)
|
||||||
|
internal object DiceAnimationTypeSerializer : KSerializer<DiceAnimationType> {
|
||||||
|
override val descriptor: SerialDescriptor = PrimitiveDescriptor("DiceAnimationType", PrimitiveKind.STRING)
|
||||||
|
override fun deserialize(decoder: Decoder): DiceAnimationType {
|
||||||
|
return when (val type = decoder.decodeString()) {
|
||||||
|
CubeDiceAnimationType.emoji -> CubeDiceAnimationType
|
||||||
|
DartsDiceAnimationType.emoji -> DartsDiceAnimationType
|
||||||
|
else -> UnknownDiceAnimationType(type)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun serialize(encoder: Encoder, value: DiceAnimationType) {
|
||||||
|
encoder.encodeString(value.emoji)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,6 +4,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
|
|||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.FileUniqueId
|
import com.github.insanusmokrassar.TelegramBotAPI.types.FileUniqueId
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.fileUniqueIdField
|
import com.github.insanusmokrassar.TelegramBotAPI.types.fileUniqueIdField
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.*
|
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.*
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.utils.MimeType
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@@ -20,7 +21,7 @@ data class AnimationFile(
|
|||||||
@SerialName(fileNameField)
|
@SerialName(fileNameField)
|
||||||
override val fileName: String? = null,
|
override val fileName: String? = null,
|
||||||
@SerialName(mimeTypeField)
|
@SerialName(mimeTypeField)
|
||||||
override val mimeType: String? = null,
|
override val mimeType: MimeType? = null,
|
||||||
@SerialName(fileSizeField)
|
@SerialName(fileSizeField)
|
||||||
override val fileSize: Long? = null
|
override val fileSize: Long? = null
|
||||||
) : TelegramMediaFile, MimedMediaFile, ThumbedMediaFile, PlayableMediaFile, CustomNamedMediaFile, SizedMediaFile
|
) : TelegramMediaFile, MimedMediaFile, ThumbedMediaFile, PlayableMediaFile, CustomNamedMediaFile, SizedMediaFile
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
|
|||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.FileUniqueId
|
import com.github.insanusmokrassar.TelegramBotAPI.types.FileUniqueId
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.fileUniqueIdField
|
import com.github.insanusmokrassar.TelegramBotAPI.types.fileUniqueIdField
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.*
|
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.*
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.utils.MimeType
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@@ -18,7 +19,7 @@ data class AudioFile(
|
|||||||
override val performer: String? = null,
|
override val performer: String? = null,
|
||||||
override val title: String? = null,
|
override val title: String? = null,
|
||||||
@SerialName(mimeTypeField)
|
@SerialName(mimeTypeField)
|
||||||
override val mimeType: String? = null,
|
override val mimeType: MimeType? = null,
|
||||||
@SerialName(fileSizeField)
|
@SerialName(fileSizeField)
|
||||||
override val fileSize: Long? = null,
|
override val fileSize: Long? = null,
|
||||||
override val thumb: PhotoSize? = null
|
override val thumb: PhotoSize? = null
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
|
|||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.FileUniqueId
|
import com.github.insanusmokrassar.TelegramBotAPI.types.FileUniqueId
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.fileUniqueIdField
|
import com.github.insanusmokrassar.TelegramBotAPI.types.fileUniqueIdField
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.*
|
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.*
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.utils.MimeType
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@@ -17,7 +18,7 @@ data class DocumentFile(
|
|||||||
override val fileSize: Long? = null,
|
override val fileSize: Long? = null,
|
||||||
override val thumb: PhotoSize? = null,
|
override val thumb: PhotoSize? = null,
|
||||||
@SerialName(mimeTypeField)
|
@SerialName(mimeTypeField)
|
||||||
override val mimeType: String? = null,
|
override val mimeType: MimeType? = null,
|
||||||
@SerialName(fileNameField)
|
@SerialName(fileNameField)
|
||||||
override val fileName: String? = null
|
override val fileName: String? = null
|
||||||
) : TelegramMediaFile, MimedMediaFile, ThumbedMediaFile, CustomNamedMediaFile
|
) : TelegramMediaFile, MimedMediaFile, ThumbedMediaFile, CustomNamedMediaFile
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
|
|||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.FileUniqueId
|
import com.github.insanusmokrassar.TelegramBotAPI.types.FileUniqueId
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.fileUniqueIdField
|
import com.github.insanusmokrassar.TelegramBotAPI.types.fileUniqueIdField
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.*
|
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.*
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.utils.MimeType
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@@ -18,7 +19,7 @@ data class VideoFile(
|
|||||||
override val duration: Long? = null,
|
override val duration: Long? = null,
|
||||||
override val thumb: PhotoSize? = null,
|
override val thumb: PhotoSize? = null,
|
||||||
@SerialName(mimeTypeField)
|
@SerialName(mimeTypeField)
|
||||||
override val mimeType: String? = null,
|
override val mimeType: MimeType? = null,
|
||||||
@SerialName(fileSizeField)
|
@SerialName(fileSizeField)
|
||||||
override val fileSize: Long? = null
|
override val fileSize: Long? = null
|
||||||
) : TelegramMediaFile, MimedMediaFile, ThumbedMediaFile, PlayableMediaFile, SizedMediaFile
|
) : TelegramMediaFile, MimedMediaFile, ThumbedMediaFile, PlayableMediaFile, SizedMediaFile
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package com.github.insanusmokrassar.TelegramBotAPI.types.files
|
package com.github.insanusmokrassar.TelegramBotAPI.types.files
|
||||||
|
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
|
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.FileId
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.FileUniqueId
|
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.fileUniqueIdField
|
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.*
|
import com.github.insanusmokrassar.TelegramBotAPI.types.files.abstracts.*
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.utils.MimeType
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.SerialName
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@@ -13,9 +13,10 @@ data class VoiceFile(
|
|||||||
override val fileId: FileId,
|
override val fileId: FileId,
|
||||||
@SerialName(fileUniqueIdField)
|
@SerialName(fileUniqueIdField)
|
||||||
override val fileUniqueId: FileUniqueId,
|
override val fileUniqueId: FileUniqueId,
|
||||||
|
@SerialName(durationField)
|
||||||
override val duration: Long? = null,
|
override val duration: Long? = null,
|
||||||
@SerialName(mimeTypeField)
|
@SerialName(mimeTypeField)
|
||||||
override val mimeType: String? = null,
|
override val mimeType: MimeType? = null,
|
||||||
@SerialName(fileSizeField)
|
@SerialName(fileSizeField)
|
||||||
override val fileSize: Long? = null
|
override val fileSize: Long? = null
|
||||||
) : TelegramMediaFile, MimedMediaFile, PlayableMediaFile
|
) : TelegramMediaFile, MimedMediaFile, PlayableMediaFile
|
||||||
|
|||||||
@@ -8,7 +8,7 @@ internal const val fileSizeField = "file_size"
|
|||||||
internal const val filePathField = "file_path"
|
internal const val filePathField = "file_path"
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Declare common part of media files in Telegram. Note: it is not representation of `File` type
|
* Declare common part of media files in Telegram. Note: it is not representation of JVM `File` type
|
||||||
*/
|
*/
|
||||||
interface TelegramMediaFile {
|
interface TelegramMediaFile {
|
||||||
val fileId: FileId
|
val fileId: FileId
|
||||||
|
|||||||
@@ -3,8 +3,4 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.games
|
|||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
class CallbackGame {
|
object CallbackGame
|
||||||
init {
|
|
||||||
TODO()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.MessageEntity.RawMessage
|
|||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageEntity.asTextParts
|
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageEntity.asTextParts
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
|
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.InlineKeyboardMarkup
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.*
|
import com.github.insanusmokrassar.TelegramBotAPI.types.chat.abstracts.*
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.types.dice.Dice
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.files.*
|
import com.github.insanusmokrassar.TelegramBotAPI.types.files.*
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.games.RawGame
|
import com.github.insanusmokrassar.TelegramBotAPI.types.games.RawGame
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.ChatEvents.*
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.ChatEvents.*
|
||||||
|
|||||||
@@ -2,8 +2,10 @@ package com.github.insanusmokrassar.TelegramBotAPI.types.message.content
|
|||||||
|
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.Request
|
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.Request
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.SendDice
|
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.SendDice
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
import com.github.insanusmokrassar.TelegramBotAPI.types.ChatIdentifier
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageIdentifier
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
|
import com.github.insanusmokrassar.TelegramBotAPI.types.buttons.KeyboardMarkup
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.types.dice.Dice
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.ContentMessage
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.ContentMessage
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MessageContent
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.abstracts.MessageContent
|
||||||
|
|
||||||
@@ -15,5 +17,11 @@ data class DiceContent(
|
|||||||
disableNotification: Boolean,
|
disableNotification: Boolean,
|
||||||
replyToMessageId: MessageIdentifier?,
|
replyToMessageId: MessageIdentifier?,
|
||||||
replyMarkup: KeyboardMarkup?
|
replyMarkup: KeyboardMarkup?
|
||||||
): Request<ContentMessage<DiceContent>> = SendDice(chatId, disableNotification, replyToMessageId, replyMarkup)
|
): Request<ContentMessage<DiceContent>> = SendDice(
|
||||||
|
chatId,
|
||||||
|
dice.animationType,
|
||||||
|
disableNotification,
|
||||||
|
replyToMessageId,
|
||||||
|
replyMarkup
|
||||||
|
)
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package com.github.insanusmokrassar.TelegramBotAPI.types.message.content
|
package com.github.insanusmokrassar.TelegramBotAPI.types.message.content
|
||||||
|
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.FullTextSourcesList
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.TextPart
|
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.TextPart
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.Request
|
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.Request
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.SendTextMessage
|
import com.github.insanusmokrassar.TelegramBotAPI.requests.send.SendTextMessage
|
||||||
@@ -13,6 +14,10 @@ import com.github.insanusmokrassar.TelegramBotAPI.utils.*
|
|||||||
|
|
||||||
data class TextContent(
|
data class TextContent(
|
||||||
val text: String,
|
val text: String,
|
||||||
|
/**
|
||||||
|
* Not full list of entities. This list WILL NOT contain [TextPart]s with [com.github.insanusmokrassar.TelegramBotAPI.types.MessageEntity.textsources.RegularTextSource]
|
||||||
|
* @see [TextContent.fullEntitiesList]
|
||||||
|
*/
|
||||||
val entities: List<TextPart> = emptyList()
|
val entities: List<TextPart> = emptyList()
|
||||||
) : MessageContent {
|
) : MessageContent {
|
||||||
override fun createResend(
|
override fun createResend(
|
||||||
@@ -66,4 +71,8 @@ data class TextContent(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fun TextContent.fullEntitiesList() = text.fullListOfSubSource(entities).map { it.source }
|
/**
|
||||||
|
* Convert its [TextContent.entities] to list of [com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.TextSource]
|
||||||
|
* with [com.github.insanusmokrassar.TelegramBotAPI.types.MessageEntity.textsources.RegularTextSource]
|
||||||
|
*/
|
||||||
|
fun TextContent.fullEntitiesList(): FullTextSourcesList = text.fullListOfSubSource(entities).map { it.source }
|
||||||
|
|||||||
@@ -1,10 +1,39 @@
|
|||||||
package com.github.insanusmokrassar.TelegramBotAPI.types.polls
|
package com.github.insanusmokrassar.TelegramBotAPI.types.polls
|
||||||
|
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.*
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.types.MessageEntity.*
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.utils.nonstrictJsonFormat
|
import com.github.insanusmokrassar.TelegramBotAPI.utils.nonstrictJsonFormat
|
||||||
|
import com.soywiz.klock.DateTime
|
||||||
|
import com.soywiz.klock.TimeSpan
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.*
|
||||||
import kotlinx.serialization.builtins.ListSerializer
|
import kotlinx.serialization.json.JsonObject
|
||||||
import kotlinx.serialization.json.*
|
import kotlinx.serialization.json.JsonObjectSerializer
|
||||||
|
|
||||||
|
sealed class ScheduledCloseInfo {
|
||||||
|
abstract val closeDateTime: DateTime
|
||||||
|
}
|
||||||
|
|
||||||
|
data class ExactScheduledCloseInfo(
|
||||||
|
override val closeDateTime: DateTime
|
||||||
|
) : ScheduledCloseInfo()
|
||||||
|
|
||||||
|
data class ApproximateScheduledCloseInfo(
|
||||||
|
val openDuration: TimeSpan,
|
||||||
|
@Suppress("MemberVisibilityCanBePrivate")
|
||||||
|
val startPoint: DateTime = DateTime.now()
|
||||||
|
) : ScheduledCloseInfo() {
|
||||||
|
override val closeDateTime: DateTime = startPoint + openDuration
|
||||||
|
}
|
||||||
|
|
||||||
|
val LongSeconds.asApproximateScheduledCloseInfo
|
||||||
|
get() = ApproximateScheduledCloseInfo(
|
||||||
|
TimeSpan(this * 1000.0)
|
||||||
|
)
|
||||||
|
val LongSeconds.asExactScheduledCloseInfo
|
||||||
|
get() = ExactScheduledCloseInfo(
|
||||||
|
DateTime(unixMillis = this * 1000.0)
|
||||||
|
)
|
||||||
|
|
||||||
@Serializable(PollSerializer::class)
|
@Serializable(PollSerializer::class)
|
||||||
sealed class Poll {
|
sealed class Poll {
|
||||||
@@ -14,6 +43,44 @@ sealed class Poll {
|
|||||||
abstract val votesCount: Int
|
abstract val votesCount: Int
|
||||||
abstract val isClosed: Boolean
|
abstract val isClosed: Boolean
|
||||||
abstract val isAnonymous: Boolean
|
abstract val isAnonymous: Boolean
|
||||||
|
abstract val scheduledCloseInfo: ScheduledCloseInfo?
|
||||||
|
}
|
||||||
|
|
||||||
|
@Serializable(PollSerializer::class)
|
||||||
|
sealed class MultipleAnswersPoll : Poll()
|
||||||
|
|
||||||
|
@Serializable
|
||||||
|
private class RawPoll(
|
||||||
|
@SerialName(idField)
|
||||||
|
val id: PollIdentifier,
|
||||||
|
@SerialName(questionField)
|
||||||
|
val question: String,
|
||||||
|
@SerialName(optionsField)
|
||||||
|
val options: List<PollOption>,
|
||||||
|
@SerialName(totalVoterCountField)
|
||||||
|
val votesCount: Int,
|
||||||
|
@SerialName(isClosedField)
|
||||||
|
val isClosed: Boolean = false,
|
||||||
|
@SerialName(isAnonymousField)
|
||||||
|
val isAnonymous: Boolean = false,
|
||||||
|
@SerialName(typeField)
|
||||||
|
val type: String,
|
||||||
|
@SerialName(allowsMultipleAnswersField)
|
||||||
|
val allowMultipleAnswers: Boolean = false,
|
||||||
|
@SerialName(correctOptionIdField)
|
||||||
|
val correctOptionId: Int? = null,
|
||||||
|
@SerialName(explanationField)
|
||||||
|
val explanation: String? = null,
|
||||||
|
@SerialName(explanationEntitiesField)
|
||||||
|
val explanationEntities: List<RawMessageEntity> = emptyList(),
|
||||||
|
@SerialName(openPeriodField)
|
||||||
|
val openPeriod: LongSeconds? = null,
|
||||||
|
@SerialName(closeDateField)
|
||||||
|
val closeDate: LongSeconds? = null
|
||||||
|
) {
|
||||||
|
@Transient
|
||||||
|
val scheduledCloseInfo: ScheduledCloseInfo?
|
||||||
|
= closeDate ?.asExactScheduledCloseInfo ?: openPeriod ?.asApproximateScheduledCloseInfo
|
||||||
}
|
}
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
@@ -30,91 +97,131 @@ data class UnknownPollType internal constructor(
|
|||||||
override val isClosed: Boolean = false,
|
override val isClosed: Boolean = false,
|
||||||
@SerialName(isAnonymousField)
|
@SerialName(isAnonymousField)
|
||||||
override val isAnonymous: Boolean = false,
|
override val isAnonymous: Boolean = false,
|
||||||
val raw: String
|
|
||||||
) : Poll()
|
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
|
val raw: JsonObject
|
||||||
|
) : Poll() {
|
||||||
|
@Transient
|
||||||
|
override val scheduledCloseInfo: ScheduledCloseInfo? = raw.getPrimitiveOrNull(
|
||||||
|
closeDateField
|
||||||
|
) ?.longOrNull ?.asExactScheduledCloseInfo ?: raw.getPrimitiveOrNull(
|
||||||
|
openPeriodField
|
||||||
|
) ?.longOrNull ?.asApproximateScheduledCloseInfo
|
||||||
|
}
|
||||||
|
|
||||||
|
@Serializable(PollSerializer::class)
|
||||||
data class RegularPoll(
|
data class RegularPoll(
|
||||||
@SerialName(idField)
|
|
||||||
override val id: PollIdentifier,
|
override val id: PollIdentifier,
|
||||||
@SerialName(questionField)
|
|
||||||
override val question: String,
|
override val question: String,
|
||||||
@SerialName(optionsField)
|
|
||||||
override val options: List<PollOption>,
|
override val options: List<PollOption>,
|
||||||
@SerialName(totalVoterCountField)
|
|
||||||
override val votesCount: Int,
|
override val votesCount: Int,
|
||||||
@SerialName(isClosedField)
|
|
||||||
override val isClosed: Boolean = false,
|
override val isClosed: Boolean = false,
|
||||||
@SerialName(isAnonymousField)
|
|
||||||
override val isAnonymous: Boolean = false,
|
override val isAnonymous: Boolean = false,
|
||||||
@SerialName(allowsMultipleAnswersField)
|
val allowMultipleAnswers: Boolean = false,
|
||||||
val allowMultipleAnswers: Boolean = false
|
override val scheduledCloseInfo: ScheduledCloseInfo? = null
|
||||||
) : Poll()
|
) : MultipleAnswersPoll()
|
||||||
|
|
||||||
@Serializable
|
@Serializable(PollSerializer::class)
|
||||||
data class QuizPoll(
|
data class QuizPoll(
|
||||||
@SerialName(idField)
|
|
||||||
override val id: PollIdentifier,
|
override val id: PollIdentifier,
|
||||||
@SerialName(questionField)
|
|
||||||
override val question: String,
|
override val question: String,
|
||||||
@SerialName(optionsField)
|
|
||||||
override val options: List<PollOption>,
|
override val options: List<PollOption>,
|
||||||
@SerialName(totalVoterCountField)
|
|
||||||
override val votesCount: Int,
|
override val votesCount: Int,
|
||||||
/**
|
/**
|
||||||
* Nullable due to documentation (https://core.telegram.org/bots/api#poll)
|
* Nullable due to documentation (https://core.telegram.org/bots/api#poll)
|
||||||
*/
|
*/
|
||||||
@SerialName(correctOptionIdField)
|
|
||||||
val correctOptionId: Int? = null,
|
val correctOptionId: Int? = null,
|
||||||
@SerialName(isClosedField)
|
override val explanation: String? = null,
|
||||||
|
override val explanationEntities: List<TextPart> = emptyList(),
|
||||||
override val isClosed: Boolean = false,
|
override val isClosed: Boolean = false,
|
||||||
@SerialName(isAnonymousField)
|
override val isAnonymous: Boolean = false,
|
||||||
override val isAnonymous: Boolean = false
|
override val scheduledCloseInfo: ScheduledCloseInfo? = null
|
||||||
) : Poll()
|
) : Poll(), CaptionedInput, ExplainedInput {
|
||||||
|
@Deprecated("Will be removed in near updates", ReplaceWith("explanation"))
|
||||||
|
override val caption: String?
|
||||||
|
get() = explanation
|
||||||
|
@Deprecated("Will be removed in near updates", ReplaceWith("explanationEntities"))
|
||||||
|
override val captionEntities: List<TextPart>
|
||||||
|
get() = explanationEntities
|
||||||
|
}
|
||||||
|
|
||||||
@Serializer(Poll::class)
|
@Serializer(Poll::class)
|
||||||
internal object PollSerializer : KSerializer<Poll> {
|
internal object PollSerializer : KSerializer<Poll> {
|
||||||
private val pollOptionsSerializer = ListSerializer(PollOption.serializer())
|
override val descriptor: SerialDescriptor
|
||||||
|
get() = RawPoll.serializer().descriptor
|
||||||
|
|
||||||
override fun deserialize(decoder: Decoder): Poll {
|
override fun deserialize(decoder: Decoder): Poll {
|
||||||
val asJson = JsonObjectSerializer.deserialize(decoder)
|
val asJson = JsonObjectSerializer.deserialize(decoder)
|
||||||
|
val rawPoll = nonstrictJsonFormat.fromJson(RawPoll.serializer(), asJson)
|
||||||
|
|
||||||
return when (asJson.getPrimitive(typeField).content) {
|
return when (rawPoll.type) {
|
||||||
regularPollType -> nonstrictJsonFormat.fromJson(
|
quizPollType -> QuizPoll(
|
||||||
RegularPoll.serializer(),
|
rawPoll.id,
|
||||||
asJson
|
rawPoll.question,
|
||||||
|
rawPoll.options,
|
||||||
|
rawPoll.votesCount,
|
||||||
|
rawPoll.correctOptionId,
|
||||||
|
rawPoll.explanation,
|
||||||
|
rawPoll.explanation?.let { rawPoll.explanationEntities.asTextParts(it) } ?: emptyList(),
|
||||||
|
rawPoll.isClosed,
|
||||||
|
rawPoll.isAnonymous,
|
||||||
|
rawPoll.scheduledCloseInfo
|
||||||
)
|
)
|
||||||
quizPollType -> nonstrictJsonFormat.fromJson(
|
regularPollType -> RegularPoll(
|
||||||
QuizPoll.serializer(),
|
rawPoll.id,
|
||||||
asJson
|
rawPoll.question,
|
||||||
|
rawPoll.options,
|
||||||
|
rawPoll.votesCount,
|
||||||
|
rawPoll.isClosed,
|
||||||
|
rawPoll.isAnonymous,
|
||||||
|
rawPoll.allowMultipleAnswers,
|
||||||
|
rawPoll.scheduledCloseInfo
|
||||||
)
|
)
|
||||||
else -> UnknownPollType(
|
else -> UnknownPollType(
|
||||||
asJson.getPrimitive(idField).content,
|
rawPoll.id,
|
||||||
asJson.getPrimitive(questionField).content,
|
rawPoll.question,
|
||||||
nonstrictJsonFormat.fromJson(
|
rawPoll.options,
|
||||||
pollOptionsSerializer,
|
rawPoll.votesCount,
|
||||||
asJson.getArray(optionsField)
|
rawPoll.isClosed,
|
||||||
),
|
rawPoll.isAnonymous,
|
||||||
asJson.getPrimitive(totalVoterCountField).int,
|
asJson
|
||||||
asJson.getPrimitiveOrNull(isClosedField) ?.booleanOrNull ?: false,
|
|
||||||
asJson.getPrimitiveOrNull(isAnonymousField) ?.booleanOrNull ?: true,
|
|
||||||
asJson.toString()
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun serialize(encoder: Encoder, value: Poll) {
|
override fun serialize(encoder: Encoder, value: Poll) {
|
||||||
val asJson = when (value) {
|
val closeInfo = value.scheduledCloseInfo
|
||||||
is RegularPoll -> nonstrictJsonFormat.toJson(RegularPoll.serializer(), value)
|
val rawPoll = when (value) {
|
||||||
is QuizPoll -> nonstrictJsonFormat.toJson(QuizPoll.serializer(), value)
|
is RegularPoll -> RawPoll(
|
||||||
is UnknownPollType -> throw IllegalArgumentException("Currently unable to correctly serialize object of poll $value")
|
value.id,
|
||||||
}
|
value.question,
|
||||||
val resultJson = JsonObject(
|
value.options,
|
||||||
asJson.jsonObject + (typeField to when (value) {
|
value.votesCount,
|
||||||
is RegularPoll -> JsonPrimitive(regularPollType)
|
value.isClosed,
|
||||||
is QuizPoll -> JsonPrimitive(quizPollType)
|
value.isAnonymous,
|
||||||
is UnknownPollType -> throw IllegalArgumentException("Currently unable to correctly serialize object of poll $value")
|
regularPollType,
|
||||||
})
|
value.allowMultipleAnswers,
|
||||||
|
openPeriod = (closeInfo as? ApproximateScheduledCloseInfo) ?.openDuration ?.seconds ?.toLong(),
|
||||||
|
closeDate = (closeInfo as? ExactScheduledCloseInfo) ?.closeDateTime ?.unixMillisLong ?.div(1000L)
|
||||||
)
|
)
|
||||||
JsonObjectSerializer.serialize(encoder, resultJson)
|
is QuizPoll -> RawPoll(
|
||||||
|
value.id,
|
||||||
|
value.question,
|
||||||
|
value.options,
|
||||||
|
value.votesCount,
|
||||||
|
value.isClosed,
|
||||||
|
value.isAnonymous,
|
||||||
|
regularPollType,
|
||||||
|
correctOptionId = value.correctOptionId,
|
||||||
|
explanation = value.explanation,
|
||||||
|
explanationEntities = value.explanationEntities.asRawMessageEntities(),
|
||||||
|
openPeriod = (closeInfo as? ApproximateScheduledCloseInfo) ?.openDuration ?.seconds ?.toLong(),
|
||||||
|
closeDate = (closeInfo as? ExactScheduledCloseInfo) ?.closeDateTime ?.unixMillisLong ?.div(1000L)
|
||||||
|
)
|
||||||
|
is UnknownPollType -> {
|
||||||
|
JsonObjectSerializer.serialize(encoder, value.raw)
|
||||||
|
return
|
||||||
|
}
|
||||||
|
}
|
||||||
|
RawPoll.serializer().serialize(encoder, rawPoll)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
package com.github.insanusmokrassar.TelegramBotAPI.types.update
|
package com.github.insanusmokrassar.TelegramBotAPI.types.update
|
||||||
|
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.UpdateIdentifier
|
import com.github.insanusmokrassar.TelegramBotAPI.types.UpdateIdentifier
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.Message
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.CommonMessage
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.BaseEditMessageUpdate
|
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.BaseEditMessageUpdate
|
||||||
|
|
||||||
data class EditChannelPostUpdate(
|
data class EditChannelPostUpdate(
|
||||||
override val updateId: UpdateIdentifier,
|
override val updateId: UpdateIdentifier,
|
||||||
override val data: Message
|
override val data: CommonMessage<*>
|
||||||
) : BaseEditMessageUpdate
|
) : BaseEditMessageUpdate
|
||||||
|
|||||||
@@ -1,10 +1,10 @@
|
|||||||
package com.github.insanusmokrassar.TelegramBotAPI.types.update
|
package com.github.insanusmokrassar.TelegramBotAPI.types.update
|
||||||
|
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.UpdateIdentifier
|
import com.github.insanusmokrassar.TelegramBotAPI.types.UpdateIdentifier
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.Message
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.CommonMessage
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.BaseEditMessageUpdate
|
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.BaseEditMessageUpdate
|
||||||
|
|
||||||
data class EditMessageUpdate(
|
data class EditMessageUpdate(
|
||||||
override val updateId: UpdateIdentifier,
|
override val updateId: UpdateIdentifier,
|
||||||
override val data: Message
|
override val data: CommonMessage<*>
|
||||||
) : BaseEditMessageUpdate
|
) : BaseEditMessageUpdate
|
||||||
|
|||||||
@@ -4,8 +4,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.CallbackQuery.RawCallbac
|
|||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.ChosenInlineResult.RawChosenInlineResult
|
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.ChosenInlineResult.RawChosenInlineResult
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.query.RawInlineQuery
|
import com.github.insanusmokrassar.TelegramBotAPI.types.InlineQueries.query.RawInlineQuery
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.UpdateIdentifier
|
import com.github.insanusmokrassar.TelegramBotAPI.types.UpdateIdentifier
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.Message
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.*
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.TelegramBotAPIMessageDeserializeOnlySerializer
|
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.payments.PreCheckoutQuery
|
import com.github.insanusmokrassar.TelegramBotAPI.types.payments.PreCheckoutQuery
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.payments.ShippingQuery
|
import com.github.insanusmokrassar.TelegramBotAPI.types.payments.ShippingQuery
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.polls.Poll
|
import com.github.insanusmokrassar.TelegramBotAPI.types.polls.Poll
|
||||||
@@ -13,8 +12,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.polls.PollAnswer
|
|||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.UnknownUpdateType
|
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.UnknownUpdateType
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.Update
|
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.Update
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.updateIdField
|
import com.github.insanusmokrassar.TelegramBotAPI.types.updateIdField
|
||||||
import kotlinx.serialization.SerialName
|
import kotlinx.serialization.*
|
||||||
import kotlinx.serialization.Serializable
|
|
||||||
import kotlinx.serialization.json.JsonElement
|
import kotlinx.serialization.json.JsonElement
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
@@ -22,11 +20,11 @@ internal data class RawUpdate constructor(
|
|||||||
@SerialName(updateIdField)
|
@SerialName(updateIdField)
|
||||||
val updateId: UpdateIdentifier,
|
val updateId: UpdateIdentifier,
|
||||||
@Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class)
|
@Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class)
|
||||||
private val edited_message: Message? = null,
|
private val edited_message: CommonMessage<*>? = null,
|
||||||
@Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class)
|
@Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class)
|
||||||
private val message: Message? = null,
|
private val message: Message? = null,
|
||||||
@Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class)
|
@Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class)
|
||||||
private val edited_channel_post: Message? = null,
|
private val edited_channel_post: CommonMessage<*>? = null,
|
||||||
@Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class)
|
@Serializable(TelegramBotAPIMessageDeserializeOnlySerializer::class)
|
||||||
private val channel_post: Message? = null,
|
private val channel_post: Message? = null,
|
||||||
private val inline_query: RawInlineQuery? = null,
|
private val inline_query: RawInlineQuery? = null,
|
||||||
@@ -42,7 +40,8 @@ internal data class RawUpdate constructor(
|
|||||||
* @return One of children of [Update] interface or null in case of unknown type of update
|
* @return One of children of [Update] interface or null in case of unknown type of update
|
||||||
*/
|
*/
|
||||||
fun asUpdate(raw: JsonElement): Update {
|
fun asUpdate(raw: JsonElement): Update {
|
||||||
return initedUpdate ?: when {
|
return initedUpdate ?: try {
|
||||||
|
when {
|
||||||
edited_message != null -> EditMessageUpdate(updateId, edited_message)
|
edited_message != null -> EditMessageUpdate(updateId, edited_message)
|
||||||
message != null -> MessageUpdate(updateId, message)
|
message != null -> MessageUpdate(updateId, message)
|
||||||
edited_channel_post != null -> EditChannelPostUpdate(updateId, edited_channel_post)
|
edited_channel_post != null -> EditChannelPostUpdate(updateId, edited_channel_post)
|
||||||
@@ -60,8 +59,20 @@ internal data class RawUpdate constructor(
|
|||||||
poll_answer != null -> PollAnswerUpdate(updateId, poll_answer)
|
poll_answer != null -> PollAnswerUpdate(updateId, poll_answer)
|
||||||
else -> UnknownUpdateType(
|
else -> UnknownUpdateType(
|
||||||
updateId,
|
updateId,
|
||||||
raw.toString()
|
raw.toString(),
|
||||||
|
raw
|
||||||
)
|
)
|
||||||
|
}
|
||||||
|
} catch (e: Error) {
|
||||||
|
when (e) {
|
||||||
|
is SerializationException,
|
||||||
|
is NotImplementedError -> UnknownUpdateType(
|
||||||
|
updateId,
|
||||||
|
raw.toString(),
|
||||||
|
raw
|
||||||
|
)
|
||||||
|
else -> throw e
|
||||||
|
}
|
||||||
}.also {
|
}.also {
|
||||||
initedUpdate = it
|
initedUpdate = it
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,3 +1,7 @@
|
|||||||
package com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts
|
package com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts
|
||||||
|
|
||||||
interface BaseEditMessageUpdate : BaseMessageUpdate
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.CommonMessage
|
||||||
|
|
||||||
|
interface BaseEditMessageUpdate : BaseMessageUpdate {
|
||||||
|
override val data: CommonMessage<*>
|
||||||
|
}
|
||||||
|
|||||||
@@ -4,6 +4,7 @@ import com.github.insanusmokrassar.TelegramBotAPI.types.UpdateIdentifier
|
|||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.update.RawUpdate
|
import com.github.insanusmokrassar.TelegramBotAPI.types.update.RawUpdate
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.utils.nonstrictJsonFormat
|
import com.github.insanusmokrassar.TelegramBotAPI.utils.nonstrictJsonFormat
|
||||||
import kotlinx.serialization.*
|
import kotlinx.serialization.*
|
||||||
|
import kotlinx.serialization.json.JsonElement
|
||||||
import kotlinx.serialization.json.JsonElementSerializer
|
import kotlinx.serialization.json.JsonElementSerializer
|
||||||
|
|
||||||
interface Update {
|
interface Update {
|
||||||
@@ -13,10 +14,11 @@ interface Update {
|
|||||||
|
|
||||||
data class UnknownUpdateType(
|
data class UnknownUpdateType(
|
||||||
override val updateId: UpdateIdentifier,
|
override val updateId: UpdateIdentifier,
|
||||||
override val data: String
|
override val data: String,
|
||||||
|
val rawJson: JsonElement
|
||||||
) : Update
|
) : Update
|
||||||
|
|
||||||
internal object UpdateSerializerWithoutDeserialization : KSerializer<Update> {
|
internal object UpdateSerializerWithoutSerialization : KSerializer<Update> {
|
||||||
override val descriptor: SerialDescriptor = JsonElementSerializer.descriptor
|
override val descriptor: SerialDescriptor = JsonElementSerializer.descriptor
|
||||||
|
|
||||||
override fun deserialize(decoder: Decoder): Update = UpdateDeserializationStrategy.deserialize(decoder)
|
override fun deserialize(decoder: Decoder): Update = UpdateDeserializationStrategy.deserialize(decoder)
|
||||||
|
|||||||
@@ -1,14 +1,13 @@
|
|||||||
package com.github.insanusmokrassar.TelegramBotAPI.utils
|
package com.github.insanusmokrassar.TelegramBotAPI.utils
|
||||||
|
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.*
|
import com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.*
|
||||||
|
import com.github.insanusmokrassar.TelegramBotAPI.types.*
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.*
|
import com.github.insanusmokrassar.TelegramBotAPI.types.ParseMode.*
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.captionLength
|
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.TextContent
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.TextContent
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.fullEntitiesList
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.content.fullEntitiesList
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.textLength
|
|
||||||
|
|
||||||
fun createFormattedText(
|
fun createFormattedText(
|
||||||
entities: List<TextSource>,
|
entities: FullTextSourcesList,
|
||||||
partLength: Int = 4096,
|
partLength: Int = 4096,
|
||||||
mode: ParseMode = MarkdownParseMode
|
mode: ParseMode = MarkdownParseMode
|
||||||
): List<String> {
|
): List<String> {
|
||||||
@@ -49,50 +48,74 @@ fun createFormattedText(
|
|||||||
|
|
||||||
|
|
||||||
fun createMarkdownText(
|
fun createMarkdownText(
|
||||||
entities: List<TextSource>,
|
entities: FullTextSourcesList,
|
||||||
partLength: Int = 4096
|
partLength: Int = 4096
|
||||||
): List<String> = createFormattedText(entities, partLength, MarkdownParseMode)
|
): List<String> = createFormattedText(entities, partLength, MarkdownParseMode)
|
||||||
|
|
||||||
fun CaptionedInput.toMarkdownCaptions(): List<String> = createMarkdownText(
|
fun FullTextSourcesList.toMarkdownCaptions(): List<String> = createMarkdownText(
|
||||||
fullEntitiesList(),
|
this,
|
||||||
captionLength.last + 1
|
captionLength.last + 1
|
||||||
)
|
)
|
||||||
|
fun CaptionedInput.toMarkdownCaptions(): List<String> = fullEntitiesList().toMarkdownCaptions()
|
||||||
|
|
||||||
fun TextContent.toMarkdownTexts(): List<String> = createMarkdownText(
|
fun FullTextSourcesList.toMarkdownTexts(): List<String> = createMarkdownText(
|
||||||
fullEntitiesList(),
|
this,
|
||||||
textLength.last + 1
|
textLength.last + 1
|
||||||
)
|
)
|
||||||
|
fun TextContent.toMarkdownTexts(): List<String> = fullEntitiesList().toMarkdownTexts()
|
||||||
|
|
||||||
|
fun FullTextSourcesList.toMarkdownExplanations(): List<String> = createMarkdownText(
|
||||||
|
this,
|
||||||
|
explanationLimit.last + 1
|
||||||
|
)
|
||||||
|
fun ExplainedInput.toMarkdownExplanations(): List<String> = fullEntitiesList().toMarkdownTexts()
|
||||||
|
|
||||||
|
|
||||||
fun createMarkdownV2Text(
|
fun createMarkdownV2Text(
|
||||||
entities: List<TextSource>,
|
entities: FullTextSourcesList,
|
||||||
partLength: Int = 4096
|
partLength: Int = 4096
|
||||||
): List<String> = createFormattedText(entities, partLength, MarkdownV2ParseMode)
|
): List<String> = createFormattedText(entities, partLength, MarkdownV2ParseMode)
|
||||||
|
|
||||||
fun CaptionedInput.toMarkdownV2Captions(): List<String> = createMarkdownV2Text(
|
fun FullTextSourcesList.toMarkdownV2Captions(): List<String> = createMarkdownV2Text(
|
||||||
fullEntitiesList(),
|
this,
|
||||||
captionLength.last + 1
|
captionLength.last + 1
|
||||||
)
|
)
|
||||||
|
fun CaptionedInput.toMarkdownV2Captions(): List<String> = fullEntitiesList().toMarkdownV2Captions()
|
||||||
|
|
||||||
fun TextContent.toMarkdownV2Texts(): List<String> = createMarkdownV2Text(
|
fun FullTextSourcesList.toMarkdownV2Texts(): List<String> = createMarkdownV2Text(
|
||||||
fullEntitiesList(),
|
this,
|
||||||
textLength.last + 1
|
textLength.last + 1
|
||||||
)
|
)
|
||||||
|
fun TextContent.toMarkdownV2Texts(): List<String> = fullEntitiesList().toMarkdownV2Texts()
|
||||||
|
|
||||||
|
fun FullTextSourcesList.toMarkdownV2Explanations(): List<String> = createMarkdownV2Text(
|
||||||
|
this,
|
||||||
|
explanationLimit.last + 1
|
||||||
|
)
|
||||||
|
fun ExplainedInput.toMarkdownV2Explanations(): List<String> = fullEntitiesList().toMarkdownV2Texts()
|
||||||
|
|
||||||
|
|
||||||
fun createHtmlText(
|
fun createHtmlText(
|
||||||
entities: List<TextSource>,
|
entities: FullTextSourcesList,
|
||||||
partLength: Int = 4096
|
partLength: Int = 4096
|
||||||
): List<String> = createFormattedText(entities, partLength, HTMLParseMode)
|
): List<String> = createFormattedText(entities, partLength, HTMLParseMode)
|
||||||
|
|
||||||
fun CaptionedInput.toHtmlCaptions(): List<String> = createHtmlText(
|
fun FullTextSourcesList.toHtmlCaptions(): List<String> = createHtmlText(
|
||||||
fullEntitiesList(),
|
this,
|
||||||
captionLength.last + 1
|
captionLength.last + 1
|
||||||
)
|
)
|
||||||
|
fun CaptionedInput.toHtmlCaptions(): List<String> = fullEntitiesList().toHtmlCaptions()
|
||||||
|
|
||||||
fun TextContent.toHtmlTexts(): List<String> = createHtmlText(
|
fun FullTextSourcesList.toHtmlTexts(): List<String> = createHtmlText(
|
||||||
fullEntitiesList(),
|
this,
|
||||||
textLength.last + 1
|
textLength.last + 1
|
||||||
)
|
)
|
||||||
|
fun TextContent.toHtmlTexts(): List<String> = fullEntitiesList().toHtmlTexts()
|
||||||
|
|
||||||
|
fun FullTextSourcesList.toHtmlExplanations(): List<String> = createHtmlText(
|
||||||
|
this,
|
||||||
|
explanationLimit.last + 1
|
||||||
|
)
|
||||||
|
fun ExplainedInput.toHtmlExplanations(): List<String> = fullEntitiesList().toHtmlTexts()
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
package com.github.insanusmokrassar.TelegramBotAPI.utils
|
||||||
|
|
||||||
|
import kotlinx.coroutines.CoroutineScope
|
||||||
|
import kotlinx.coroutines.supervisorScope
|
||||||
|
|
||||||
|
/**
|
||||||
|
* It will run [block] inside of [supervisorScope] to avoid problems with catching of exceptions
|
||||||
|
*
|
||||||
|
* @param [onException] Will be called when happen exception inside of [block]. By default will throw exception - this
|
||||||
|
* exception will be available for catching
|
||||||
|
*/
|
||||||
|
suspend inline fun <T> handleSafely(
|
||||||
|
noinline onException: suspend (Exception) -> T = { throw it },
|
||||||
|
noinline block: suspend CoroutineScope.() -> T
|
||||||
|
): T {
|
||||||
|
return try {
|
||||||
|
supervisorScope(block)
|
||||||
|
} catch (e: Exception) {
|
||||||
|
onException(e)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -3,6 +3,7 @@ package com.github.insanusmokrassar.TelegramBotAPI.utils
|
|||||||
import kotlinx.serialization.SerializationStrategy
|
import kotlinx.serialization.SerializationStrategy
|
||||||
import kotlinx.serialization.json.*
|
import kotlinx.serialization.json.*
|
||||||
|
|
||||||
|
@Suppress("EXPERIMENTAL_API_USAGE")
|
||||||
internal val nonstrictJsonFormat = Json {
|
internal val nonstrictJsonFormat = Json {
|
||||||
isLenient = true
|
isLenient = true
|
||||||
ignoreUnknownKeys = true
|
ignoreUnknownKeys = true
|
||||||
|
|||||||
@@ -0,0 +1,11 @@
|
|||||||
|
package com.github.insanusmokrassar.TelegramBotAPI.utils
|
||||||
|
|
||||||
|
import kotlinx.serialization.*
|
||||||
|
|
||||||
|
@Serializable(MimeTypeSerializer::class)
|
||||||
|
expect class MimeType {
|
||||||
|
val raw: String
|
||||||
|
}
|
||||||
|
|
||||||
|
@Serializer(MimeType::class)
|
||||||
|
internal expect object MimeTypeSerializer : KSerializer<MimeType>
|
||||||
@@ -3,7 +3,6 @@ package com.github.insanusmokrassar.TelegramBotAPI.utils
|
|||||||
import com.benasher44.uuid.uuid4
|
import com.benasher44.uuid.uuid4
|
||||||
import io.ktor.utils.io.core.Input
|
import io.ktor.utils.io.core.Input
|
||||||
import kotlinx.serialization.Serializable
|
import kotlinx.serialization.Serializable
|
||||||
import kotlinx.serialization.Transient
|
|
||||||
|
|
||||||
@Serializable
|
@Serializable
|
||||||
data class StorageFileInfo(
|
data class StorageFileInfo(
|
||||||
|
|||||||
@@ -4,9 +4,3 @@ import kotlinx.serialization.json.Json
|
|||||||
import kotlinx.serialization.json.JsonConfiguration
|
import kotlinx.serialization.json.JsonConfiguration
|
||||||
|
|
||||||
val TestsJsonFormat = Json(JsonConfiguration.Stable)
|
val TestsJsonFormat = Json(JsonConfiguration.Stable)
|
||||||
val NonstrictTestsJsonFormat = Json {
|
|
||||||
isLenient = true
|
|
||||||
ignoreUnknownKeys = true
|
|
||||||
serializeSpecialFloatingPointValues = true
|
|
||||||
useArrayPolymorphism = true
|
|
||||||
}
|
|
||||||
|
|||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.github.insanusmokrassar.TelegramBotAPI.utils
|
||||||
|
|
||||||
|
import kotlinx.serialization.*
|
||||||
|
import org.w3c.dom.get
|
||||||
|
import kotlin.browser.window
|
||||||
|
|
||||||
|
private val mimesCache = mutableMapOf<String, MimeType>()
|
||||||
|
|
||||||
|
@Serializable(MimeTypeSerializer::class)
|
||||||
|
actual class MimeType(
|
||||||
|
actual val raw: String
|
||||||
|
) {
|
||||||
|
@Transient
|
||||||
|
val jsMimeType = window.navigator.mimeTypes[raw]
|
||||||
|
|
||||||
|
override fun toString(): String = raw
|
||||||
|
}
|
||||||
|
|
||||||
|
@Serializer(MimeType::class)
|
||||||
|
internal actual object MimeTypeSerializer : KSerializer<MimeType> {
|
||||||
|
override val descriptor: SerialDescriptor = PrimitiveDescriptor("mimeType", PrimitiveKind.STRING)
|
||||||
|
|
||||||
|
override fun deserialize(decoder: Decoder): MimeType {
|
||||||
|
val mimeType = decoder.decodeString()
|
||||||
|
return mimesCache.getOrPut(mimeType) {
|
||||||
|
MimeType(mimeType)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun serialize(encoder: Encoder, value: MimeType) {
|
||||||
|
encoder.encodeString(value.raw)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,26 @@
|
|||||||
|
package com.github.insanusmokrassar.TelegramBotAPI.utils
|
||||||
|
|
||||||
|
import kotlinx.serialization.*
|
||||||
|
|
||||||
|
private val mimesCache = mutableMapOf<String, MimeType>()
|
||||||
|
|
||||||
|
@Serializable(MimeTypeSerializer::class)
|
||||||
|
actual class MimeType(
|
||||||
|
actual val raw: String
|
||||||
|
) : javax.activation.MimeType(raw)
|
||||||
|
|
||||||
|
@Serializer(MimeType::class)
|
||||||
|
internal actual object MimeTypeSerializer : KSerializer<MimeType> {
|
||||||
|
override val descriptor: SerialDescriptor = PrimitiveDescriptor("mimeType", PrimitiveKind.STRING)
|
||||||
|
|
||||||
|
override fun deserialize(decoder: Decoder): MimeType {
|
||||||
|
val mimeType = decoder.decodeString()
|
||||||
|
return mimesCache.getOrPut(mimeType) {
|
||||||
|
MimeType(mimeType)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun serialize(encoder: Encoder, value: MimeType) {
|
||||||
|
encoder.encodeString(value.raw)
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -4,15 +4,11 @@ import com.github.insanusmokrassar.TelegramBotAPI.bot.RequestsExecutor
|
|||||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.InputFile
|
import com.github.insanusmokrassar.TelegramBotAPI.requests.abstracts.InputFile
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.requests.webhook.SetWebhook
|
import com.github.insanusmokrassar.TelegramBotAPI.requests.webhook.SetWebhook
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.MediaGroupMessage
|
import com.github.insanusmokrassar.TelegramBotAPI.types.message.abstracts.MediaGroupMessage
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.update.MediaGroupUpdates.MediaGroupUpdate
|
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.*
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.update.RawUpdate
|
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.BaseMessageUpdate
|
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.types.update.abstracts.Update
|
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.updateshandlers.UpdateReceiver
|
import com.github.insanusmokrassar.TelegramBotAPI.updateshandlers.UpdateReceiver
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.updateshandlers.UpdatesFilter
|
import com.github.insanusmokrassar.TelegramBotAPI.updateshandlers.UpdatesFilter
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.updateshandlers.webhook.WebhookPrivateKeyConfig
|
import com.github.insanusmokrassar.TelegramBotAPI.updateshandlers.webhook.WebhookPrivateKeyConfig
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.utils.convertWithMediaGroupUpdates
|
import com.github.insanusmokrassar.TelegramBotAPI.utils.*
|
||||||
import com.github.insanusmokrassar.TelegramBotAPI.utils.nonstrictJsonFormat
|
|
||||||
import io.ktor.application.call
|
import io.ktor.application.call
|
||||||
import io.ktor.request.receiveText
|
import io.ktor.request.receiveText
|
||||||
import io.ktor.response.respond
|
import io.ktor.response.respond
|
||||||
@@ -45,6 +41,7 @@ suspend fun RequestsExecutor.setWebhook(
|
|||||||
scope: CoroutineScope = CoroutineScope(Executors.newFixedThreadPool(4).asCoroutineDispatcher()),
|
scope: CoroutineScope = CoroutineScope(Executors.newFixedThreadPool(4).asCoroutineDispatcher()),
|
||||||
allowedUpdates: List<String>? = null,
|
allowedUpdates: List<String>? = null,
|
||||||
maxAllowedConnections: Int? = null,
|
maxAllowedConnections: Int? = null,
|
||||||
|
exceptionsHandler: (suspend (Exception) -> Unit)? = null,
|
||||||
block: UpdateReceiver<Update>
|
block: UpdateReceiver<Update>
|
||||||
): Job {
|
): Job {
|
||||||
val executeDeferred = certificate ?.let {
|
val executeDeferred = certificate ?.let {
|
||||||
@@ -74,12 +71,18 @@ suspend fun RequestsExecutor.setWebhook(
|
|||||||
module {
|
module {
|
||||||
routing {
|
routing {
|
||||||
post(listenRoute) {
|
post(listenRoute) {
|
||||||
|
handleSafely(
|
||||||
|
{
|
||||||
|
exceptionsHandler ?.invoke(it)
|
||||||
|
}
|
||||||
|
) {
|
||||||
val asJson = nonstrictJsonFormat.parseJson(call.receiveText())
|
val asJson = nonstrictJsonFormat.parseJson(call.receiveText())
|
||||||
val update = nonstrictJsonFormat.fromJson(
|
val update = nonstrictJsonFormat.fromJson(
|
||||||
RawUpdate.serializer(),
|
UpdateDeserializationStrategy,
|
||||||
asJson
|
asJson
|
||||||
)
|
)
|
||||||
updatesChannel.send(update.asUpdate(asJson))
|
updatesChannel.send(update)
|
||||||
|
}
|
||||||
call.respond("Ok")
|
call.respond("Ok")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -113,11 +116,6 @@ suspend fun RequestsExecutor.setWebhook(
|
|||||||
launch {
|
launch {
|
||||||
for (update in updatesChannel) {
|
for (update in updatesChannel) {
|
||||||
val data = update.data
|
val data = update.data
|
||||||
if (data is MediaGroupUpdate) {
|
|
||||||
|
|
||||||
} else {
|
|
||||||
|
|
||||||
}
|
|
||||||
when (data) {
|
when (data) {
|
||||||
is MediaGroupMessage -> mediaGroupChannel.send("${data.mediaGroupId}${update::class.simpleName}" to update as BaseMessageUpdate)
|
is MediaGroupMessage -> mediaGroupChannel.send("${data.mediaGroupId}${update::class.simpleName}" to update as BaseMessageUpdate)
|
||||||
else -> block(update)
|
else -> block(update)
|
||||||
@@ -139,6 +137,33 @@ suspend fun RequestsExecutor.setWebhook(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
suspend fun RequestsExecutor.setWebhook(
|
||||||
|
url: String,
|
||||||
|
port: Int,
|
||||||
|
engineFactory: ApplicationEngineFactory<*, *>,
|
||||||
|
listenHost: String = "0.0.0.0",
|
||||||
|
listenRoute: String = "/",
|
||||||
|
certificate: InputFile? = null,
|
||||||
|
privateKeyConfig: WebhookPrivateKeyConfig? = null,
|
||||||
|
scope: CoroutineScope = CoroutineScope(Executors.newFixedThreadPool(4).asCoroutineDispatcher()),
|
||||||
|
allowedUpdates: List<String>? = null,
|
||||||
|
maxAllowedConnections: Int? = null,
|
||||||
|
block: UpdateReceiver<Update>
|
||||||
|
) = setWebhook(
|
||||||
|
url,
|
||||||
|
port,
|
||||||
|
engineFactory,
|
||||||
|
listenHost,
|
||||||
|
listenRoute,
|
||||||
|
certificate,
|
||||||
|
privateKeyConfig,
|
||||||
|
scope,
|
||||||
|
allowedUpdates,
|
||||||
|
maxAllowedConnections,
|
||||||
|
null,
|
||||||
|
block
|
||||||
|
)
|
||||||
|
|
||||||
suspend fun RequestsExecutor.setWebhook(
|
suspend fun RequestsExecutor.setWebhook(
|
||||||
url: String,
|
url: String,
|
||||||
port: Int,
|
port: Int,
|
||||||
|
|||||||
89
docs/build.gradle
Normal file
89
docs/build.gradle
Normal file
@@ -0,0 +1,89 @@
|
|||||||
|
buildscript {
|
||||||
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
|
jcenter()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
dependencies {
|
||||||
|
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
|
||||||
|
classpath "org.jetbrains.kotlin:kotlin-serialization:$kotlin_version"
|
||||||
|
classpath "org.jetbrains.dokka:dokka-gradle-plugin:$dokka_version"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
plugins {
|
||||||
|
id "org.jetbrains.kotlin.multiplatform" version "$kotlin_version"
|
||||||
|
id "org.jetbrains.kotlin.plugin.serialization" version "$kotlin_version"
|
||||||
|
id "org.jetbrains.dokka" version "$dokka_version"
|
||||||
|
}
|
||||||
|
|
||||||
|
repositories {
|
||||||
|
mavenLocal()
|
||||||
|
jcenter()
|
||||||
|
mavenCentral()
|
||||||
|
}
|
||||||
|
|
||||||
|
kotlin {
|
||||||
|
jvm()
|
||||||
|
js()
|
||||||
|
|
||||||
|
sourceSets {
|
||||||
|
commonMain {
|
||||||
|
dependencies {
|
||||||
|
implementation kotlin('stdlib')
|
||||||
|
|
||||||
|
project.parent.subprojects.forEach {
|
||||||
|
if (it != project) {
|
||||||
|
api it
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private Closure includeSourcesInDokka(String... approximateNames) {
|
||||||
|
return {
|
||||||
|
parent.subprojects.forEach {
|
||||||
|
if (it != project) {
|
||||||
|
File srcDir = new File(it.projectDir.absolutePath, "src")
|
||||||
|
if (srcDir.exists() && srcDir.isDirectory()) {
|
||||||
|
srcDir.eachFile { file ->
|
||||||
|
if (approximateNames.any { file.name.contains(it) } && file.isDirectory()) {
|
||||||
|
String pathToSrc = file.absolutePath
|
||||||
|
sourceRoot {
|
||||||
|
path = pathToSrc
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
String dokkaFolder = "$projectDir/dokka"
|
||||||
|
|
||||||
|
dokka {
|
||||||
|
(new File(dokkaFolder)).deleteDir()
|
||||||
|
|
||||||
|
outputFormat = 'html'
|
||||||
|
outputDirectory = dokkaFolder
|
||||||
|
|
||||||
|
multiplatform {
|
||||||
|
global {
|
||||||
|
skipDeprecated = true
|
||||||
|
|
||||||
|
sourceLink {
|
||||||
|
path = "./"
|
||||||
|
url = "https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/"
|
||||||
|
lineSuffix = "#L"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
common(includeSourcesInDokka("commonMain"))
|
||||||
|
js(includeSourcesInDokka("jsMain"/*, "commonMain"*/))
|
||||||
|
jvm(includeSourcesInDokka("jvmMain"/*, "commonMain"*/))
|
||||||
|
}
|
||||||
|
}
|
||||||
2310
docs/dokka/docs/alltypes/index.html
Normal file
2310
docs/dokka/docs/alltypes/index.html
Normal file
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,14 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>ChatRequest.chatId - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types</a> / <a href="index.html">ChatRequest</a> / <a href="./chat-id.html">chatId</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>chatId</h1>
|
||||||
|
(common) <a name="com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ChatRequest$chatId"></a>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">chatId</span><span class="symbol">: </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types/-chat-identifier.html"><span class="identifier">ChatIdentifier</span></a></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/ChatRequest.kt#L6">(source)</a>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,175 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>ChatRequest - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types</a> / <a href="./index.html">ChatRequest</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>ChatRequest</h1>
|
||||||
|
(common) <code><span class="keyword">interface </span><span class="identifier">ChatRequest</span></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/ChatRequest.kt#L5">(source)</a>
|
||||||
|
<h3>Properties</h3>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="chat-id.html">chatId</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">chatId</span><span class="symbol">: </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types/-chat-identifier.html"><span class="identifier">ChatIdentifier</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<h3>Inheritors</h3>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.chat.abstracts/-chat-member-request/index.html">ChatMemberRequest</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">interface </span><span class="identifier">ChatMemberRequest</span><span class="symbol"><</span><span class="identifier">T</span> <span class="symbol">:</span> <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html"><span class="identifier">Any</span></a><span class="symbol">></span> <span class="symbol">:</span> <a href="./index.html"><span class="identifier">ChatRequest</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.abstracts/-simple-request/index.html"><span class="identifier">SimpleRequest</span></a><span class="symbol"><</span><span class="identifier">T</span><span class="symbol">></span></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.chat.modify/-delete-chat-photo/index.html">DeleteChatPhoto</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">DeleteChatPhoto</span> <span class="symbol">:</span> <a href="./index.html"><span class="identifier">ChatRequest</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.abstracts/-simple-request/index.html"><span class="identifier">SimpleRequest</span></a><span class="symbol"><</span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html"><span class="identifier">Boolean</span></a><span class="symbol">></span></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.chat.stickers/-delete-chat-sticker-set/index.html">DeleteChatStickerSet</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">DeleteChatStickerSet</span> <span class="symbol">:</span> <a href="./index.html"><span class="identifier">ChatRequest</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.abstracts/-simple-request/index.html"><span class="identifier">SimpleRequest</span></a><span class="symbol"><</span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html"><span class="identifier">Boolean</span></a><span class="symbol">></span></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.chat/-export-chat-invite-link/index.html">ExportChatInviteLink</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">ExportChatInviteLink</span> <span class="symbol">:</span> <a href="./index.html"><span class="identifier">ChatRequest</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.abstracts/-simple-request/index.html"><span class="identifier">SimpleRequest</span></a><span class="symbol"><</span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html"><span class="identifier">String</span></a><span class="symbol">></span></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.chat.get/-get-chat/index.html">GetChat</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">GetChat</span> <span class="symbol">:</span> <a href="./index.html"><span class="identifier">ChatRequest</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.abstracts/-simple-request/index.html"><span class="identifier">SimpleRequest</span></a><span class="symbol"><</span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.chat.abstracts.extended/-extended-chat/index.html"><span class="identifier">ExtendedChat</span></a><span class="symbol">></span></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.chat.get/-get-chat-administrators/index.html">GetChatAdministrators</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">GetChatAdministrators</span> <span class="symbol">:</span> <a href="./index.html"><span class="identifier">ChatRequest</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.abstracts/-simple-request/index.html"><span class="identifier">SimpleRequest</span></a><span class="symbol"><</span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html"><span class="identifier">List</span></a><span class="symbol"><</span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-chat-member.abstracts/-administrator-chat-member/index.html"><span class="identifier">AdministratorChatMember</span></a><span class="symbol">></span><span class="symbol">></span></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.chat.get/-get-chat-members-count/index.html">GetChatMembersCount</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">GetChatMembersCount</span> <span class="symbol">:</span> <a href="./index.html"><span class="identifier">ChatRequest</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.abstracts/-simple-request/index.html"><span class="identifier">SimpleRequest</span></a><span class="symbol"><</span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html"><span class="identifier">Int</span></a><span class="symbol">></span></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.chat/-leave-chat/index.html">LeaveChat</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">LeaveChat</span> <span class="symbol">:</span> <a href="./index.html"><span class="identifier">ChatRequest</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.abstracts/-simple-request/index.html"><span class="identifier">SimpleRequest</span></a><span class="symbol"><</span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html"><span class="identifier">Boolean</span></a><span class="symbol">></span></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../-message-action/index.html">MessageAction</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">interface </span><span class="identifier">MessageAction</span> <span class="symbol">:</span> <a href="./index.html"><span class="identifier">ChatRequest</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.chat.modify/-pin-chat-message/index.html">PinChatMessage</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">PinChatMessage</span> <span class="symbol">:</span> <a href="./index.html"><span class="identifier">ChatRequest</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.abstracts/-simple-request/index.html"><span class="identifier">SimpleRequest</span></a><span class="symbol"><</span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html"><span class="identifier">Boolean</span></a><span class="symbol">></span><span class="symbol">, </span><a href="../-message-action/index.html"><span class="identifier">MessageAction</span></a><span class="symbol">, </span><a href="../-disable-notification/index.html"><span class="identifier">DisableNotification</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.send.abstracts/-send-chat-message-request.html">SendChatMessageRequest</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">interface </span><span class="identifier">SendChatMessageRequest</span><span class="symbol"><</span><span class="identifier">T</span> <span class="symbol">:</span> <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html"><span class="identifier">Any</span></a><span class="symbol">></span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.abstracts/-simple-request/index.html"><span class="identifier">SimpleRequest</span></a><span class="symbol"><</span><span class="identifier">T</span><span class="symbol">></span><span class="symbol">, </span><a href="./index.html"><span class="identifier">ChatRequest</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.send.payments/-send-invoice/index.html">SendInvoice</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">SendInvoice</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.payments.abstracts/-currencied/index.html"><span class="identifier">Currencied</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.payments.abstracts/-priced/index.html"><span class="identifier">Priced</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">ChatRequest</span></a><span class="symbol">, </span><a href="../-disable-notification/index.html"><span class="identifier">DisableNotification</span></a><span class="symbol">, </span><a href="../-reply-message-id/index.html"><span class="identifier">ReplyMessageId</span></a><span class="symbol">, </span><a href="../-reply-markup/index.html"><span class="identifier">ReplyMarkup</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.send.abstracts/-send-message-request.html"><span class="identifier">SendMessageRequest</span></a><span class="symbol"><</span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.abstracts/-content-message/index.html"><span class="identifier">ContentMessage</span></a><span class="symbol"><</span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.payments/-invoice-content/index.html"><span class="identifier">InvoiceContent</span></a><span class="symbol">></span><span class="symbol">></span></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.chat.modify/-set-chat-description/index.html">SetChatDescription</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">SetChatDescription</span> <span class="symbol">:</span> <a href="./index.html"><span class="identifier">ChatRequest</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.abstracts/-simple-request/index.html"><span class="identifier">SimpleRequest</span></a><span class="symbol"><</span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html"><span class="identifier">Boolean</span></a><span class="symbol">></span></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.chat.modify/-set-chat-permissions/index.html">SetChatPermissions</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">SetChatPermissions</span> <span class="symbol">:</span> <a href="./index.html"><span class="identifier">ChatRequest</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.abstracts/-simple-request/index.html"><span class="identifier">SimpleRequest</span></a><span class="symbol"><</span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html"><span class="identifier">Boolean</span></a><span class="symbol">></span></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.chat.modify/-set-chat-photo/index.html">SetChatPhoto</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">SetChatPhoto</span> <span class="symbol">:</span> <a href="./index.html"><span class="identifier">ChatRequest</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.abstracts/-multipart-request/index.html"><span class="identifier">MultipartRequest</span></a><span class="symbol"><</span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html"><span class="identifier">Boolean</span></a><span class="symbol">></span></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.chat.stickers/-set-chat-sticker-set/index.html">SetChatStickerSet</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">SetChatStickerSet</span> <span class="symbol">:</span> <a href="./index.html"><span class="identifier">ChatRequest</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.abstracts/-simple-request/index.html"><span class="identifier">SimpleRequest</span></a><span class="symbol"><</span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html"><span class="identifier">Boolean</span></a><span class="symbol">></span></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.chat.modify/-set-chat-title/index.html">SetChatTitle</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">SetChatTitle</span> <span class="symbol">:</span> <a href="./index.html"><span class="identifier">ChatRequest</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.abstracts/-simple-request/index.html"><span class="identifier">SimpleRequest</span></a><span class="symbol"><</span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html"><span class="identifier">Boolean</span></a><span class="symbol">></span></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.chat.modify/-unpin-chat-message/index.html">UnpinChatMessage</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">UnpinChatMessage</span> <span class="symbol">:</span> <a href="./index.html"><span class="identifier">ChatRequest</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.abstracts/-simple-request/index.html"><span class="identifier">SimpleRequest</span></a><span class="symbol"><</span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html"><span class="identifier">Boolean</span></a><span class="symbol">></span></code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>DisableNotification.disableNotification - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types</a> / <a href="index.html">DisableNotification</a> / <a href="./disable-notification.html">disableNotification</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>disableNotification</h1>
|
||||||
|
(common) <a name="com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.DisableNotification$disableNotification"></a>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">disableNotification</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html"><span class="identifier">Boolean</span></a></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/DisableNotification.kt#L4">(source)</a>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>DisableNotification - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types</a> / <a href="./index.html">DisableNotification</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>DisableNotification</h1>
|
||||||
|
(common) <code><span class="keyword">interface </span><span class="identifier">DisableNotification</span></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/DisableNotification.kt#L3">(source)</a>
|
||||||
|
<h3>Properties</h3>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="disable-notification.html">disableNotification</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">disableNotification</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html"><span class="identifier">Boolean</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<h3>Inheritors</h3>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.chat.modify/-pin-chat-message/index.html">PinChatMessage</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">PinChatMessage</span> <span class="symbol">:</span> <a href="../-chat-request/index.html"><span class="identifier">ChatRequest</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.abstracts/-simple-request/index.html"><span class="identifier">SimpleRequest</span></a><span class="symbol"><</span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html"><span class="identifier">Boolean</span></a><span class="symbol">></span><span class="symbol">, </span><a href="../-message-action/index.html"><span class="identifier">MessageAction</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">DisableNotification</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.send/-send-dice/index.html">SendDice</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">SendDice</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.send.abstracts/-replying-markup-send-message-request.html"><span class="identifier">ReplyingMarkupSendMessageRequest</span></a><span class="symbol"><</span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.abstracts/-content-message/index.html"><span class="identifier">ContentMessage</span></a><span class="symbol"><</span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.content/-dice-content/index.html"><span class="identifier">DiceContent</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><a href="../-reply-message-id/index.html"><span class="identifier">ReplyMessageId</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">DisableNotification</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.send.payments/-send-invoice/index.html">SendInvoice</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">SendInvoice</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.payments.abstracts/-currencied/index.html"><span class="identifier">Currencied</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.payments.abstracts/-priced/index.html"><span class="identifier">Priced</span></a><span class="symbol">, </span><a href="../-chat-request/index.html"><span class="identifier">ChatRequest</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">DisableNotification</span></a><span class="symbol">, </span><a href="../-reply-message-id/index.html"><span class="identifier">ReplyMessageId</span></a><span class="symbol">, </span><a href="../-reply-markup/index.html"><span class="identifier">ReplyMarkup</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.send.abstracts/-send-message-request.html"><span class="identifier">SendMessageRequest</span></a><span class="symbol"><</span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.abstracts/-content-message/index.html"><span class="identifier">ContentMessage</span></a><span class="symbol"><</span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.payments/-invoice-content/index.html"><span class="identifier">InvoiceContent</span></a><span class="symbol">></span><span class="symbol">></span></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.send.abstracts/-send-message-request.html">SendMessageRequest</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">interface </span><span class="identifier">SendMessageRequest</span><span class="symbol"><</span><span class="identifier">T</span> <span class="symbol">:</span> <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html"><span class="identifier">Any</span></a><span class="symbol">></span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.send.abstracts/-send-chat-message-request.html"><span class="identifier">SendChatMessageRequest</span></a><span class="symbol"><</span><span class="identifier">T</span><span class="symbol">></span><span class="symbol">, </span><a href="../-reply-message-id/index.html"><span class="identifier">ReplyMessageId</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">DisableNotification</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>DisableWebPagePreview.disableWebPagePreview - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types</a> / <a href="index.html">DisableWebPagePreview</a> / <a href="./disable-web-page-preview.html">disableWebPagePreview</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>disableWebPagePreview</h1>
|
||||||
|
(common) <a name="com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.DisableWebPagePreview$disableWebPagePreview"></a>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">disableWebPagePreview</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html"><span class="identifier">Boolean</span></a><span class="symbol">?</span></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/DisableWebPagePreview.kt#L4">(source)</a>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>DisableWebPagePreview - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types</a> / <a href="./index.html">DisableWebPagePreview</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>DisableWebPagePreview</h1>
|
||||||
|
(common) <code><span class="keyword">interface </span><span class="identifier">DisableWebPagePreview</span></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/DisableWebPagePreview.kt#L3">(source)</a>
|
||||||
|
<h3>Properties</h3>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="disable-web-page-preview.html">disableWebPagePreview</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">disableWebPagePreview</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html"><span class="identifier">Boolean</span></a><span class="symbol">?</span></code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<h3>Inheritors</h3>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-input-message-content/-input-text-message-content/index.html">InputTextMessageContent</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">InputTextMessageContent</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.-common-abstracts/-captioned-output/index.html"><span class="identifier">CaptionedOutput</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">DisableWebPagePreview</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.abstracts/-input-message-content.html"><span class="identifier">InputMessageContent</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.send/-send-text-message/index.html">SendTextMessage</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">SendTextMessage</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.send.abstracts/-send-message-request.html"><span class="identifier">SendMessageRequest</span></a><span class="symbol"><</span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.abstracts/-content-message/index.html"><span class="identifier">ContentMessage</span></a><span class="symbol"><</span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.content/-text-content/index.html"><span class="identifier">TextContent</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.send.abstracts/-replying-markup-send-message-request.html"><span class="identifier">ReplyingMarkupSendMessageRequest</span></a><span class="symbol"><</span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.abstracts/-content-message/index.html"><span class="identifier">ContentMessage</span></a><span class="symbol"><</span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.content/-text-content/index.html"><span class="identifier">TextContent</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.send.abstracts/-textable-send-message-request/index.html"><span class="identifier">TextableSendMessageRequest</span></a><span class="symbol"><</span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.abstracts/-content-message/index.html"><span class="identifier">ContentMessage</span></a><span class="symbol"><</span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.content/-text-content/index.html"><span class="identifier">TextContent</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><a href="./index.html"><span class="identifier">DisableWebPagePreview</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>InlineMessageAction - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types</a> / <a href="./index.html">InlineMessageAction</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>InlineMessageAction</h1>
|
||||||
|
(common) <code><span class="keyword">interface </span><span class="identifier">InlineMessageAction</span></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/InlineMessageAction.kt#L5">(source)</a>
|
||||||
|
<h3>Properties</h3>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="inline-message-id.html">inlineMessageId</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">inlineMessageId</span><span class="symbol">: </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types/-inline-message-identifier.html"><span class="identifier">InlineMessageIdentifier</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<h3>Inheritors</h3>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.games/-get-game-high-scores-by-inline-message-id/index.html">GetGameHighScoresByInlineMessageId</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">GetGameHighScoresByInlineMessageId</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.games.abstracts/-get-game-high-scores/index.html"><span class="identifier">GetGameHighScores</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">InlineMessageAction</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.games/-set-game-score-by-inline-message-id/index.html">SetGameScoreByInlineMessageId</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">SetGameScoreByInlineMessageId</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.games.abstracts/-set-game-score/index.html"><span class="identifier">SetGameScore</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">InlineMessageAction</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>InlineMessageAction.inlineMessageId - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types</a> / <a href="index.html">InlineMessageAction</a> / <a href="./inline-message-id.html">inlineMessageId</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>inlineMessageId</h1>
|
||||||
|
(common) <a name="com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.InlineMessageAction$inlineMessageId"></a>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">inlineMessageId</span><span class="symbol">: </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types/-inline-message-identifier.html"><span class="identifier">InlineMessageIdentifier</span></a></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/InlineMessageAction.kt#L6">(source)</a>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>MessageAction - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types</a> / <a href="./index.html">MessageAction</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>MessageAction</h1>
|
||||||
|
(common) <code><span class="keyword">interface </span><span class="identifier">MessageAction</span> <span class="symbol">:</span> <a href="../-chat-request/index.html"><span class="identifier">ChatRequest</span></a></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/MessageAction.kt#L5">(source)</a>
|
||||||
|
<h3>Properties</h3>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="message-id.html">messageId</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">messageId</span><span class="symbol">: </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types/-message-identifier.html"><span class="identifier">MessageIdentifier</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<h3>Inheritors</h3>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests/-delete-message/index.html">DeleteMessage</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">DeleteMessage</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.abstracts/-simple-request/index.html"><span class="identifier">SimpleRequest</span></a><span class="symbol"><</span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html"><span class="identifier">Boolean</span></a><span class="symbol">></span><span class="symbol">, </span><a href="./index.html"><span class="identifier">MessageAction</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.edit.abstracts/-edit-chat-message.html">EditChatMessage</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">interface </span><span class="identifier">EditChatMessage</span><span class="symbol"><</span><span class="identifier">MT</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.content.abstracts/-message-content.html"><span class="identifier">MessageContent</span></a><span class="symbol">></span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.abstracts/-simple-request/index.html"><span class="identifier">SimpleRequest</span></a><span class="symbol"><</span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.abstracts/-content-message/index.html"><span class="identifier">ContentMessage</span></a><span class="symbol"><</span><span class="identifier">MT</span><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><a href="./index.html"><span class="identifier">MessageAction</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests/-forward-message/index.html">ForwardMessage</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">ForwardMessage</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.abstracts/-simple-request/index.html"><span class="identifier">SimpleRequest</span></a><span class="symbol"><</span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.abstracts/-possibly-forwarded-message/index.html"><span class="identifier">PossiblyForwardedMessage</span></a><span class="symbol">></span><span class="symbol">, </span><a href="./index.html"><span class="identifier">MessageAction</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.games/-get-game-high-scores-by-chat/index.html">GetGameHighScoresByChat</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">GetGameHighScoresByChat</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.games.abstracts/-get-game-high-scores/index.html"><span class="identifier">GetGameHighScores</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">MessageAction</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.chat.modify/-pin-chat-message/index.html">PinChatMessage</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">PinChatMessage</span> <span class="symbol">:</span> <a href="../-chat-request/index.html"><span class="identifier">ChatRequest</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.abstracts/-simple-request/index.html"><span class="identifier">SimpleRequest</span></a><span class="symbol"><</span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html"><span class="identifier">Boolean</span></a><span class="symbol">></span><span class="symbol">, </span><a href="./index.html"><span class="identifier">MessageAction</span></a><span class="symbol">, </span><a href="../-disable-notification/index.html"><span class="identifier">DisableNotification</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.games/-set-game-score-by-chat-id/index.html">SetGameScoreByChatId</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">SetGameScoreByChatId</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.games.abstracts/-set-game-score/index.html"><span class="identifier">SetGameScore</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">MessageAction</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests/-stop-poll/index.html">StopPoll</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">StopPoll</span> <span class="symbol">:</span> <a href="./index.html"><span class="identifier">MessageAction</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.abstracts/-simple-request/index.html"><span class="identifier">SimpleRequest</span></a><span class="symbol"><</span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.polls/-poll/index.html"><span class="identifier">Poll</span></a><span class="symbol">></span><span class="symbol">, </span><a href="../-reply-markup/index.html"><span class="identifier">ReplyMarkup</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>MessageAction.messageId - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types</a> / <a href="index.html">MessageAction</a> / <a href="./message-id.html">messageId</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>messageId</h1>
|
||||||
|
(common) <a name="com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.MessageAction$messageId"></a>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">messageId</span><span class="symbol">: </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types/-message-identifier.html"><span class="identifier">MessageIdentifier</span></a></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/MessageAction.kt#L6">(source)</a>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,71 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>ReplyMarkup - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types</a> / <a href="./index.html">ReplyMarkup</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>ReplyMarkup</h1>
|
||||||
|
(common) <code><span class="keyword">interface </span><span class="identifier">ReplyMarkup</span></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/ReplyMarkup.kt#L5">(source)</a>
|
||||||
|
<h3>Properties</h3>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="reply-markup.html">replyMarkup</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">replyMarkup</span><span class="symbol">: </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.buttons/-keyboard-markup.html"><span class="identifier">KeyboardMarkup</span></a><span class="symbol">?</span></code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<h3>Inheritors</h3>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.edit.abstracts/-edit-reply-message/index.html">EditReplyMessage</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">interface </span><span class="identifier">EditReplyMessage</span> <span class="symbol">:</span> <a href="./index.html"><span class="identifier">ReplyMarkup</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.send.abstracts/-replying-markup-send-message-request.html">ReplyingMarkupSendMessageRequest</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">interface </span><span class="identifier">ReplyingMarkupSendMessageRequest</span><span class="symbol"><</span><span class="identifier">T</span> <span class="symbol">:</span> <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html"><span class="identifier">Any</span></a><span class="symbol">></span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.send.abstracts/-send-message-request.html"><span class="identifier">SendMessageRequest</span></a><span class="symbol"><</span><span class="identifier">T</span><span class="symbol">></span><span class="symbol">, </span><a href="./index.html"><span class="identifier">ReplyMarkup</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.send.games/-send-game/index.html">SendGame</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">SendGame</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.send.abstracts/-send-message-request.html"><span class="identifier">SendMessageRequest</span></a><span class="symbol"><</span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.abstracts/-content-message/index.html"><span class="identifier">ContentMessage</span></a><span class="symbol"><</span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.content/-game-content/index.html"><span class="identifier">GameContent</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><a href="./index.html"><span class="identifier">ReplyMarkup</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.send.payments/-send-invoice/index.html">SendInvoice</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">SendInvoice</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.payments.abstracts/-currencied/index.html"><span class="identifier">Currencied</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.payments.abstracts/-priced/index.html"><span class="identifier">Priced</span></a><span class="symbol">, </span><a href="../-chat-request/index.html"><span class="identifier">ChatRequest</span></a><span class="symbol">, </span><a href="../-disable-notification/index.html"><span class="identifier">DisableNotification</span></a><span class="symbol">, </span><a href="../-reply-message-id/index.html"><span class="identifier">ReplyMessageId</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">ReplyMarkup</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.send.abstracts/-send-message-request.html"><span class="identifier">SendMessageRequest</span></a><span class="symbol"><</span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.abstracts/-content-message/index.html"><span class="identifier">ContentMessage</span></a><span class="symbol"><</span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.payments/-invoice-content/index.html"><span class="identifier">InvoiceContent</span></a><span class="symbol">></span><span class="symbol">></span></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests/-stop-poll/index.html">StopPoll</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">StopPoll</span> <span class="symbol">:</span> <a href="../-message-action/index.html"><span class="identifier">MessageAction</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.abstracts/-simple-request/index.html"><span class="identifier">SimpleRequest</span></a><span class="symbol"><</span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.polls/-poll/index.html"><span class="identifier">Poll</span></a><span class="symbol">></span><span class="symbol">, </span><a href="./index.html"><span class="identifier">ReplyMarkup</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>ReplyMarkup.replyMarkup - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types</a> / <a href="index.html">ReplyMarkup</a> / <a href="./reply-markup.html">replyMarkup</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>replyMarkup</h1>
|
||||||
|
(common) <a name="com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ReplyMarkup$replyMarkup"></a>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">replyMarkup</span><span class="symbol">: </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.buttons/-keyboard-markup.html"><span class="identifier">KeyboardMarkup</span></a><span class="symbol">?</span></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/ReplyMarkup.kt#L6">(source)</a>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,55 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>ReplyMessageId - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types</a> / <a href="./index.html">ReplyMessageId</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>ReplyMessageId</h1>
|
||||||
|
(common) <code><span class="keyword">interface </span><span class="identifier">ReplyMessageId</span></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/ReplyMessageId.kt#L5">(source)</a>
|
||||||
|
<h3>Properties</h3>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="reply-to-message-id.html">replyToMessageId</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">replyToMessageId</span><span class="symbol">: </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types/-message-identifier.html"><span class="identifier">MessageIdentifier</span></a><span class="symbol">?</span></code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<h3>Inheritors</h3>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.send/-send-dice/index.html">SendDice</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">SendDice</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.send.abstracts/-replying-markup-send-message-request.html"><span class="identifier">ReplyingMarkupSendMessageRequest</span></a><span class="symbol"><</span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.abstracts/-content-message/index.html"><span class="identifier">ContentMessage</span></a><span class="symbol"><</span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.content/-dice-content/index.html"><span class="identifier">DiceContent</span></a><span class="symbol">></span><span class="symbol">></span><span class="symbol">, </span><a href="./index.html"><span class="identifier">ReplyMessageId</span></a><span class="symbol">, </span><a href="../-disable-notification/index.html"><span class="identifier">DisableNotification</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.send.payments/-send-invoice/index.html">SendInvoice</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">SendInvoice</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.payments.abstracts/-currencied/index.html"><span class="identifier">Currencied</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.payments.abstracts/-priced/index.html"><span class="identifier">Priced</span></a><span class="symbol">, </span><a href="../-chat-request/index.html"><span class="identifier">ChatRequest</span></a><span class="symbol">, </span><a href="../-disable-notification/index.html"><span class="identifier">DisableNotification</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">ReplyMessageId</span></a><span class="symbol">, </span><a href="../-reply-markup/index.html"><span class="identifier">ReplyMarkup</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.send.abstracts/-send-message-request.html"><span class="identifier">SendMessageRequest</span></a><span class="symbol"><</span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.abstracts/-content-message/index.html"><span class="identifier">ContentMessage</span></a><span class="symbol"><</span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.payments/-invoice-content/index.html"><span class="identifier">InvoiceContent</span></a><span class="symbol">></span><span class="symbol">></span></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.send.abstracts/-send-message-request.html">SendMessageRequest</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">interface </span><span class="identifier">SendMessageRequest</span><span class="symbol"><</span><span class="identifier">T</span> <span class="symbol">:</span> <a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html"><span class="identifier">Any</span></a><span class="symbol">></span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.send.abstracts/-send-chat-message-request.html"><span class="identifier">SendChatMessageRequest</span></a><span class="symbol"><</span><span class="identifier">T</span><span class="symbol">></span><span class="symbol">, </span><a href="./index.html"><span class="identifier">ReplyMessageId</span></a><span class="symbol">, </span><a href="../-disable-notification/index.html"><span class="identifier">DisableNotification</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>ReplyMessageId.replyToMessageId - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types</a> / <a href="index.html">ReplyMessageId</a> / <a href="./reply-to-message-id.html">replyToMessageId</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>replyToMessageId</h1>
|
||||||
|
(common) <a name="com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.ReplyMessageId$replyToMessageId"></a>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">replyToMessageId</span><span class="symbol">: </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types/-message-identifier.html"><span class="identifier">MessageIdentifier</span></a><span class="symbol">?</span></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/ReplyMessageId.kt#L6">(source)</a>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>UntilDate - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types</a> / <a href="./index.html">UntilDate</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>UntilDate</h1>
|
||||||
|
(common) <code><span class="keyword">interface </span><span class="identifier">UntilDate</span></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/UntilDate.kt#L5">(source)</a>
|
||||||
|
<h3>Properties</h3>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="until-date.html">untilDate</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">untilDate</span><span class="symbol">: </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types/-telegram-date/index.html"><span class="identifier">TelegramDate</span></a><span class="symbol">?</span></code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<h3>Inheritors</h3>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-chat-member.abstracts/-banned-chat-member.html">BannedChatMember</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">interface </span><span class="identifier">BannedChatMember</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-chat-member.abstracts/-chat-member/index.html"><span class="identifier">ChatMember</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">UntilDate</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.chat.members/-kick-chat-member/index.html">KickChatMember</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">KickChatMember</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.chat.abstracts/-chat-member-request/index.html"><span class="identifier">ChatMemberRequest</span></a><span class="symbol"><</span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html"><span class="identifier">Boolean</span></a><span class="symbol">></span><span class="symbol">, </span><a href="./index.html"><span class="identifier">UntilDate</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.chat.members/-promote-chat-member/index.html">PromoteChatMember</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">PromoteChatMember</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.chat.abstracts/-chat-member-request/index.html"><span class="identifier">ChatMemberRequest</span></a><span class="symbol"><</span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html"><span class="identifier">Boolean</span></a><span class="symbol">></span><span class="symbol">, </span><a href="./index.html"><span class="identifier">UntilDate</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.chat.members/-restrict-chat-member/index.html">RestrictChatMember</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">RestrictChatMember</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.chat.abstracts/-chat-member-request/index.html"><span class="identifier">ChatMemberRequest</span></a><span class="symbol"><</span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-boolean/index.html"><span class="identifier">Boolean</span></a><span class="symbol">></span><span class="symbol">, </span><a href="./index.html"><span class="identifier">UntilDate</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>UntilDate.untilDate - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types</a> / <a href="index.html">UntilDate</a> / <a href="./until-date.html">untilDate</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>untilDate</h1>
|
||||||
|
(common) <a name="com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types.UntilDate$untilDate"></a>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">untilDate</span><span class="symbol">: </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types/-telegram-date/index.html"><span class="identifier">TelegramDate</span></a><span class="symbol">?</span></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/types/UntilDate.kt#L6">(source)</a>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,81 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../index.html">docs</a> / <a href="./index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h2>Package com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.types</h2>
|
||||||
|
<h3>Types</h3>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="-chat-request/index.html">ChatRequest</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">interface </span><span class="identifier">ChatRequest</span></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="-disable-notification/index.html">DisableNotification</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">interface </span><span class="identifier">DisableNotification</span></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="-disable-web-page-preview/index.html">DisableWebPagePreview</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">interface </span><span class="identifier">DisableWebPagePreview</span></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="-inline-message-action/index.html">InlineMessageAction</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">interface </span><span class="identifier">InlineMessageAction</span></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="-message-action/index.html">MessageAction</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">interface </span><span class="identifier">MessageAction</span> <span class="symbol">:</span> <a href="-chat-request/index.html"><span class="identifier">ChatRequest</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="-reply-markup/index.html">ReplyMarkup</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">interface </span><span class="identifier">ReplyMarkup</span></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="-reply-message-id/index.html">ReplyMessageId</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">interface </span><span class="identifier">ReplyMessageId</span></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="-until-date/index.html">UntilDate</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">interface </span><span class="identifier">UntilDate</span></code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>CaptionedInput.captionEntities - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts</a> / <a href="index.html">CaptionedInput</a> / <a href="./caption-entities.html">captionEntities</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>captionEntities</h1>
|
||||||
|
(common) <a name="com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.CaptionedInput$captionEntities"></a>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">captionEntities</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html"><span class="identifier">List</span></a><span class="symbol"><</span><a href="../-text-part/index.html"><span class="identifier">TextPart</span></a><span class="symbol">></span></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/Captioned.kt#L19">(source)</a>
|
||||||
|
<p>Not full list of entities. This list WILL NOT contain <a href="../-text-part/index.html">TextPart</a>s with <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-message-entity.textsources/-regular-text-source/index.html">com.github.insanusmokrassar.TelegramBotAPI.types.MessageEntity.textsources.RegularTextSource</a></p>
|
||||||
|
<p><strong>See Also</strong><br/>
|
||||||
|
<p><a href="../full-entities-list.html">CaptionedInput.fullEntitiesList</a></p>
|
||||||
|
</p>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,127 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>CaptionedInput - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts</a> / <a href="./index.html">CaptionedInput</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>CaptionedInput</h1>
|
||||||
|
(common) <code><span class="keyword">interface </span><span class="identifier">CaptionedInput</span> <span class="symbol">:</span> <a href="../-captioned/index.html"><span class="identifier">Captioned</span></a></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/Captioned.kt#L14">(source)</a>
|
||||||
|
<h3>Properties</h3>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="caption-entities.html">captionEntities</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Not full list of entities. This list WILL NOT contain <a href="../-text-part/index.html">TextPart</a>s with <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-message-entity.textsources/-regular-text-source/index.html">com.github.insanusmokrassar.TelegramBotAPI.types.MessageEntity.textsources.RegularTextSource</a></p>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">captionEntities</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html"><span class="identifier">List</span></a><span class="symbol"><</span><a href="../-text-part/index.html"><span class="identifier">TextPart</span></a><span class="symbol">></span></code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<h3>Extension Functions</h3>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../full-entities-list.html">fullEntitiesList</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<p>Convert its <a href="caption-entities.html">CaptionedInput.captionEntities</a> to list of <a href="../-text-source/index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.TextSource</a>
|
||||||
|
with <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-message-entity.textsources/-regular-text-source/index.html">com.github.insanusmokrassar.TelegramBotAPI.types.MessageEntity.textsources.RegularTextSource</a></p>
|
||||||
|
<code><span class="keyword">fun </span><a href="./index.html"><span class="identifier">CaptionedInput</span></a><span class="symbol">.</span><span class="identifier">fullEntitiesList</span><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">: </span><a href="../-full-text-sources-list.html"><span class="identifier">FullTextSourcesList</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.utils/to-html-captions.html">toHtmlCaptions</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">fun </span><a href="./index.html"><span class="identifier">CaptionedInput</span></a><span class="symbol">.</span><span class="identifier">toHtmlCaptions</span><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html"><span class="identifier">List</span></a><span class="symbol"><</span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html"><span class="identifier">String</span></a><span class="symbol">></span></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.utils/to-markdown-captions.html">toMarkdownCaptions</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">fun </span><a href="./index.html"><span class="identifier">CaptionedInput</span></a><span class="symbol">.</span><span class="identifier">toMarkdownCaptions</span><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html"><span class="identifier">List</span></a><span class="symbol"><</span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html"><span class="identifier">String</span></a><span class="symbol">></span></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.utils/to-markdown-v2-captions.html">toMarkdownV2Captions</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">fun </span><a href="./index.html"><span class="identifier">CaptionedInput</span></a><span class="symbol">.</span><span class="identifier">toMarkdownV2Captions</span><span class="symbol">(</span><span class="symbol">)</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html"><span class="identifier">List</span></a><span class="symbol"><</span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html"><span class="identifier">String</span></a><span class="symbol">></span></code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<h3>Inheritors</h3>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.content.media/-animation-content/index.html">AnimationContent</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">AnimationContent</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.content.abstracts/-media-content/index.html"><span class="identifier">MediaContent</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">CaptionedInput</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.content.media/-audio-content/index.html">AudioContent</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">AudioContent</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.content.abstracts/-media-content/index.html"><span class="identifier">MediaContent</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">CaptionedInput</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.content.media/-document-content/index.html">DocumentContent</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">DocumentContent</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.content.abstracts/-media-content/index.html"><span class="identifier">MediaContent</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">CaptionedInput</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.games/-game/index.html">Game</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">Game</span> <span class="symbol">:</span> <a href="../-titled/index.html"><span class="identifier">Titled</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">CaptionedInput</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.content.abstracts/-media-group-content/index.html">MediaGroupContent</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">interface </span><span class="identifier">MediaGroupContent</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.content.abstracts/-media-content/index.html"><span class="identifier">MediaContent</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">CaptionedInput</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.polls/-quiz-poll/index.html">QuizPoll</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">QuizPoll</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.polls/-poll/index.html"><span class="identifier">Poll</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">CaptionedInput</span></a><span class="symbol">, </span><a href="../-explained-input/index.html"><span class="identifier">ExplainedInput</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.content.media/-voice-content/index.html">VoiceContent</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">VoiceContent</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.message.content.abstracts/-media-content/index.html"><span class="identifier">MediaContent</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">CaptionedInput</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,135 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>CaptionedOutput - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts</a> / <a href="./index.html">CaptionedOutput</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>CaptionedOutput</h1>
|
||||||
|
(common) <code><span class="keyword">interface </span><span class="identifier">CaptionedOutput</span> <span class="symbol">:</span> <a href="../-captioned/index.html"><span class="identifier">Captioned</span></a></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/Captioned.kt#L10">(source)</a>
|
||||||
|
<h3>Properties</h3>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="parse-mode.html">parseMode</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">parseMode</span><span class="symbol">: </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-parse-mode/-parse-mode/index.html"><span class="identifier">ParseMode</span></a><span class="symbol">?</span></code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<h3>Inheritors</h3>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts.results.audio/-inline-query-result-audio-common.html">InlineQueryResultAudioCommon</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">interface </span><span class="identifier">InlineQueryResultAudioCommon</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-inline-query-result/index.html"><span class="identifier">InlineQueryResult</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">CaptionedOutput</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-with-input-message-content-inline-query-result/index.html"><span class="identifier">WithInputMessageContentInlineQueryResult</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts.results.document/-inline-query-result-document-common.html">InlineQueryResultDocumentCommon</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">interface </span><span class="identifier">InlineQueryResultDocumentCommon</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-inline-query-result/index.html"><span class="identifier">InlineQueryResult</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-titled-inline-query-result/index.html"><span class="identifier">TitledInlineQueryResult</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-described-inline-query-result/index.html"><span class="identifier">DescribedInlineQueryResult</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">CaptionedOutput</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-with-input-message-content-inline-query-result/index.html"><span class="identifier">WithInputMessageContentInlineQueryResult</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts.results.gif/-inline-query-result-gif-common.html">InlineQueryResultGifCommon</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">interface </span><span class="identifier">InlineQueryResultGifCommon</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-inline-query-result/index.html"><span class="identifier">InlineQueryResult</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-optionally-titled-inline-query-result.html"><span class="identifier">OptionallyTitledInlineQueryResult</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">CaptionedOutput</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-with-input-message-content-inline-query-result/index.html"><span class="identifier">WithInputMessageContentInlineQueryResult</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts.results.mpeg4gif/-inline-query-result-mpeg4-gif-common.html">InlineQueryResultMpeg4GifCommon</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">interface </span><span class="identifier">InlineQueryResultMpeg4GifCommon</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-inline-query-result/index.html"><span class="identifier">InlineQueryResult</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-optionally-titled-inline-query-result.html"><span class="identifier">OptionallyTitledInlineQueryResult</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">CaptionedOutput</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-with-input-message-content-inline-query-result/index.html"><span class="identifier">WithInputMessageContentInlineQueryResult</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts.results.photo/-inline-query-result-photo-common.html">InlineQueryResultPhotoCommon</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">interface </span><span class="identifier">InlineQueryResultPhotoCommon</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-inline-query-result/index.html"><span class="identifier">InlineQueryResult</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-optionally-titled-inline-query-result.html"><span class="identifier">OptionallyTitledInlineQueryResult</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-described-inline-query-result/index.html"><span class="identifier">DescribedInlineQueryResult</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">CaptionedOutput</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-with-input-message-content-inline-query-result/index.html"><span class="identifier">WithInputMessageContentInlineQueryResult</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts.results.video/-inline-query-result-video-common.html">InlineQueryResultVideoCommon</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">interface </span><span class="identifier">InlineQueryResultVideoCommon</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-inline-query-result/index.html"><span class="identifier">InlineQueryResult</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-titled-inline-query-result/index.html"><span class="identifier">TitledInlineQueryResult</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-described-inline-query-result/index.html"><span class="identifier">DescribedInlineQueryResult</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">CaptionedOutput</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-with-input-message-content-inline-query-result/index.html"><span class="identifier">WithInputMessageContentInlineQueryResult</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts.results.voice/-inline-query-result-voice-common.html">InlineQueryResultVoiceCommon</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">interface </span><span class="identifier">InlineQueryResultVoiceCommon</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-inline-query-result/index.html"><span class="identifier">InlineQueryResult</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">CaptionedOutput</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-with-input-message-content-inline-query-result/index.html"><span class="identifier">WithInputMessageContentInlineQueryResult</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-titled-inline-query-result/index.html"><span class="identifier">TitledInlineQueryResult</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-input-media/-input-media-animation/index.html">InputMediaAnimation</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">InputMediaAnimation</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-input-media/-input-media/index.html"><span class="identifier">InputMedia</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-input-media/-sized-input-media/index.html"><span class="identifier">SizedInputMedia</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-input-media/-durated-input-media/index.html"><span class="identifier">DuratedInputMedia</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-input-media/-thumbed-input-media/index.html"><span class="identifier">ThumbedInputMedia</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">CaptionedOutput</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-input-media/-input-media-audio/index.html">InputMediaAudio</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">InputMediaAudio</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-input-media/-input-media/index.html"><span class="identifier">InputMedia</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-input-media/-durated-input-media/index.html"><span class="identifier">DuratedInputMedia</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-input-media/-thumbed-input-media/index.html"><span class="identifier">ThumbedInputMedia</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-input-media/-titled-input-media/index.html"><span class="identifier">TitledInputMedia</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">CaptionedOutput</span></a><span class="symbol">, </span><a href="../-performerable/index.html"><span class="identifier">Performerable</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-input-media/-input-media-document/index.html">InputMediaDocument</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">InputMediaDocument</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-input-media/-input-media/index.html"><span class="identifier">InputMedia</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-input-media/-thumbed-input-media/index.html"><span class="identifier">ThumbedInputMedia</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">CaptionedOutput</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-input-message-content/-input-text-message-content/index.html">InputTextMessageContent</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">InputTextMessageContent</span> <span class="symbol">:</span> <a href="./index.html"><span class="identifier">CaptionedOutput</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.-common-abstracts.types/-disable-web-page-preview/index.html"><span class="identifier">DisableWebPagePreview</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.abstracts/-input-message-content.html"><span class="identifier">InputMessageContent</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-input-media/-media-group-member-input-media/index.html">MediaGroupMemberInputMedia</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">interface </span><span class="identifier">MediaGroupMemberInputMedia</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-input-media/-input-media/index.html"><span class="identifier">InputMedia</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">CaptionedOutput</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.send.polls/-send-quiz-poll/index.html">SendQuizPoll</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">SendQuizPoll</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.requests.send.polls/-send-poll/index.html"><span class="identifier">SendPoll</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">CaptionedOutput</span></a><span class="symbol">, </span><a href="../-explained-output/index.html"><span class="identifier">ExplainedOutput</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>CaptionedOutput.parseMode - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts</a> / <a href="index.html">CaptionedOutput</a> / <a href="./parse-mode.html">parseMode</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>parseMode</h1>
|
||||||
|
(common) <a name="com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.CaptionedOutput$parseMode"></a>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">parseMode</span><span class="symbol">: </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-parse-mode/-parse-mode/index.html"><span class="identifier">ParseMode</span></a><span class="symbol">?</span></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/Captioned.kt#L11">(source)</a>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Captioned.caption - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts</a> / <a href="index.html">Captioned</a> / <a href="./caption.html">caption</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>caption</h1>
|
||||||
|
(common) <a name="com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.Captioned$caption"></a>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">caption</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html"><span class="identifier">String</span></a><span class="symbol">?</span></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/Captioned.kt#L7">(source)</a>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,47 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>Captioned - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts</a> / <a href="./index.html">Captioned</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>Captioned</h1>
|
||||||
|
(common) <code><span class="keyword">interface </span><span class="identifier">Captioned</span></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/Captioned.kt#L6">(source)</a>
|
||||||
|
<h3>Properties</h3>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="caption.html">caption</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">caption</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html"><span class="identifier">String</span></a><span class="symbol">?</span></code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<h3>Inheritors</h3>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../-captioned-input/index.html">CaptionedInput</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">interface </span><span class="identifier">CaptionedInput</span> <span class="symbol">:</span> <a href="./index.html"><span class="identifier">Captioned</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../-captioned-output/index.html">CaptionedOutput</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">interface </span><span class="identifier">CaptionedOutput</span> <span class="symbol">:</span> <a href="./index.html"><span class="identifier">Captioned</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>CommonContactData.firstName - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts</a> / <a href="index.html">CommonContactData</a> / <a href="./first-name.html">firstName</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>firstName</h1>
|
||||||
|
(common) <a name="com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.CommonContactData$firstName"></a>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">firstName</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html"><span class="identifier">String</span></a></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/CommonContactData.kt#L5">(source)</a>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>CommonContactData - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts</a> / <a href="./index.html">CommonContactData</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>CommonContactData</h1>
|
||||||
|
(common) <code><span class="keyword">interface </span><span class="identifier">CommonContactData</span></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/CommonContactData.kt#L3">(source)</a>
|
||||||
|
<h3>Properties</h3>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="first-name.html">firstName</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">firstName</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html"><span class="identifier">String</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="last-name.html">lastName</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">lastName</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html"><span class="identifier">String</span></a><span class="symbol">?</span></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="phone-number.html">phoneNumber</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">phoneNumber</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html"><span class="identifier">String</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="vcard.html">vcard</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">vcard</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html"><span class="identifier">String</span></a><span class="symbol">?</span></code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<h3>Inheritors</h3>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types/-contact/index.html">Contact</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">Contact</span> <span class="symbol">:</span> <a href="./index.html"><span class="identifier">CommonContactData</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result/-inline-query-result-contact/index.html">InlineQueryResultContact</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">InlineQueryResultContact</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-inline-query-result/index.html"><span class="identifier">InlineQueryResult</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">CommonContactData</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-with-input-message-content-inline-query-result/index.html"><span class="identifier">WithInputMessageContentInlineQueryResult</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-thumbed-inline-query-result/index.html"><span class="identifier">ThumbedInlineQueryResult</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-thumb-sized-inline-query-result/index.html"><span class="identifier">ThumbSizedInlineQueryResult</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-input-message-content/-input-contact-message-content/index.html">InputContactMessageContent</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">InputContactMessageContent</span> <span class="symbol">:</span> <a href="./index.html"><span class="identifier">CommonContactData</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.abstracts/-input-message-content.html"><span class="identifier">InputMessageContent</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>CommonContactData.lastName - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts</a> / <a href="index.html">CommonContactData</a> / <a href="./last-name.html">lastName</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>lastName</h1>
|
||||||
|
(common) <a name="com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.CommonContactData$lastName"></a>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">lastName</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html"><span class="identifier">String</span></a><span class="symbol">?</span></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/CommonContactData.kt#L6">(source)</a>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>CommonContactData.phoneNumber - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts</a> / <a href="index.html">CommonContactData</a> / <a href="./phone-number.html">phoneNumber</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>phoneNumber</h1>
|
||||||
|
(common) <a name="com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.CommonContactData$phoneNumber"></a>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">phoneNumber</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html"><span class="identifier">String</span></a></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/CommonContactData.kt#L4">(source)</a>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>CommonContactData.vcard - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts</a> / <a href="index.html">CommonContactData</a> / <a href="./vcard.html">vcard</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>vcard</h1>
|
||||||
|
(common) <a name="com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.CommonContactData$vcard"></a>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">vcard</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html"><span class="identifier">String</span></a><span class="symbol">?</span></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/CommonContactData.kt#L7">(source)</a>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>CommonVenueData.address - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts</a> / <a href="index.html">CommonVenueData</a> / <a href="./address.html">address</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>address</h1>
|
||||||
|
(common) <a name="com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.CommonVenueData$address"></a>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">address</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html"><span class="identifier">String</span></a></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/CommonVenueData.kt#L5">(source)</a>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>CommonVenueData.foursquareId - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts</a> / <a href="index.html">CommonVenueData</a> / <a href="./foursquare-id.html">foursquareId</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>foursquareId</h1>
|
||||||
|
(common) <a name="com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.CommonVenueData$foursquareId"></a>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">foursquareId</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html"><span class="identifier">String</span></a><span class="symbol">?</span></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/CommonVenueData.kt#L6">(source)</a>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>CommonVenueData.foursquareType - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts</a> / <a href="index.html">CommonVenueData</a> / <a href="./foursquare-type.html">foursquareType</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>foursquareType</h1>
|
||||||
|
(common) <a name="com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.CommonVenueData$foursquareType"></a>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">foursquareType</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html"><span class="identifier">String</span></a><span class="symbol">?</span></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/CommonVenueData.kt#L7">(source)</a>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,79 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>CommonVenueData - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts</a> / <a href="./index.html">CommonVenueData</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>CommonVenueData</h1>
|
||||||
|
(common) <code><span class="keyword">interface </span><span class="identifier">CommonVenueData</span> <span class="symbol">:</span> <a href="../-titled/index.html"><span class="identifier">Titled</span></a></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/CommonVenueData.kt#L3">(source)</a>
|
||||||
|
<h3>Properties</h3>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="address.html">address</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">address</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html"><span class="identifier">String</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="foursquare-id.html">foursquareId</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">foursquareId</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html"><span class="identifier">String</span></a><span class="symbol">?</span></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="foursquare-type.html">foursquareType</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">foursquareType</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html"><span class="identifier">String</span></a><span class="symbol">?</span></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="title.html">title</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">title</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html"><span class="identifier">String</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
<h3>Inheritors</h3>
|
||||||
|
<table>
|
||||||
|
<tbody>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result/-inline-query-result-venue/index.html">InlineQueryResultVenue</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">InlineQueryResultVenue</span> <span class="symbol">:</span> <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-inline-query-result/index.html"><span class="identifier">InlineQueryResult</span></a><span class="symbol">, </span><a href="../-locationed/index.html"><span class="identifier">Locationed</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">CommonVenueData</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-titled-inline-query-result/index.html"><span class="identifier">TitledInlineQueryResult</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-with-input-message-content-inline-query-result/index.html"><span class="identifier">WithInputMessageContentInlineQueryResult</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-thumbed-inline-query-result/index.html"><span class="identifier">ThumbedInlineQueryResult</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-inline-query-result.abstracts/-thumb-sized-inline-query-result/index.html"><span class="identifier">ThumbSizedInlineQueryResult</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.-input-message-content/-input-venue-message-content/index.html">InputVenueMessageContent</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">InputVenueMessageContent</span> <span class="symbol">:</span> <a href="../-locationed/index.html"><span class="identifier">Locationed</span></a><span class="symbol">, </span><a href="./index.html"><span class="identifier">CommonVenueData</span></a><span class="symbol">, </span><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-inline-queries.abstracts/-input-message-content.html"><span class="identifier">InputMessageContent</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
<tr>
|
||||||
|
<td>
|
||||||
|
(common)
|
||||||
|
<h4><a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types/-venue/index.html">Venue</a></h4>
|
||||||
|
</td>
|
||||||
|
<td>
|
||||||
|
<code><span class="keyword">data</span> <span class="keyword">class </span><span class="identifier">Venue</span> <span class="symbol">:</span> <a href="./index.html"><span class="identifier">CommonVenueData</span></a></code></td>
|
||||||
|
</tr>
|
||||||
|
</tbody>
|
||||||
|
</table>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,14 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>CommonVenueData.title - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts</a> / <a href="index.html">CommonVenueData</a> / <a href="./title.html">title</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>title</h1>
|
||||||
|
(common) <a name="com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.CommonVenueData$title"></a>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">title</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html"><span class="identifier">String</span></a></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/CommonVenueData.kt#L4">(source)</a>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
<HTML>
|
||||||
|
<HEAD>
|
||||||
|
<meta charset="UTF-8">
|
||||||
|
<title>ExplainedInput.explanationEntities - docs</title>
|
||||||
|
<link rel="stylesheet" href="../../../style.css">
|
||||||
|
</HEAD>
|
||||||
|
<BODY>
|
||||||
|
<a href="../../index.html">docs</a> / <a href="../index.html">com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts</a> / <a href="index.html">ExplainedInput</a> / <a href="./explanation-entities.html">explanationEntities</a><br/>
|
||||||
|
<br/>
|
||||||
|
<h1>explanationEntities</h1>
|
||||||
|
(common) <a name="com.github.insanusmokrassar.TelegramBotAPI.CommonAbstracts.ExplainedInput$explanationEntities"></a>
|
||||||
|
<code><span class="keyword">abstract</span> <span class="keyword">val </span><span class="identifier">explanationEntities</span><span class="symbol">: </span><a href="https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.collections/-list/index.html"><span class="identifier">List</span></a><span class="symbol"><</span><a href="../-text-part/index.html"><span class="identifier">TextPart</span></a><span class="symbol">></span></code> <a href="https://github.com/InsanusMokrassar/TelegramBotAPI/blob/master/TelegramBotAPI/src/commonMain/kotlin/com/github/insanusmokrassar/TelegramBotAPI/CommonAbstracts/Explained.kt#L19">(source)</a>
|
||||||
|
<p>Not full list of entities. This list WILL NOT contain <a href="../-text-part/index.html">TextPart</a>s with <a href="../../com.github.insanusmokrassar.-telegram-bot-a-p-i.types.-message-entity.textsources/-regular-text-source/index.html">com.github.insanusmokrassar.TelegramBotAPI.types.MessageEntity.textsources.RegularTextSource</a></p>
|
||||||
|
<p><strong>See Also</strong><br/>
|
||||||
|
<p><a href="../full-entities-list.html">ExplainedInput.fullEntitiesList</a></p>
|
||||||
|
</p>
|
||||||
|
</BODY>
|
||||||
|
</HTML>
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user