Skip to content

Commit

Permalink
升级插件版本
Browse files Browse the repository at this point in the history
  • Loading branch information
leo committed Nov 17, 2024
1 parent fdf71d3 commit a1a0453
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
4 changes: 2 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.11",
"version": "5.0.12",
"description": "智能微秘书,一个全能的微信机器人管理平台,最简单的方式接入 ChatGPT,FastGPT,Dify,Coze知识库,支持绘图,联网查询,语音识别,各种定时任务,支持企微、个微、公众号、5G 消息、WhatsApp",
"main": "index.js",
"type": "module",
Expand Down Expand Up @@ -46,7 +46,7 @@
"@juzi/wechaty": "^1.0.100",
"@juzi/wechaty-puppet": "^1.0.91",
"@juzi/wechaty-puppet-service": "^1.0.100",
"wechaty-web-panel": "^1.6.66"
"wechaty-web-panel": "^1.6.67"
},
"devDependencies": {
"pm2": "^4.2.3"
Expand Down
4 changes: 3 additions & 1 deletion src/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ import {startMatrix} from "./matrix.js";
let bot = '';
let padLocalToken = '' // 如果申请了ipadlocal的token,可以直接填入
let matrixToken = '' // 如果申请了matrix的token,可以直接填入
let matrixBridgeId = '' // 代理id
let workProToken = '' // 如果申请了企业微信的token 可以直接填入

// 公众号相关配置
Expand All @@ -25,6 +26,7 @@ if (process.env['PAD_LOCAL_TOKEN']) {
if (process.env['MATRIX_TOKEN']) {
console.log('读取到环境变量中的ipad matrix token')
matrixToken = process.env['MATRIX_TOKEN']
matrixBridgeId = process.env['MATRIX_BRIDGE_ID']
}

if (process.env['WORK_PRO_TOKEN']) {
Expand Down Expand Up @@ -52,7 +54,7 @@ if (officeAppId) {
} else if (padLocalToken) {
bot = startPadlocal(padLocalToken)
} else if (matrixToken) {
bot = startMatrix(matrixToken)
bot = startMatrix(matrixToken, matrixBridgeId)
} else if(workProToken) {
bot = startWorkpro(workProToken)
} else {
Expand Down
5 changes: 3 additions & 2 deletions src/matrix.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,15 @@ import {WechatyBuilder} from '@juzi/wechaty'
import {PuppetMatrix} from 'wechaty-puppet-matrix'


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

0 comments on commit a1a0453

Please sign in to comment.