message

package
v0.0.0-...-41a911c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 12, 2021 License: AGPL-3.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func JsonEscape

func JsonEscape(s string) string

json转义

Types

type CQ

type CQ interface {
	At() string
	Face() string
	NewImage() string
	Record() string
	Video() string
	Rps() string
	Dice() string
	Shake() string
	Share() string
	Contact() string
	Location() string
	Music() string
	Reply() string
	Xml() string
	Json() string
	Poke() string
	Gift() string
	CardImage() string
	Tts() string
}

type Message

type Message struct {
	Message string `json:"message"`

	Id int `json:"id"`

	Magic int `json:"magic"` //发送语音时可选,表示是否变声

	QQ int `json:"qq"`

	Fle     string `json:"fle"`      //文件路径或下载链接
	Type    string `json:"type"`     //图片是否为闪照 闪照为flash,秀图为show  发送音乐时 qq表示qq音乐,163表示网易云音乐,custom表示自定义分享
	Url     string `json:"url"`      //网络url
	Cache   int    `json:"cache"`    //只在通过网络 URL 发送时有效,表示是否使用已缓存的文件,默认 1
	Proxy   int    `json:"proxy"`    //只在通过网络 URL 发送时有效,表示是否通过代理下载文件(需通过环境变量或配置文件配置代理),默认 1
	TimeOut int    `json:"time_out"` //只在通过网络 URL 发送时有效,单位秒,表示下载网络文件的超时时间,默认不超时
	C       int    `json:"c"`        //下载时使用的线程数

	Audio string `json:"audio"` //分享音乐时音乐Url

	Lat float32 `json:"lat"` //纬度
	Lon float32 `json:"lon"` //经度

	Text string `json:"text"` //回复的消息
	Time int64  `json:"time"` //自定义回复消息时的时间戳

	Cover string `json:"cover"` //发送短视频时的封面消息

	Resid int `json:"resid"` //0为走小程序通道,其他为富文本通道

	Title   string `json:"title"`   //标题
	Content string `json:"content"` //内容
	Image   string `json:"image"`   //图片链接,可选
}

详情参考:

https://github.com/howmanybots/onebot/blob/master/v11/specs/message/segment.md#qq-%E8%A1%A8%E6%83%85
https://github.com/Mrs4s/go-cqhttp/blob/master/docs/cqhttp.md#%E5%9B%BE%E7%89%87

func (Message) At

func (m Message) At() string

func (Message) CardImage

func (m Message) CardImage() string

func (Message) Contact

func (m Message) Contact() string

func (Message) Dice

func (m Message) Dice() string

func (Message) Face

func (m Message) Face() string

func (Message) Gift

func (m Message) Gift() string

func (Message) Json

func (m Message) Json() string

func (Message) Location

func (m Message) Location() string

func (Message) Music

func (m Message) Music() string

func (Message) NewImage

func (m Message) NewImage() string

func (Message) Poke

func (m Message) Poke() string

func (Message) Record

func (m Message) Record() string

func (Message) Reply

func (m Message) Reply() string

func (Message) Rps

func (m Message) Rps() string

func (Message) Shake

func (m Message) Shake() string

func (Message) Share

func (m Message) Share() string

func (Message) Tts

func (m Message) Tts() string

func (Message) Video

func (m Message) Video() string

func (Message) Xml

func (m Message) Xml() string

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL