koishijs / koishi-plugin-booru

Image service for Koishi | 最好的涩图插件!
https://booru.koishi.chat
MIT License
12 stars 8 forks source link

Feature: 增加图片微量修改,以免发不出造成retcode100 #21

Closed medicago087 closed 10 months ago

medicago087 commented 1 year ago

Sources

Danbooru, Gelbooru, Konachan.com (NSFW), Konachan.net (SFW), Lolibooru, Lolicon, Pixiv, Safebooru, Yande.re

Describe the problem related to the feature request

nsfw或擦边图片极其容易被tx吞,若增加像素点微量修改则可以有效避免。

Describe the solution you'd like

image image

Describe alternatives you've considered

No response

Additional context

No response

fatinghenji commented 1 year ago

The same requirement, especially in the group chat call booru will give error code 100

MaikoTan commented 10 months ago

As Koishi no longer officially support onebot or red, we are not going to support this platform-specific feature, but it can still be implemented by other plugins:

ctx.before('send', (_, options) => {
  if (options?.session?.argv?.command?.name === 'booru') {
    session.elements = h.traverse(session.content, {
      image(val) {
        return change(val) // do some changes for the image
      },
    })
  }
})