@alemonjs/bubble 2.1.0-alpha.4 → 2.1.0-alpha.5

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.
Files changed (2) hide show
  1. package/lib/send.js +3 -3
  2. package/package.json +1 -1
package/lib/send.js CHANGED
@@ -72,12 +72,12 @@ const sendToRoom = async (client, param, val) => {
72
72
  const uploadRes = await client.uploadFile(bufferData, undefined, { channelId, threadId, messageId: messageId });
73
73
  const fileAttachment = uploadRes?.data?.file;
74
74
  if (!fileAttachment) {
75
- throw new Error('文件上传失败:未返回文件信息');
75
+ return [createResult(ResultCode.Ok, '文件上传失败:未返回文件信息', uploadRes)];
76
76
  }
77
77
  if (channelId) {
78
78
  const res = await client.sendMessage(channelId, {
79
79
  content: content,
80
- type: 'text',
80
+ type: 'image',
81
81
  attachments: [fileAttachment]
82
82
  });
83
83
  return [createResult(ResultCode.Ok, '完成', res)];
@@ -85,7 +85,7 @@ const sendToRoom = async (client, param, val) => {
85
85
  if (threadId) {
86
86
  const res = await client.sendDm(threadId, {
87
87
  content: content,
88
- type: 'text',
88
+ type: 'image',
89
89
  attachments: [fileAttachment]
90
90
  });
91
91
  return [createResult(ResultCode.Ok, '完成', res)];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alemonjs/bubble",
3
- "version": "2.1.0-alpha.4",
3
+ "version": "2.1.0-alpha.5",
4
4
  "description": "bubble platform",
5
5
  "author": "lemonade",
6
6
  "license": "MIT",