Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
Toggle navigation
This project
Loading...
Sign in
hfpp2012
/
vbot
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Commit 560148d1
authored
Feb 10, 2017
by
HanSon
Committed by
GitHub
Feb 10, 2017
Browse Files
Options
Browse Files
Tag
Download
Plain Diff
Merge pull request #41 from HanSon/dev
修改PHP5兼容
2 parents
b8a1acf3
c29efe72
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
8 additions
and
6 deletions
src/Collections/ContactFactory.php
src/Message/Entity/Text.php
src/Collections/ContactFactory.php
View file @
560148d
...
...
@@ -33,6 +33,10 @@ class ContactFactory
$this
->
makeContactList
();
$contact
=
contact
()
->
get
(
myself
()
->
username
);
myself
()
->
alias
=
isset
(
$contact
[
'Alias'
])
?
$contact
[
'Alias'
]
:
myself
()
->
nickname
?
:
myself
()
->
username
;
$this
->
getBatchGroupMembers
();
if
(
server
()
->
config
[
'debug'
]){
...
...
@@ -65,10 +69,6 @@ class ContactFactory
contact
()
->
put
(
$contact
[
'UserName'
],
$contact
);
}
}
$contact
=
contact
()
->
get
(
myself
()
->
username
);
myself
()
->
alias
=
isset
(
$contact
[
'Alias'
])
?
$contact
[
'Alias'
]
:
myself
()
->
nickname
?
:
myself
()
->
username
;
}
/**
...
...
src/Message/Entity/Text.php
View file @
560148d
...
...
@@ -27,16 +27,18 @@ class Text extends Message implements MessageInterface
/**
* 发送消息
*
* @param $word string 消息内容
* @param $word string
|Text
消息内容
* @param $username string 目标username
* @return bool
*/
public
static
function
send
(
$username
,
string
$word
)
public
static
function
send
(
$username
,
$word
)
{
if
(
!
$word
)
{
return
false
;
}
$word
=
is_string
(
$word
)
?
$word
:
$word
->
content
;
$random
=
strval
(
time
()
*
1000
)
.
'0'
.
strval
(
rand
(
100
,
999
));
$data
=
[
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment