Skip to content

#858 add chat action constants #859

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 4 commits into from
Jul 14, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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,
]);
```

Expand Down
64 changes: 64 additions & 0 deletions src/ChatAction.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<?php
/**
* This file is part of the TelegramBot package.
*
* (c) Avtandil Kikabidze aka LONGMAN <[email protected]>
*
* 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';
}