Completed
Push — master ( 69097b...4e1c03 )
by Danilo
04:33
created

TestBot::processMessage()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 7
Code Lines 4

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 5
CRAP Score 1

Importance

Changes 0
Metric Value
dl 0
loc 7
ccs 5
cts 5
cp 1
rs 9.4285
c 0
b 0
f 0
cc 1
eloc 4
nc 1
nop 1
crap 1
1
<?php
2
3
/*
4
 * This file is part of the PhpBotFramework.
5
 *
6
 * PhpBotFramework is free software: you can redistribute it and/or modify
7
 * it under the terms of the GNU Lesser General Public License as
8
 * published by the Free Software Foundation, version 3.
9
 *
10
 * PhpBotFramework is distributed in the hope that it will be useful, but
11
 * WITHOUT ANY WARRANTY; without even the implied warranty of
12
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
 * Lesser General Public License for more details.
14
 *
15
 * You should have received a copy of the GNU Lesser General Public License
16
 * along with this program. If not, see <http://www.gnu.org/licenses/>.
17
 */
18
19
namespace PhpBotFramework\Test;
20
21
use PhpBotFramework\Bot;
22
23
use PhpBotFramework\Entities\Message;
24
25
class TestBot extends Bot
26
{
27
    use FakeUpdate;
28
29
    public $message_id = 0;
30
31
    /*
32
     * \brief Process a message sending it to the user specified internally.
33
     * @param Message $message The message to send to the user.
34
     */
35 2
    public function processMessage(Message $message)
36
    {
37 2
        $this->setChatID(getenv("CHAT_ID"));
38 2
        $this->sendMessage("Message from <b>{$message['from']['first_name']}</b> saying: <i>{$message['text']}</i>");
39
40 2
        $this->message_id = $message['message_id'];
41 2
    }
42
43 3
    public function initCommandsWrap()
44
    {
45 3
        $this->initCommands();
46 3
    }
47
}
48