Skip to content

Commit

Permalink
更新插件,新增协议
Browse files Browse the repository at this point in the history
  • Loading branch information
leo committed Oct 13, 2024
1 parent 22ca82c commit fc28fb9
Show file tree
Hide file tree
Showing 4 changed files with 33 additions and 2 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,10 @@
## 更新日志

## V5.0.10(2024-10-13)
1、更新插件版本
2、新增puppet协议
3、支持api获取好友和群列表

## V5.0.6(2024-08-29)
1、修复对话问题

Expand Down
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "wechat-assistant",
"version": "5.0.9",
"version": "5.0.10",
"description": "智能微秘书,一个全能的微信机器人管理平台,最简单的方式接入 ChatGPT,FastGPT,Dify,Coze知识库,支持绘图,联网查询,语音识别,各种定时任务,支持企微、个微、公众号、5G 消息、WhatsApp",
"main": "index.js",
"type": "module",
Expand Down Expand Up @@ -42,10 +42,11 @@
"wechaty-puppet-official-account": "^1.10.12",
"wechaty-puppet-padlocal": "^1.20.1",
"wechaty-puppet-wechat4u": "^1.14.12",
"wechaty-puppet-matrix": "^0.0.8",
"@juzi/wechaty": "^1.0.100",
"@juzi/wechaty-puppet": "^1.0.91",
"@juzi/wechaty-puppet-service": "^1.0.100",
"wechaty-web-panel": "^1.6.64"
"wechaty-web-panel": "^1.6.65"
},
"devDependencies": {
"pm2": "^4.2.3"
Expand Down
9 changes: 9 additions & 0 deletions src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ import {startWorkpro} from "./workpro.js";
import {startPadlocal} from "./padlocal.js";
import {startWechat4u} from "./wechat4u.js";
import {startOffice} from "./office.js";
import {startMatrix} from "./matrix.js";

let bot = '';
let padLocalToken = '' // 如果申请了ipadlocal的token,可以直接填入
let matrixToken = '' // 如果申请了matrix的token,可以直接填入
let workProToken = '' // 如果申请了企业微信的token 可以直接填入

// 公众号相关配置
Expand All @@ -20,6 +22,11 @@ if (process.env['PAD_LOCAL_TOKEN']) {
padLocalToken = process.env['PAD_LOCAL_TOKEN']
}

if (process.env['MATRIX_TOKEN']) {
console.log('读取到环境变量中的ipad matrix token')
matrixToken = process.env['MATRIX_TOKEN']
}

if (process.env['WORK_PRO_TOKEN']) {
console.log('读取到环境变量中的企微token')
workProToken = process.env['WORK_PRO_TOKEN']
Expand All @@ -44,6 +51,8 @@ if (officeAppId) {
})
} else if (padLocalToken) {
bot = startPadlocal(padLocalToken)
} else if (matrixToken) {
bot = startMatrix(matrixToken)
} else if(workProToken) {
bot = startWorkpro(workProToken)
} else {
Expand Down
16 changes: 16 additions & 0 deletions src/matrix.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
import {WechatyBuilder} from '@juzi/wechaty'
import {PuppetMatrix} from 'wechaty-puppet-matrix'


export function startMatrix(matrixToken) {
const name = 'wechat-assistant-matrix-pad';
let bot = '';
console.log('读取到环境变量中的matrix ipad token 使用ipad协议启动')
bot = WechatyBuilder.build({
name,
puppet: new PuppetMatrix({
token: matrixToken
}),
});
return bot
}

0 comments on commit fc28fb9

Please sign in to comment.