Message.php
887 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<?php
/**
* Created by PhpStorm.
* User: Hanson
* Date: 2016/12/15
* Time: 0:12
*/
namespace Hanson\Robot\Message;
use Hanson\Robot\Core\Server;
class Message
{
public $sender;
public $receiver;
public $content;
public $time;
public $type;
static $message = [];
const USER_MAP = [
0 => 'Init',
1 => 'Self',
2 => 'FileHelper',
3 => 'Group',
4 => 'Contact',
5 => 'Public',
6 => 'Special',
99 => 'UnKnown',
];
public function make($selector, $message)
{
$msg = $message['AddMsgList'][0];
if($msg['MsgType'] == 51){
$this->sender->name = 'system';
$this->sender->type = 0;
}elseif ($msg['MsgType'] == 37){
$this->sender->type = 37;
}elseif (Server::isMyself($msg['FromUserName'])){
}
}
}