mirror of
https://github.com/InsanusMokrassar/TelegramBotAPI.git
synced 2024-11-26 03:58:44 +00:00
bot actions got class-cast shortcuts
This commit is contained in:
parent
ba4b4c4b64
commit
9df9af193c
@ -9,6 +9,7 @@
|
|||||||
* `Ktor`: `1.4.3` -> `1.5.0`
|
* `Ktor`: `1.4.3` -> `1.5.0`
|
||||||
* `Core`:
|
* `Core`:
|
||||||
* All bot actions got functions for short calling, like `recordVideo` for `RecordVideoNote`
|
* All bot actions got functions for short calling, like `recordVideo` for `RecordVideoNote`
|
||||||
|
* All bot actions got class-cast shortcuts
|
||||||
|
|
||||||
## 0.30.10
|
## 0.30.10
|
||||||
|
|
||||||
|
@ -44,6 +44,7 @@ object TypingAction : BotAction() {
|
|||||||
}
|
}
|
||||||
inline val typing
|
inline val typing
|
||||||
get() = TypingAction
|
get() = TypingAction
|
||||||
|
inline fun BotAction.asTyping() = this as? TypingAction
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will notify user that bot is uploading some photo
|
* Will notify user that bot is uploading some photo
|
||||||
@ -54,6 +55,7 @@ object UploadPhotoAction : BotAction() {
|
|||||||
}
|
}
|
||||||
inline val uploadPhoto
|
inline val uploadPhoto
|
||||||
get() = UploadPhotoAction
|
get() = UploadPhotoAction
|
||||||
|
inline fun BotAction.asUploadPhoto() = this as? UploadPhotoAction
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will notify user that bot is recording some video
|
* Will notify user that bot is recording some video
|
||||||
@ -64,6 +66,7 @@ object RecordVideoAction : BotAction() {
|
|||||||
}
|
}
|
||||||
inline val recordVideo
|
inline val recordVideo
|
||||||
get() = RecordVideoAction
|
get() = RecordVideoAction
|
||||||
|
inline fun BotAction.asRecordVideo() = this as? RecordVideoAction
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will notify user that bot is uploading some photo
|
* Will notify user that bot is uploading some photo
|
||||||
@ -74,6 +77,7 @@ object UploadVideoAction : BotAction() {
|
|||||||
}
|
}
|
||||||
inline val uploadVideo
|
inline val uploadVideo
|
||||||
get() = UploadVideoAction
|
get() = UploadVideoAction
|
||||||
|
inline fun BotAction.asUploadVideo() = this as? UploadVideoAction
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will notify user that bot is recording some audio
|
* Will notify user that bot is recording some audio
|
||||||
@ -84,6 +88,7 @@ object RecordAudioAction : BotAction() {
|
|||||||
}
|
}
|
||||||
inline val recordAudio
|
inline val recordAudio
|
||||||
get() = RecordAudioAction
|
get() = RecordAudioAction
|
||||||
|
inline fun BotAction.asRecordAudio() = this as? RecordAudioAction
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will notify user that bot is uploading some audio
|
* Will notify user that bot is uploading some audio
|
||||||
@ -94,6 +99,7 @@ object UploadAudioAction : BotAction() {
|
|||||||
}
|
}
|
||||||
inline val uploadAudio
|
inline val uploadAudio
|
||||||
get() = UploadAudioAction
|
get() = UploadAudioAction
|
||||||
|
inline fun BotAction.asUploadAudio() = this as? UploadAudioAction
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will notify user that bot is uploading some document
|
* Will notify user that bot is uploading some document
|
||||||
@ -104,6 +110,7 @@ object UploadDocumentAction : BotAction() {
|
|||||||
}
|
}
|
||||||
inline val uploadDocument
|
inline val uploadDocument
|
||||||
get() = UploadDocumentAction
|
get() = UploadDocumentAction
|
||||||
|
inline fun BotAction.asUploadDocument() = this as? UploadDocumentAction
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will notify user that bot is trying to find location
|
* Will notify user that bot is trying to find location
|
||||||
@ -114,6 +121,7 @@ object FindLocationAction : BotAction() {
|
|||||||
}
|
}
|
||||||
inline val findLocation
|
inline val findLocation
|
||||||
get() = FindLocationAction
|
get() = FindLocationAction
|
||||||
|
inline fun BotAction.asFindLocation() = this as? FindLocationAction
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will notify user that bot is recording video note
|
* Will notify user that bot is recording video note
|
||||||
@ -124,6 +132,7 @@ object RecordVideoNoteAction : BotAction() {
|
|||||||
}
|
}
|
||||||
inline val recordVideoNote
|
inline val recordVideoNote
|
||||||
get() = RecordVideoNoteAction
|
get() = RecordVideoNoteAction
|
||||||
|
inline fun BotAction.asRecordVideoNote() = this as? RecordVideoNoteAction
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Will notify user that bot is uploading video note
|
* Will notify user that bot is uploading video note
|
||||||
@ -134,3 +143,4 @@ object UploadVideoNoteAction : BotAction() {
|
|||||||
}
|
}
|
||||||
inline val uploadVideoNote
|
inline val uploadVideoNote
|
||||||
get() = UploadVideoNoteAction
|
get() = UploadVideoNoteAction
|
||||||
|
inline fun BotAction.asUploadVideoNote() = this as? UploadVideoNoteAction
|
||||||
|
Loading…
Reference in New Issue
Block a user