Skip to content
This repository has been archived by the owner on Aug 15, 2021. It is now read-only.

Commit

Permalink
POST事件上报
Browse files Browse the repository at this point in the history
  • Loading branch information
slight-sky committed Jul 25, 2017
1 parent d391538 commit cbd9246
Show file tree
Hide file tree
Showing 6 changed files with 135 additions and 118 deletions.
110 changes: 41 additions & 69 deletions .idea/workspace.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

16 changes: 12 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,23 @@
# coolq-sdk-php

CoolQ机器人 基于[http插件](https://richardchien.github.io/coolq-http-api/#/)
- CoolQ机器人

基于[http插件](https://richardchien.github.io/coolq-http-api/#/)


- [CoolQ机器人后台管理](https://github.com/slight-sky/CoolQ/tree/CoolQ)

基于[coolq-sdk-php](https://github.com/slight-sky/coolq-sdk-php)

基于[http插件](https://richardchien.github.io/coolq-http-api/#/)

```
CoolQ.php sdk
CQ.php CQ码封装
MsgTool.php 对特殊消息的转译等处理操作封装
```
```
Expand All @@ -18,7 +26,7 @@ CoolQ机器人 基于[http插件](https://richardchien.github.io/coolq-http-api/
{
"require": {
"slight-sky/coolq-sdk-php": "^0.4.0"
"slight-sky/coolq-sdk-php": "^0.5.0"
}
}
Expand All @@ -41,6 +49,6 @@ CoolQ机器人 基于[http插件](https://richardchien.github.io/coolq-http-api/
#log

- 添加获取群列表

- 添加POST提交事件方式

[API参数描述](https://richardchien.github.io/coolq-http-api/#/API)
13 changes: 10 additions & 3 deletions examples/getLoginInfo.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,14 @@

require_once '../Autoloader.php';

use CoolQSDK\CoolQ;
use CoolQSDK\CoolQSDK;

$CoolQ = new CoolQ('127.0.0.1',5700,'slight');
echo $CoolQ->getLoginInfo();
$CoolQ = new CoolQSDK('127.0.0.1',5700,'slight');

//unset($message);
//$message[0]['type'] = 'text';
//$message[0]['data'] = array(
// 'text'=>'1231145646'
//);
//
//echo $CoolQ->sendGroupMsg(194233857,$message,false,true);
13 changes: 13 additions & 0 deletions src/CoolQSDK/CQ.php
Original file line number Diff line number Diff line change
Expand Up @@ -85,4 +85,17 @@ public static function enShareCode($url, $title, $content, $image)
return "[CQ:share,url=$url,title=$title,content=$content,image=$image] ";
}

public static function filterCQAt($string)
{
return preg_replace('/\[CQ:at,qq=\d+\]/','',$string);
}

public static function deCodeHtml($message)
{
$message = preg_replace("/&/", "&", $message);
$message = preg_replace("/[/", "[", $message);
$message = preg_replace("/]/", "]", $message);
return $message;
}

}
Loading

0 comments on commit cbd9246

Please sign in to comment.