Completed
Pull Request — master (#53)
by Rick
02:25
created

SendSticker   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 46
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 1

Test Coverage

Coverage 100%

Importance

Changes 0
Metric Value
wmc 1
lcom 0
cbo 1
dl 0
loc 46
ccs 2
cts 2
cp 1
rs 10
c 0
b 0
f 0

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\KeyboardMethods;
8
use unreal4u\TelegramAPI\Abstracts\TelegramMethods;
9
use unreal4u\TelegramAPI\Telegram\Types\Custom\InputFile;
10
11
/**
12
 * Use this method to send .webp stickers. On success, the sent Message is returned.
13
 *
14
 * Objects defined as-is july 2016
15
 *
16
 * @see https://core.telegram.org/bots/api#sendsticker
17
 */
18
class SendSticker extends TelegramMethods
19
{
20
    /**
21
     * Unique identifier for the target chat or username of the target channel (in the format @channelusername)
22
     * @var string
23
     */
24
    public $chat_id = '';
25
26
    /**
27
     * Sticker to send. Pass a file_id as String to send a file that exists on the Telegram servers (recommended), pass
28
     * an HTTP URL as a String for Telegram to get a .webp file from the Internet, or upload a new one using the
29
     * InputFile class
30
     * @see InputFile
31
     * @var string|InputFile
32
     */
33
    public $sticker = '';
34
35
    /**
36
     * Optional. Sends the message silently. iOS users will not receive a notification, Android users will receive a
37
     * notification with no sound.
38
     * @see https://telegram.org/blog/channels-2-0#silent-messages
39
     * @var bool
40
     */
41
    public $disable_notification = false;
42
43
    /**
44
     * Optional. If the message is a reply, ID of the original message
45
     * @var int
46
     */
47
    public $reply_to_message_id = 0;
48
49
    /**
50
     * Optional. Additional interface options. A JSON-serialized object for a custom reply keyboard, instructions to
51
     * hide keyboard or to force a reply from the user
52
     * @var KeyboardMethods
53
     */
54
    public $reply_markup;
55
56 1
    public function getMandatoryFields(): array
57
    {
58
        return [
59 1
            'chat_id',
60
            'sticker',
61
        ];
62
    }
63
}
64