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

SendChatAction   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 24
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 24
c 0
b 0
f 0
rs 10

1 Method

Rating   Name   Duplication   Size   Complexity  
A getMandatoryFields() 0 7 1
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