Documentation ¶
Index ¶
- func ExtractLocalTempFile(path string) (string, string, error)
- func ImageRewrite(longText string, solve func(text string) string) string
- func SealCodeToCqCode(text string) string
- type AtElement
- type CQCommand
- type ElementType
- type FaceElement
- type FileElement
- type IMessageElement
- type ImageElement
- type RecordElement
- type ReplyElement
- type TTSElement
- type TextElement
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractLocalTempFile ¶
ExtractLocalTempFile 按路径提取临时文件,路径可以是 http/base64/本地路径
func SealCodeToCqCode ¶
Types ¶
type AtElement ¶
type AtElement struct {
Target string `jsbind:"target"`
}
func (*AtElement) Type ¶
func (t *AtElement) Type() ElementType
type ElementType ¶
type ElementType int
const ( Text ElementType = iota // 文本 At // 艾特 File // 文件 Image // 图片 TTS // 文字转语音 Reply // 回复 Record // 语音 Face // 表情 )
type FaceElement ¶
type FaceElement struct {
FaceID string `jsbind:"faceID"`
}
func (*FaceElement) Type ¶
func (f *FaceElement) Type() ElementType
type FileElement ¶
func FilepathToFileElement ¶
func FilepathToFileElement(fp string) (*FileElement, error)
func (*FileElement) Type ¶
func (l *FileElement) Type() ElementType
type IMessageElement ¶
type IMessageElement interface {
Type() ElementType
}
func ConvertStringMessage ¶
func ConvertStringMessage(raw string) (r []IMessageElement)
type ImageElement ¶
type ImageElement struct { File *FileElement URL string }
func (*ImageElement) Type ¶
func (l *ImageElement) Type() ElementType
type RecordElement ¶
type RecordElement struct {
File *FileElement
}
func (*RecordElement) Type ¶
func (r *RecordElement) Type() ElementType
type ReplyElement ¶
type ReplyElement struct { ReplySeq string `jsbind:"replySeq"` // 回复的目标消息ID Sender string `jsbind:"sender"` // 回复的目标消息发送者ID GroupID string `jsbind:"groupID"` // 回复群聊消息时的群号 Elements []IMessageElement `jsbind:"elements"` // 回复的消息内容 }
func (*ReplyElement) Type ¶
func (t *ReplyElement) Type() ElementType
type TTSElement ¶
type TTSElement struct {
Content string
}
func (*TTSElement) Type ¶
func (t *TTSElement) Type() ElementType
type TextElement ¶
type TextElement struct {
Content string `jsbind:"content"`
}
func (*TextElement) Type ¶
func (t *TextElement) Type() ElementType
Click to show internal directories.
Click to hide internal directories.