wechaty-web-panel 1.6.102 → 1.6.103

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,6 +27,7 @@ async function onRecordMessage(msg) {
27
27
  const timestamp = msg.timestamp || (0, dayjs_1.default)().unix();
28
28
  const robotInfo = this.currentUser;
29
29
  const isOfficial = contact.type() === this.Contact.Type.Official;
30
+ const userWeixin = contact.weixin() || '';
30
31
  if (isOfficial)
31
32
  return;
32
33
  console.log('msg', msg);
@@ -37,6 +38,7 @@ async function onRecordMessage(msg) {
37
38
  chatName: contactName,
38
39
  chatId: contact.id,
39
40
  chatAlias: contactAlias,
41
+ chatUserWeixin: userWeixin,
40
42
  isMyself: !!msgSelf,
41
43
  time: timestamp.length > 10 ? parseInt(timestamp / 1000) : timestamp
42
44
  };
@@ -6,7 +6,7 @@ const dotenv_1 = require("dotenv");
6
6
  (0, dotenv_1.config)();
7
7
  // 数据库配置
8
8
  const dbConfig = {
9
- host: process.env.DB_HOST || 'localhost',
9
+ host: process.env.DB_HOST || '0.0.0.0',
10
10
  port: parseInt(process.env.DB_PORT) || 5432,
11
11
  database: process.env.DB_NAME || 'chat_mcp',
12
12
  username: process.env.DB_USER || 'postgres',
@@ -6,7 +6,7 @@ exports.packageJson = void 0;
6
6
  */
7
7
  exports.packageJson = {
8
8
  "name": "wechaty-web-panel",
9
- "version": "1.6.102",
9
+ "version": "1.6.103",
10
10
  "exports": {
11
11
  ".": {
12
12
  "import": "./dist/esm/src/index.js",
@@ -1,4 +1,4 @@
1
- export const AIBOTK: "https://api-bot.aibotk.com/open/v1/api";
1
+ export const AIBOTK: "http://127.0.0.1:7002/open/v1/api";
2
2
  export const AIBOTK_OUTAPI: "https://outapi.aibotk.com/open/api/v1";
3
3
  export const TULING: "http://openapi.tuling123.com/openapi/api/v2";
4
4
  export const TXHOST: "http://api.tianapi.com";
@@ -1,7 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.EMOHOST = exports.TXSJHOST = exports.TXHOST = exports.TULING = exports.AIBOTK_OUTAPI = exports.AIBOTK = void 0;
4
- exports.AIBOTK = 'https://api-bot.aibotk.com/open/v1/api';
4
+ // export const AIBOTK = 'https://api-bot.aibotk.com/open/v1/api'
5
+ exports.AIBOTK = 'http://127.0.0.1:7002/open/v1/api';
5
6
  exports.AIBOTK_OUTAPI = 'https://outapi.aibotk.com/open/api/v1';
6
7
  exports.TULING = 'http://openapi.tuling123.com/openapi/api/v2';
7
8
  exports.TXHOST = 'http://api.tianapi.com';
@@ -164,7 +164,7 @@ async function initMqtt(that) {
164
164
  if (topic === `aibotk/${userId}/say`) {
165
165
  if (content.target === 'Room' || content.target === 'room') {
166
166
  console.log(`收到群:${content.roomName}发送消息请求: ${content.message.content || content.message.url}`);
167
- const room = content.wxid && await that.Room.find({ id: content.wxid }) || await that.Room.find({ topic: content.roomName });
167
+ const room = content.wxid && await that.Room.find({ id: content.wxid }) || content.roomName && await that.Room.find({ topic: content.roomName });
168
168
  if (!room) {
169
169
  console.log(`查找不到群:${content.roomName},请检查群名是否正确`);
170
170
  return;
@@ -22,6 +22,7 @@ async function onRecordMessage(msg) {
22
22
  const timestamp = msg.timestamp || dayjs().unix();
23
23
  const robotInfo = this.currentUser;
24
24
  const isOfficial = contact.type() === this.Contact.Type.Official;
25
+ const userWeixin = contact.weixin() || '';
25
26
  if (isOfficial)
26
27
  return;
27
28
  console.log('msg', msg);
@@ -32,6 +33,7 @@ async function onRecordMessage(msg) {
32
33
  chatName: contactName,
33
34
  chatId: contact.id,
34
35
  chatAlias: contactAlias,
36
+ chatUserWeixin: userWeixin,
35
37
  isMyself: !!msgSelf,
36
38
  time: timestamp.length > 10 ? parseInt(timestamp / 1000) : timestamp
37
39
  };
@@ -3,7 +3,7 @@ import { config } from 'dotenv';
3
3
  config();
4
4
  // 数据库配置
5
5
  const dbConfig = {
6
- host: process.env.DB_HOST || 'localhost',
6
+ host: process.env.DB_HOST || '0.0.0.0',
7
7
  port: parseInt(process.env.DB_PORT) || 5432,
8
8
  database: process.env.DB_NAME || 'chat_mcp',
9
9
  username: process.env.DB_USER || 'postgres',
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const packageJson = {
5
5
  "name": "wechaty-web-panel",
6
- "version": "1.6.102",
6
+ "version": "1.6.103",
7
7
  "exports": {
8
8
  ".": {
9
9
  "import": "./dist/esm/src/index.js",
@@ -1,4 +1,4 @@
1
- export const AIBOTK: "https://api-bot.aibotk.com/open/v1/api";
1
+ export const AIBOTK: "http://127.0.0.1:7002/open/v1/api";
2
2
  export const AIBOTK_OUTAPI: "https://outapi.aibotk.com/open/api/v1";
3
3
  export const TULING: "http://openapi.tuling123.com/openapi/api/v2";
4
4
  export const TXHOST: "http://api.tianapi.com";
@@ -1,4 +1,5 @@
1
- export const AIBOTK = 'https://api-bot.aibotk.com/open/v1/api';
1
+ // export const AIBOTK = 'https://api-bot.aibotk.com/open/v1/api'
2
+ export const AIBOTK = 'http://127.0.0.1:7002/open/v1/api';
2
3
  export const AIBOTK_OUTAPI = 'https://outapi.aibotk.com/open/api/v1';
3
4
  export const TULING = 'http://openapi.tuling123.com/openapi/api/v2';
4
5
  export const TXHOST = 'http://api.tianapi.com';
@@ -124,7 +124,7 @@ async function initMqtt(that) {
124
124
  if (topic === `aibotk/${userId}/say`) {
125
125
  if (content.target === 'Room' || content.target === 'room') {
126
126
  console.log(`收到群:${content.roomName}发送消息请求: ${content.message.content || content.message.url}`);
127
- const room = content.wxid && await that.Room.find({ id: content.wxid }) || await that.Room.find({ topic: content.roomName });
127
+ const room = content.wxid && await that.Room.find({ id: content.wxid }) || content.roomName && await that.Room.find({ topic: content.roomName });
128
128
  if (!room) {
129
129
  console.log(`查找不到群:${content.roomName},请检查群名是否正确`);
130
130
  return;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "wechaty-web-panel",
3
- "version": "1.6.102",
3
+ "version": "1.6.103",
4
4
  "exports": {
5
5
  ".": {
6
6
  "import": "./dist/esm/src/index.js",
@@ -23,6 +23,7 @@ async function onRecordMessage(msg) {
23
23
  const timestamp = msg.timestamp || dayjs().unix();
24
24
  const robotInfo = this.currentUser
25
25
  const isOfficial = contact.type() === this.Contact.Type.Official
26
+ const userWeixin = contact.weixin() || ''
26
27
  if (isOfficial) return
27
28
  console.log('msg', msg)
28
29
  const baseMsg = {
@@ -32,6 +33,7 @@ async function onRecordMessage(msg) {
32
33
  chatName: contactName,
33
34
  chatId: contact.id,
34
35
  chatAlias: contactAlias,
36
+ chatUserWeixin: userWeixin,
35
37
  isMyself: !!msgSelf,
36
38
  time: timestamp.length > 10 ? parseInt(timestamp / 1000) : timestamp
37
39
  }
@@ -5,7 +5,7 @@ config();
5
5
 
6
6
  // 数据库配置
7
7
  const dbConfig = {
8
- host: process.env.DB_HOST || 'localhost',
8
+ host: process.env.DB_HOST || '0.0.0.0',
9
9
  port: parseInt(process.env.DB_PORT) || 5432,
10
10
  database: process.env.DB_NAME || 'chat_mcp',
11
11
  username: process.env.DB_USER || 'postgres',
@@ -3,7 +3,7 @@
3
3
  */
4
4
  export const packageJson = {
5
5
  "name": "wechaty-web-panel",
6
- "version": "1.6.102",
6
+ "version": "1.6.103",
7
7
  "exports": {
8
8
  ".": {
9
9
  "import": "./dist/esm/src/index.js",
@@ -1,4 +1,5 @@
1
- export const AIBOTK = 'https://api-bot.aibotk.com/open/v1/api'
1
+ // export const AIBOTK = 'https://api-bot.aibotk.com/open/v1/api'
2
+ export const AIBOTK = 'http://127.0.0.1:7002/open/v1/api'
2
3
 
3
4
  export const AIBOTK_OUTAPI = 'https://outapi.aibotk.com/open/api/v1'
4
5
  export const TULING = 'http://openapi.tuling123.com/openapi/api/v2'
package/src/proxy/mqtt.js CHANGED
@@ -130,7 +130,7 @@ async function initMqtt(that) {
130
130
  if (topic === `aibotk/${userId}/say`) {
131
131
  if (content.target === 'Room' || content.target === 'room') {
132
132
  console.log(`收到群:${content.roomName}发送消息请求: ${content.message.content || content.message.url}`)
133
- const room = content.wxid && await that.Room.find({ id: content.wxid }) || await that.Room.find({ topic: content.roomName })
133
+ const room = content.wxid && await that.Room.find({ id: content.wxid }) || content.roomName && await that.Room.find({ topic: content.roomName })
134
134
  if (!room) {
135
135
  console.log(`查找不到群:${content.roomName},请检查群名是否正确`)
136
136
  return