broadcast

package
v2.1.4-rc.2 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2022 License: Apache-2.0 Imports: 3 Imported by: 4

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Broadcast

type Broadcast struct {
	*context.Context
	// contains filtered or unexported fields
}

Broadcast 群发消息

func NewBroadcast

func NewBroadcast(ctx *context.Context) *Broadcast

NewBroadcast new

func (*Broadcast) Delete

func (broadcast *Broadcast) Delete(msgID int64, articleIDx int64) error

Delete 删除群发消息

func (*Broadcast) GetMassStatus added in v2.0.4

func (broadcast *Broadcast) GetMassStatus(msgID string) (*Result, error)

GetMassStatus 获取群发状态

func (*Broadcast) GetSpeed added in v2.0.4

func (broadcast *Broadcast) GetSpeed() (*SpeedResult, error)

GetSpeed 获取群发速度

func (*Broadcast) Preview added in v2.0.4

func (broadcast *Broadcast) Preview() *Broadcast

Preview 预览

func (*Broadcast) SendImage

func (broadcast *Broadcast) SendImage(user *User, images *Image) (*Result, error)

SendImage 发送图片

func (*Broadcast) SendNews

func (broadcast *Broadcast) SendNews(user *User, mediaID string, ignoreReprint bool) (*Result, error)

SendNews 发送图文

func (*Broadcast) SendText

func (broadcast *Broadcast) SendText(user *User, content string) (*Result, error)

SendText 群发文本 user 为nil,表示全员发送 &User{TagID:2} 根据tag发送 &User{OpenID:[]string("xxx","xxx")} 根据openid发送

func (*Broadcast) SendVideo

func (broadcast *Broadcast) SendVideo(user *User, mediaID string, title, description string) (*Result, error)

SendVideo 发送视频

func (*Broadcast) SendVoice

func (broadcast *Broadcast) SendVoice(user *User, mediaID string) (*Result, error)

SendVoice 发送语音

func (*Broadcast) SendWxCard

func (broadcast *Broadcast) SendWxCard(user *User, cardID string) (*Result, error)

SendWxCard 发送卡券

func (*Broadcast) SetSpeed added in v2.0.4

func (broadcast *Broadcast) SetSpeed(speed int) (*SpeedResult, error)

SetSpeed 设置群发速度

type Image

type Image struct {
	MediaIDs           []string `json:"media_ids"`
	Recommend          string   `json:"recommend"`
	NeedOpenComment    int32    `json:"need_open_comment"`
	OnlyFansCanComment int32    `json:"only_fans_can_comment"`
}

Image 发送图片

type MsgType

type MsgType string

MsgType 发送消息类型

const (
	// MsgTypeNews 图文消息
	MsgTypeNews MsgType = "mpnews"
	// MsgTypeText 文本
	MsgTypeText MsgType = "text"
	// MsgTypeVoice 语音/音频
	MsgTypeVoice MsgType = "voice"
	// MsgTypeImage 图片
	MsgTypeImage MsgType = "image"
	// MsgTypeVideo 视频
	MsgTypeVideo MsgType = "mpvideo"
	// MsgTypeWxCard 卡券
	MsgTypeWxCard MsgType = "wxcard"
)

type Result

type Result struct {
	util.CommonError
	MsgID     int64  `json:"msg_id"`
	MsgDataID int64  `json:"msg_data_id"`
	MsgStatus string `json:"msg_status"`
}

Result 群发返回结果

type SpeedResult added in v2.0.4

type SpeedResult struct {
	util.CommonError
	Speed     int64 `json:"speed"`
	RealSpeed int64 `json:"realspeed"`
}

SpeedResult 群发速度返回结果

type User

type User struct {
	TagID  int64
	OpenID []string
}

User 发送的用户

Jump to

Keyboard shortcuts

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