@alemonjs/qq-bot 2.1.24 → 2.1.26
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/register.js +8 -9
- package/package.json +1 -1
package/lib/register.js
CHANGED
|
@@ -180,17 +180,16 @@ const register = (client) => {
|
|
|
180
180
|
});
|
|
181
181
|
const getMessageContent = event => {
|
|
182
182
|
let msg = event?.content ?? '';
|
|
183
|
-
|
|
184
|
-
if (event.mentions) {
|
|
183
|
+
if (event?.mentions) {
|
|
185
184
|
for (const item of event.mentions) {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
185
|
+
if (item?.id) {
|
|
186
|
+
msg = msg.replace(`<@!${item.id}>`, '').trim();
|
|
187
|
+
msg = msg.replace(`<@${item.id}>`, '').trim();
|
|
188
|
+
}
|
|
189
|
+
if (item?.username) {
|
|
190
|
+
msg = msg.replace(`[${item.username}]`, '').trim();
|
|
191
|
+
}
|
|
189
192
|
}
|
|
190
|
-
atUsers.forEach(item => {
|
|
191
|
-
msg = msg.replace(`<@!${item.id}>`, '').trim();
|
|
192
|
-
msg = msg.replace(`<@${item.id}>`, '').trim();
|
|
193
|
-
});
|
|
194
193
|
}
|
|
195
194
|
return msg;
|
|
196
195
|
};
|