@alemonjs/onebot 2.1.0-alpha.5 → 2.1.0-alpha.6
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/index.js +10 -7
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -100,6 +100,13 @@ var index = () => {
|
|
|
100
100
|
* @returns
|
|
101
101
|
*/
|
|
102
102
|
const DataToMessage = async (val = []) => {
|
|
103
|
+
// 空元素
|
|
104
|
+
const empty = {
|
|
105
|
+
type: 'text',
|
|
106
|
+
data: {
|
|
107
|
+
text: ''
|
|
108
|
+
}
|
|
109
|
+
};
|
|
103
110
|
const message = await Promise.all(val.map(async (item) => {
|
|
104
111
|
if (item.type == 'Text') {
|
|
105
112
|
return {
|
|
@@ -124,16 +131,11 @@ var index = () => {
|
|
|
124
131
|
return {
|
|
125
132
|
type: 'at',
|
|
126
133
|
data: {
|
|
127
|
-
qq: item.value
|
|
134
|
+
qq: item.value
|
|
128
135
|
}
|
|
129
136
|
};
|
|
130
137
|
}
|
|
131
|
-
return
|
|
132
|
-
type: 'text',
|
|
133
|
-
data: {
|
|
134
|
-
text: ''
|
|
135
|
-
}
|
|
136
|
-
};
|
|
138
|
+
return empty;
|
|
137
139
|
}
|
|
138
140
|
else if (item.type == 'Image') {
|
|
139
141
|
return {
|
|
@@ -161,6 +163,7 @@ var index = () => {
|
|
|
161
163
|
}
|
|
162
164
|
};
|
|
163
165
|
}
|
|
166
|
+
return empty;
|
|
164
167
|
}));
|
|
165
168
|
return message;
|
|
166
169
|
};
|