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 94892c7c
authored
Feb 10, 2017
by
HanSon
Browse Files
Options
Browse Files
Tag
Download
Email Patches
Plain Diff
修改PHP5兼容
1 parent
17f576d3
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
6 additions
and
4 deletions
src/Collections/ContactFactory.php
src/Message/Entity/Text.php
src/Collections/ContactFactory.php
View file @
94892c7
...
...
@@ -33,6 +33,8 @@ class ContactFactory
$this
->
makeContactList
();
myself
()
->
alias
=
contact
()
->
get
(
myself
()
->
username
)[
'Alias'
]
??
myself
()
->
nickname
?
:
myself
()
->
username
;
$this
->
getBatchGroupMembers
();
if
(
server
()
->
config
[
'debug'
]){
...
...
@@ -65,8 +67,6 @@ class ContactFactory
contact
()
->
put
(
$contact
[
'UserName'
],
$contact
);
}
}
myself
()
->
alias
=
contact
()
->
get
(
myself
()
->
username
)[
'Alias'
]
??
myself
()
->
nickname
?
:
myself
()
->
username
;
}
/**
...
...
src/Message/Entity/Text.php
View file @
94892c7
...
...
@@ -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