diff --git a/README.md b/README.md index 044a9868..54c5ac2c 100644 --- a/README.md +++ b/README.md @@ -54,8 +54,8 @@ npm install ```.env # 维格表配置 -VIKA_SPACE_NAME="" # 维格表空间名称,注意是名称而不是ID -VIKA_TOKEN="" #维格表token +VIKA_SPACE_ID="替换为自己的维格表空间ID" +VIKA_TOKEN="替换为自己的维格表token" # 基础配置 ADMINROOM_ADMINROOMTOPIC="瓦力是群主" # 管理群名称,需尽量保持名称复杂,避免重名群干扰 diff --git a/package.json b/package.json index 02a67249..5531363f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "@atorber/chatflow", - "version": "2.0.56", + "version": "2.0.57", "description": "ChatFlow-聊天机器人管理平台", "type": "module", "exports": { diff --git a/src/api/message.ts b/src/api/message.ts index db2d9b4b..f0037e80 100644 --- a/src/api/message.ts +++ b/src/api/message.ts @@ -362,7 +362,7 @@ export const formatMessageToMQTT = async (message: Message) => { delete roomJson.payload.memberIdList } const messageType = types.Message[message.type()] - let text = '' + let text = message.text() switch (message.type()) { case types.Message.Image:{ const file = message.toImage() @@ -389,7 +389,7 @@ export const formatMessageToMQTT = async (message: Message) => { break } log.info('formatMessageToMQTT text:', text) - const timestamp = message.payload?.timestamp ? (message.payload.timestamp * 1000) : new Date().getTime() + const timestamp = message.payload?.timestamp ? message.payload.timestamp : new Date().getTime() const messageNew = { _id: message.id, data: message, diff --git a/src/api/talk.ts b/src/api/talk.ts index 3e5efd67..8d77885c 100644 --- a/src/api/talk.ts +++ b/src/api/talk.ts @@ -140,7 +140,7 @@ export const createTalk = (_params: { draft_text: '', msg_text: '', index_name: '', - created_at: 11111, + created_at: new Date().getTime(), } return data } @@ -222,14 +222,7 @@ export const getTalkRecord = async (param: { const dispayname = alias || name const talk_type = roomid !== '--' ? 2 : 1 let msg_type = 1 - let extra = { - height: 6480, - name: '', - size: 0, - suffix: '', - url: 'https://im.gzydong.com/public/media/image/common/20231026/814423dea6ada99994ae87bb0fef545b_4480x6480.png', - width: 4480, - } + let extra = {} const receiver_id = roomid !== '--' ? roomid : listenerid if (file) { const file0 = file[0]