diff --git a/CHANGELOG.md b/CHANGELOG.md index 3846e0aef..de63e10d4 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Exclamation symbols (:exclamation:) note something of importance e.g. breaking c ## [Unreleased] ### Added +- `ChatAction` class to simplify chat action selection. ### Changed - [:exclamation:][unreleased-bc-rename-constants] Rename and ensure no redefinition of constants: `BASE_PATH` -> `TB_BASE_PATH`, `BASE_COMMANDS_PATH` -> `TB_BASE_COMMANDS_PATH`. ### Deprecated diff --git a/README.md b/README.md index 04c6d9864..7b943d3e5 100644 --- a/README.md +++ b/README.md @@ -371,7 +371,7 @@ See the [*ImageCommand.php*][ImageCommand.php] for a full example. ```php Request::sendChatAction([ 'chat_id' => $chat_id, - 'action' => 'typing', + 'action' => Longman\TelegramBot\ChatAction::TYPING, ]); ``` diff --git a/src/ChatAction.php b/src/ChatAction.php new file mode 100644 index 000000000..608523bd0 --- /dev/null +++ b/src/ChatAction.php @@ -0,0 +1,64 @@ + + * + * For the full copyright and license information, please view the LICENSE + * file that was distributed with this source code. + */ + +namespace Longman\TelegramBot; + +class ChatAction +{ + /** + * Typing chat action + */ + const TYPING = 'typing'; + + /** + * Upload Photo chat action + */ + const UPLOAD_PHOTO = 'upload_photo'; + + /** + * Record Video chat action + */ + const RECORD_VIDEO = 'record_video'; + + /** + * Upload Video chat action + */ + const UPLOAD_VIDEO = 'upload_video'; + + /** + * Record Audio chat action + */ + const RECORD_AUDIO = 'record_audio'; + + /** + * Upload Audio chat action + */ + const UPLOAD_AUDIO = 'upload_audio'; + + /** + * Upload Document chat action + */ + const UPLOAD_DOCUMENT = 'upload_document'; + + /** + * Find Location chat action + */ + const FIND_LOCATION = 'find_location'; + + /** + * Record Video Note chat action + */ + const RECORD_VIDEO_NOTE = 'record_video_note'; + + /** + * Upload Video note chat action + */ + const UPLOAD_VIDEO_NOTE = 'upload_video_note'; +}