diff --git a/packages/plugin-image-search/src/index.ts b/packages/plugin-image-search/src/index.ts index 36ebda2b36..9ea2bb6240 100644 --- a/packages/plugin-image-search/src/index.ts +++ b/packages/plugin-image-search/src/index.ts @@ -1,4 +1,5 @@ import { Context, Session, Group, CommandAction } from 'koishi-core' +import { noop } from 'koishi-utils' import ascii2d from './ascii2d' import saucenao from './saucenao' @@ -45,7 +46,8 @@ export function apply(ctx: Context, config: Config = {}) { return async ({ session }) => { const urls = extractImages(session.message) if (urls.length) { - await Promise.all(urls.map(url => callback(url, session, config))) + await Promise.all(urls.map(url => callback(url, session, config).catch(noop))) + return } const dispose = session.$use(({ message }, next) => { diff --git a/packages/plugin-image-search/src/saucenao.ts b/packages/plugin-image-search/src/saucenao.ts index 51374e382c..e0672df169 100644 --- a/packages/plugin-image-search/src/saucenao.ts +++ b/packages/plugin-image-search/src/saucenao.ts @@ -171,8 +171,8 @@ export default async function saucenao(sourceUrl: string, session: Session, conf if (long_remaining < 20) { output.push(`注意:24h 内搜图次数仅剩 ${long_remaining} 次。`) - } else if (short_remaining < 5) { - output.push(`注意:30s 内搜图次数仅剩 ${short_remaining}次。`) + } else if (short_remaining < 3) { + output.push(`注意:30s 内搜图次数仅剩 ${short_remaining} 次。`) } await session.$send(output.join('\n'))