@alemonjs/discord 2.1.3 → 2.1.4

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.
package/lib/format.js CHANGED
@@ -62,8 +62,7 @@ const markdownToDiscordText = (items, hideUnsupported) => {
62
62
  return String(item?.value ?? '');
63
63
  }
64
64
  })
65
- .join('')
66
- .trim();
65
+ .join('');
67
66
  };
68
67
  const markdownRawToDiscordText = (raw, hideUnsupported) => {
69
68
  if (Number(hideUnsupported) >= 4)
package/lib/send.js CHANGED
@@ -143,7 +143,7 @@ const sendchannel = async (client, param, val) => {
143
143
  })
144
144
  .join('');
145
145
  const contentMd = buildDiscordMdContent(mds);
146
- const finalContent = [content, contentMd, fallbackText].filter(Boolean).join('\n');
146
+ const finalContent = [content, contentMd, fallbackText].filter(Boolean).join('\n').replace(/^[^\S\n\r]+|[^\S\n\r]+$/g, '');
147
147
  if (hide && !finalContent && images.length <= 0 && buttons.length <= 0) {
148
148
  logger.info('[discord] hideUnsupported: 消息内容转换后为空,跳过发送');
149
149
  return [];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@alemonjs/discord",
3
- "version": "2.1.3",
3
+ "version": "2.1.4",
4
4
  "description": "discord platform connection",
5
5
  "author": "lemonade",
6
6
  "license": "MIT",