1
0
mirror of https://github.com/InsanusMokrassar/TelegramBotAPI.git synced 2024-11-25 19:48:43 +00:00

bot actions shortcut

This commit is contained in:
InsanusMokrassar 2021-01-02 15:51:26 +06:00
parent fa0861b8bc
commit ba4b4c4b64
2 changed files with 22 additions and 0 deletions

View File

@ -7,6 +7,8 @@
* `MicroUtils`: `0.4.11` -> `0.4.15`
* `Klock`: `2.0.1` -> `2.0.2`
* `Ktor`: `1.4.3` -> `1.5.0`
* `Core`:
* All bot actions got functions for short calling, like `recordVideo` for `RecordVideoNote`
## 0.30.10

View File

@ -42,6 +42,8 @@ internal object BotActionSerializer: KSerializer<BotAction> {
object TypingAction : BotAction() {
override val actionName: String = "typing"
}
inline val typing
get() = TypingAction
/**
* Will notify user that bot is uploading some photo
@ -50,6 +52,8 @@ object TypingAction : BotAction() {
object UploadPhotoAction : BotAction() {
override val actionName: String = "upload_photo"
}
inline val uploadPhoto
get() = UploadPhotoAction
/**
* Will notify user that bot is recording some video
@ -58,6 +62,8 @@ object UploadPhotoAction : BotAction() {
object RecordVideoAction : BotAction() {
override val actionName: String = "record_video"
}
inline val recordVideo
get() = RecordVideoAction
/**
* Will notify user that bot is uploading some photo
@ -66,6 +72,8 @@ object RecordVideoAction : BotAction() {
object UploadVideoAction : BotAction() {
override val actionName: String = "upload_video"
}
inline val uploadVideo
get() = UploadVideoAction
/**
* Will notify user that bot is recording some audio
@ -74,6 +82,8 @@ object UploadVideoAction : BotAction() {
object RecordAudioAction : BotAction() {
override val actionName: String = "record_audio"
}
inline val recordAudio
get() = RecordAudioAction
/**
* Will notify user that bot is uploading some audio
@ -82,6 +92,8 @@ object RecordAudioAction : BotAction() {
object UploadAudioAction : BotAction() {
override val actionName: String = "upload_audio"
}
inline val uploadAudio
get() = UploadAudioAction
/**
* Will notify user that bot is uploading some document
@ -90,6 +102,8 @@ object UploadAudioAction : BotAction() {
object UploadDocumentAction : BotAction() {
override val actionName: String = "upload_document"
}
inline val uploadDocument
get() = UploadDocumentAction
/**
* Will notify user that bot is trying to find location
@ -98,6 +112,8 @@ object UploadDocumentAction : BotAction() {
object FindLocationAction : BotAction() {
override val actionName: String = "find_location"
}
inline val findLocation
get() = FindLocationAction
/**
* Will notify user that bot is recording video note
@ -106,6 +122,8 @@ object FindLocationAction : BotAction() {
object RecordVideoNoteAction : BotAction() {
override val actionName: String = "record_video_note"
}
inline val recordVideoNote
get() = RecordVideoNoteAction
/**
* Will notify user that bot is uploading video note
@ -114,3 +132,5 @@ object RecordVideoNoteAction : BotAction() {
object UploadVideoNoteAction : BotAction() {
override val actionName: String = "upload_video_note"
}
inline val uploadVideoNote
get() = UploadVideoNoteAction