Test Failed
Push — draft ( f72ceb...541bbe )
by Nikolay
02:22
created

DeleteMessageMethod   A

Complexity

Total Complexity 1

Size/Duplication

Total Lines 15
Duplicated Lines 0 %

Importance

Changes 0
Metric Value
wmc 1
eloc 5
dl 0
loc 15
rs 10
c 0
b 0
f 0

1 Method

Rating   Name   Duplication   Size   Complexity  
A __construct() 0 4 1
1
<?php
2
3
declare(strict_types=1);
4
5
namespace Greenplugin\TelegramBot\Method;
6
7
use Greenplugin\TelegramBot\Method\Traits\ChatIdVariableTrait;
8
use Greenplugin\TelegramBot\Method\Traits\MessageIdVariableTrait;
9
10
/**
11
 * Class DeleteMessageMethod.
12
 *
13
 * Use this method to delete a message, including service messages, with the following limitations:
14
 * - A message can only be deleted if it was sent less than 48 hours ago.
15
 * - Bots can delete outgoing messages in private chats, groups, and supergroups.
16
 * - Bots granted can_post_messages permissions can delete outgoing messages in channels.
17
 * - If the bot is an administrator of a group, it can delete any message there.
18
 * - If the bot has can_delete_messages permission in a supergroup or a channel, it can delete any message there.
19
 * Returns True on success.
20
 *
21
 * @see https://core.telegram.org/bots/api#deletemessage
22
 */
23
class DeleteMessageMethod
24
{
25
    use ChatIdVariableTrait;
26
    use MessageIdVariableTrait;
27
28
    /**
29
     * DeleteMessageMethod constructor.
30
     *
31
     * @param int|string $chatId
32
     * @param int        $messageId
33
     */
34
    public function __construct($chatId, int $messageId)
35
    {
36
        $this->chatId = $chatId;
37
        $this->messageId = $messageId;
38
    }
39
}
40