Completed
Push — master ( a4a0d7...5dd6ba )
by Camilo
07:16
created

SendChatAction::getMandatoryFields()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
dl 0
loc 7
c 0
b 0
f 0
rs 9.4285
cc 1
eloc 4
nc 1
nop 0
1
<?php
2
3
declare(strict_types = 1);
4
5
namespace unreal4u\TelegramAPI\Telegram\Methods;
6
7
use unreal4u\TelegramAPI\Abstracts\TelegramMethods;
8
9
/**
10
 * Use this method when you need to tell the user that something is happening on the bot's side. The status is set for 5
11
 * seconds or less (when a message arrives from your bot, Telegram clients clear its typing status).
12
 *
13
 * Example: The ImageBot needs some time to process a request and upload the image. Instead of sending a text message
14
 * along the lines of “Retrieving image, please wait…”, the bot may use sendChatAction with action = upload_photo.
15
 * The user will see a “sending photo” status for the bot.
16
 * We only recommend using this method when a response from the bot will take a noticeable amount of time to arrive.
17
 *
18
 * Objects defined as-is july 2016
19
 *
20
 * @see https://core.telegram.org/bots/api#sendchataction
21
 */
22
class SendChatAction extends TelegramMethods
23
{
24
    /**
25
     * Unique identifier for the target chat or username of the target channel (in the format @channelusername)
26
     * @var string
27
     */
28
    public $chat_id = '';
29
30
    /**
31
     * Type of action to broadcast. Choose one, depending on what the user is about to receive: typing for text
32
     * messages, upload_photo for photos, record_video or upload_video for videos, record_audio or upload_audio for
33
     * audio files, upload_document for general files, find_location for location data.
34
     * @var string
35
     */
36
    public $action = '';
37
38
    public function getMandatoryFields(): array
39
    {
40
        return [
41
            'chat_id',
42
            'action',
43
        ];
44
    }
45
}
46