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