Commit 08f7c218 authored by nanahira's avatar nanahira

bump & onebot things

parent 865f5c84
...@@ -25,7 +25,7 @@ ...@@ -25,7 +25,7 @@
"eslint-config-prettier": "^8.5.0", "eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^3.4.1", "eslint-plugin-prettier": "^3.4.1",
"jest": "^28.0.3", "jest": "^28.0.3",
"koishi-plugin-pics": "^10.1.0", "koishi-plugin-pics": "^10.2.1",
"koishi-plugin-picsource-heisi": "^7.0.0", "koishi-plugin-picsource-heisi": "^7.0.0",
"koishi-plugin-picsource-lolicon": "^10.0.0", "koishi-plugin-picsource-lolicon": "^10.0.0",
"koishi-plugin-picsource-miraikoi": "^2.0.0", "koishi-plugin-picsource-miraikoi": "^2.0.0",
...@@ -42,7 +42,7 @@ ...@@ -42,7 +42,7 @@
}, },
"peerDependencies": { "peerDependencies": {
"koishi": "^4.9.1", "koishi": "^4.9.1",
"koishi-plugin-pics": "^10.1.0" "koishi-plugin-pics": "^10.2.1"
} }
}, },
"node_modules/@ampproject/remapping": { "node_modules/@ampproject/remapping": {
...@@ -5892,9 +5892,9 @@ ...@@ -5892,9 +5892,9 @@
} }
}, },
"node_modules/koishi-plugin-pics": { "node_modules/koishi-plugin-pics": {
"version": "10.1.0", "version": "10.2.1",
"resolved": "https://registry.npmjs.org/koishi-plugin-pics/-/koishi-plugin-pics-10.1.0.tgz", "resolved": "https://registry.npmjs.org/koishi-plugin-pics/-/koishi-plugin-pics-10.2.1.tgz",
"integrity": "sha512-73XS2365gbszYgU1e4f5RUMy57u5rttdZDg1y5CwNDIt05+S40yb2U+yAXPsbaVmVzJlPyvs9dJkmavl32KI6g==", "integrity": "sha512-/ssqyexXYXNcgR1N9sBalYlqk+IOHrYGMMy3bln/ImFweGj2IPGwR2dqA7fG2Ln27NXOwi+Lq4tl8hDGXmhyNg==",
"dev": true, "dev": true,
"dependencies": { "dependencies": {
"koishi-thirdeye": "^11.1.0", "koishi-thirdeye": "^11.1.0",
...@@ -12756,9 +12756,9 @@ ...@@ -12756,9 +12756,9 @@
} }
}, },
"koishi-plugin-pics": { "koishi-plugin-pics": {
"version": "10.1.0", "version": "10.2.1",
"resolved": "https://registry.npmjs.org/koishi-plugin-pics/-/koishi-plugin-pics-10.1.0.tgz", "resolved": "https://registry.npmjs.org/koishi-plugin-pics/-/koishi-plugin-pics-10.2.1.tgz",
"integrity": "sha512-73XS2365gbszYgU1e4f5RUMy57u5rttdZDg1y5CwNDIt05+S40yb2U+yAXPsbaVmVzJlPyvs9dJkmavl32KI6g==", "integrity": "sha512-/ssqyexXYXNcgR1N9sBalYlqk+IOHrYGMMy3bln/ImFweGj2IPGwR2dqA7fG2Ln27NXOwi+Lq4tl8hDGXmhyNg==",
"dev": true, "dev": true,
"requires": { "requires": {
"koishi-thirdeye": "^11.1.0", "koishi-thirdeye": "^11.1.0",
......
...@@ -52,7 +52,7 @@ ...@@ -52,7 +52,7 @@
}, },
"peerDependencies": { "peerDependencies": {
"koishi": "^4.9.1", "koishi": "^4.9.1",
"koishi-plugin-pics": "^10.1.0" "koishi-plugin-pics": "^10.2.1"
}, },
"devDependencies": { "devDependencies": {
"@koishijs/plugin-console": "^4.5.4", "@koishijs/plugin-console": "^4.5.4",
...@@ -67,7 +67,7 @@ ...@@ -67,7 +67,7 @@
"eslint-config-prettier": "^8.5.0", "eslint-config-prettier": "^8.5.0",
"eslint-plugin-prettier": "^3.4.1", "eslint-plugin-prettier": "^3.4.1",
"jest": "^28.0.3", "jest": "^28.0.3",
"koishi-plugin-pics": "^10.1.0", "koishi-plugin-pics": "^10.2.1",
"koishi-plugin-picsource-heisi": "^7.0.0", "koishi-plugin-picsource-heisi": "^7.0.0",
"koishi-plugin-picsource-lolicon": "^10.0.0", "koishi-plugin-picsource-lolicon": "^10.0.0",
"koishi-plugin-picsource-miraikoi": "^2.0.0", "koishi-plugin-picsource-miraikoi": "^2.0.0",
......
...@@ -151,36 +151,8 @@ export class EdgingProfile { ...@@ -151,36 +151,8 @@ export class EdgingProfile {
this.startTime = moment(); this.startTime = moment();
} }
private runForEachSegemnt(segments: segment[], action: (s: segment) => void) {
for (const s of segments) {
action(s);
if (s.children?.length) {
this.runForEachSegemnt(s.children, action);
}
}
}
send(content: string) { send(content: string) {
const bot = this.bot; const bot = this.bot;
if (
bot &&
(bot.platform === 'onebot' ||
(bot.platform === 'qqguild' && bot['parentBot']?.platform === 'onebot'))
) {
const segments = segment.parse(content);
this.runForEachSegemnt(segments, (s) => {
const { attrs } = s;
if (!attrs || s.type !== 'image') {
return;
}
if (attrs.url?.startsWith('base64')) {
const { url } = attrs;
attrs.file = url;
delete attrs.url;
}
});
content = segments.map((s) => s.toString()).join('');
}
return sendPriv(bot, this.getTarget(), content); return sendPriv(bot, this.getTarget(), content);
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment