Commit 194d4caf authored by nanahira's avatar nanahira

bump pics and use better autopic strag

parent d5e23cd6
...@@ -4,7 +4,7 @@ import Lolicon from 'koishi-plugin-picsource-lolicon'; ...@@ -4,7 +4,7 @@ import Lolicon from 'koishi-plugin-picsource-lolicon';
export default class ExtrasInDev { export default class ExtrasInDev {
constructor(ctx: Context) { constructor(ctx: Context) {
ctx.plugin(Pics); ctx.plugin(Pics, { useBase64: true });
ctx.plugin(Lolicon, { isDefault: true }); ctx.plugin(Lolicon, { isDefault: true });
} }
} }
...@@ -10,6 +10,7 @@ const app = new App({ ...@@ -10,6 +10,7 @@ const app = new App({
port: 14514, port: 14514,
host: 'localhost', host: 'localhost',
prefix: '.', prefix: '.',
}); });
// Console and sandbox // Console and sandbox
...@@ -30,6 +31,7 @@ app.plugin(TargetPlugin, { ...@@ -30,6 +31,7 @@ app.plugin(TargetPlugin, {
instances: [ instances: [
{ {
cron: '*/5 * * * * *', cron: '*/5 * * * * *',
immediate: true,
tags: ['sakura'], tags: ['sakura'],
targets: [ targets: [
{ {
......
...@@ -40,7 +40,7 @@ ...@@ -40,7 +40,7 @@
}, },
"peerDependencies": { "peerDependencies": {
"koishi": "^4.5.0", "koishi": "^4.5.0",
"koishi-plugin-pics": "^8.7.3" "koishi-plugin-pics": "^8.7.5"
} }
}, },
"node_modules/@ampproject/remapping": { "node_modules/@ampproject/remapping": {
...@@ -5291,9 +5291,9 @@ ...@@ -5291,9 +5291,9 @@
} }
}, },
"node_modules/koishi-plugin-pics": { "node_modules/koishi-plugin-pics": {
"version": "8.7.3", "version": "8.7.5",
"resolved": "https://registry.npmjs.org/koishi-plugin-pics/-/koishi-plugin-pics-8.7.3.tgz", "resolved": "https://registry.npmjs.org/koishi-plugin-pics/-/koishi-plugin-pics-8.7.5.tgz",
"integrity": "sha512-fPKxDe3uqucVco+FtAEc7mbsevY/hmBfyy31Z+4ygur7v3u6PHy+FlqqFamLFplU6v/EBAvwL+1U0p5GKwfy/A==", "integrity": "sha512-69tm7HfGaYzRRkZX9QpfOfH85QJgSQ/M77NyX7Rwpm9WGwU9DF7/I98IRbhFVxtqb1v+9YW70tII5gt6tMpWpA==",
"peer": true, "peer": true,
"dependencies": { "dependencies": {
"koishi-thirdeye": "^9.2.18", "koishi-thirdeye": "^9.2.18",
...@@ -11851,9 +11851,9 @@ ...@@ -11851,9 +11851,9 @@
} }
}, },
"koishi-plugin-pics": { "koishi-plugin-pics": {
"version": "8.7.3", "version": "8.7.5",
"resolved": "https://registry.npmjs.org/koishi-plugin-pics/-/koishi-plugin-pics-8.7.3.tgz", "resolved": "https://registry.npmjs.org/koishi-plugin-pics/-/koishi-plugin-pics-8.7.5.tgz",
"integrity": "sha512-fPKxDe3uqucVco+FtAEc7mbsevY/hmBfyy31Z+4ygur7v3u6PHy+FlqqFamLFplU6v/EBAvwL+1U0p5GKwfy/A==", "integrity": "sha512-69tm7HfGaYzRRkZX9QpfOfH85QJgSQ/M77NyX7Rwpm9WGwU9DF7/I98IRbhFVxtqb1v+9YW70tII5gt6tMpWpA==",
"peer": true, "peer": true,
"requires": { "requires": {
"koishi-thirdeye": "^9.2.18", "koishi-thirdeye": "^9.2.18",
......
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
}, },
"peerDependencies": { "peerDependencies": {
"koishi": "^4.5.0", "koishi": "^4.5.0",
"koishi-plugin-pics": "^8.7.3" "koishi-plugin-pics": "^8.7.5"
}, },
"devDependencies": { "devDependencies": {
"@koishijs/plugin-cache-lru": "^1.0.0-rc.0", "@koishijs/plugin-cache-lru": "^1.0.0-rc.0",
......
...@@ -36,13 +36,17 @@ export default class AutoPicPlugin ...@@ -36,13 +36,17 @@ export default class AutoPicPlugin
); );
return; return;
} }
const message = segment('image', { url: pic.url, cache: true }); const message = await this.pics.getSegment(pic.url);
await Promise.all( await Promise.all(
instance.targets.map(async (target) => { instance.targets.map(async (target) => {
try { try {
this.logger.info(`Sending image ${pic.url} from ${target.bot}.`); this.logger.debug(`Sending image ${pic.url} from ${target.bot}.`);
const ids = await target.send(this.bots, message); let targetMessage = message;
this.logger.info( if (this.pics.isOneBotBot(this.bots.get(target.bot))) {
targetMessage = message.replace(/,url=/, ',file=');
}
const ids = await target.send(this.bots, targetMessage);
this.logger.debug(
`Image ${pic.url} sent from ${target.bot}: ${ids?.join(',')}`, `Image ${pic.url} sent from ${target.bot}: ${ids?.join(',')}`,
); );
} catch (e) { } catch (e) {
......
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