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

SendAudio::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
use unreal4u\TelegramAPI\Telegram\Types\Custom\InputFile;
9
10
/**
11
 * Use this method to send audio files, if you want Telegram clients to display them in the music player. Your audio
12
 * must be in the .mp3 format. On success, the sent Message is returned. Bots can currently send audio files of up to
13
 * 50 MB in size, this limit may be changed in the future.
14
 *
15
 * For backward compatibility, when the fields title and performer are both empty and the mime-type of the file to be
16
 * sent is not audio/mpeg, the file will be sent as a playable voice message. For this to work, the audio must be in an
17
 * .ogg file encoded with OPUS. This behavior will be phased out in the future. For sending voice messages, use the
18
 * sendVoice method instead.
19
 *
20
 * Objects defined as-is july 2016
21
 *
22
 * @see https://core.telegram.org/bots/api#sendaudio
23
 */
24
class SendAudio extends TelegramMethods
25
{
26
    /**
27
     * Unique identifier for the target chat or username of the target channel (in the format @channelusername)
28
     * @var string
29
     */
30
    public $chat_id = '';
31
32
    /**
33
     * Audio file to send. Associate an InputFile with it
34
     *
35
     * @see unreal4u\TelegramAPI\Telegram\Types\Custom\InputFile
36
     * @var InputFile
37
     */
38
    public $audio = null;
39
40
    /**
41
     * Optional. Duration of the audio in seconds
42
     * @var int
43
     */
44
    public $duration = 0;
45
46
    /**
47
     * Optional. Performer
48
     * @var string
49
     */
50
    public $performer = '';
51
52
    /**
53
     * Optional. Track name
54
     * @var string
55
     */
56
    public $title = '';
57
58
    /**
59
     * Optional. Sends the message silently. iOS users will not receive a notification, Android users will receive a
60
     * notification with no sound.
61
     * @see https://telegram.org/blog/channels-2-0#silent-messages
62
     * @var bool
63
     */
64
    public $disable_notification = false;
65
66
    /**
67
     * Optional. If the message is a reply, ID of the original message
68
     * @var int
69
     */
70
    public $reply_to_message_id = 0;
71
72
    /**
73
     * Optional. Additional interface options. A JSON-serialized object for a custom reply keyboard, instructions to
74
     * hide keyboard or to force a reply from the user
75
     * @var null
76
     */
77
    public $reply_markup = null;
78
79
    public function getMandatoryFields(): array
80
    {
81
        return [
82
            'chat_id',
83
            'audio',
84
        ];
85
    }
86
}
87