koishijs / koishi

Cross-platform chatbot framework made with love
https://koishi.chat
MIT License
4.54k stars 249 forks source link

RFC: Support `spoiler` Attribute in `<img>` Tag #1258

Open Lipraty opened 1 year ago

Lipraty commented 1 year ago

Abstract

This RFC proposes the addition of a spoiler attribute to the <img> tag. This attribute will allow images to be marked as spoilers on platforms that support this feature.

Support platfrom

The status of this feature on Kook is currently uncertain due to discrepancies between the platform’s documentation and its actual API.

The above platforms all support <spl> tag, but this is only for text.

Introduction

The spoiler attribute is intended to enhance user experience by allowing sensitive content to be hidden until the user chooses to view it. This is particularly useful in chat applications where users may wish to discuss sensitive topics without spoiling the experience for others. (e.g. R-18 picture and more)

Proposal

We propose the add attribute to the tag:

<img spoiler="true" url=""></img>

In this example, the spoiler attribute is set to true, indicating that the image should be treated as a spoiler. If the spoiler attribute is not present, or if its value is false, the image should not be treated as a spoiler.

Compatibility

This feature is compatible with platforms that support spoiler tags for images, on platforms that do not support spoiler tags for images, the spoiler attribute should be ignored, and the image should be displayed as normal.

or in qq platfrom can send of forward message.

Implementation

Telegrame

See API Documentation

Add has_spoiler in the request body

Discord

Add SPOILER_ to the start of the image name

Kook

don't know