schemas

package
v0.4.12 Latest Latest
Warning

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

Go to latest
Published: Apr 1, 2024 License: Apache-2.0 Imports: 5 Imported by: 39

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func PbEventType2GeneratePayloadFunc

func PbEventType2GeneratePayloadFunc() map[pbwechaty.EventType]func() interface{}

PbEventType2GeneratePayloadFunc grpc event map wechaty-puppet event payload

func PbEventType2PuppetEventName

func PbEventType2PuppetEventName() map[pbwechaty.EventType]PuppetEventName

PbEventType2PuppetEventName grpc event map wechaty-puppet event name

Types

type BaseEventPayload

type BaseEventPayload struct {
	Data string
}

type ContactGender

type ContactGender uint8
const (
	ContactGenderUnknown ContactGender = 0
	ContactGenderMale    ContactGender = 1
	ContactGenderFemale  ContactGender = 2
)

func (ContactGender) String

func (i ContactGender) String() string

type ContactPayload

type ContactPayload struct {
	Id        string
	Gender    ContactGender
	Type      ContactType
	Name      string
	Avatar    string
	Address   string
	Alias     string
	City      string
	Friend    bool
	Province  string
	Signature string
	Star      bool
	WeiXin    string
}

type ContactPayloadFilterFunction

type ContactPayloadFilterFunction func(payload *ContactPayload) bool

type ContactQueryFilter

type ContactQueryFilter struct {
	// 别名过滤
	Alias string
	// 别名正则表达式过滤
	AliasRegexp *regexp.Regexp
	// id 过滤
	Id string
	// 昵称过滤
	Name string
	// 昵称正则表达式过滤
	NameRegexp *regexp.Regexp
	WeiXin     string
}

ContactQueryFilter use the first non-empty parameter of all parameters to search

type ContactType

type ContactType uint8
const (
	ContactTypeUnknown  ContactType = 0
	ContactTypePersonal ContactType = 1
	ContactTypeOfficial ContactType = 2
)

func (ContactType) String

func (i ContactType) String() string

type EmitStruct

type EmitStruct struct {
	EventName PuppetEventName
	Payload   interface{}
}

EmitStruct receive puppet emit event

type EventDirtyPayload added in v0.3.1

type EventDirtyPayload struct {
	PayloadType PayloadType
	PayloadId   string
}

type EventDongPayload

type EventDongPayload = BaseEventPayload

type EventErrorPayload

type EventErrorPayload = BaseEventPayload

type EventFriendshipPayload

type EventFriendshipPayload struct {
	FriendshipID string
}

type EventHeartbeatPayload

type EventHeartbeatPayload = BaseEventPayload

type EventLoginPayload

type EventLoginPayload struct {
	ContactId string
}

type EventLogoutPayload

type EventLogoutPayload struct {
	ContactId string
	Data      string
}

type EventMessagePayload

type EventMessagePayload struct {
	MessageId string
}

type EventParams

type EventParams struct {
	EventName PuppetEventName
	Params    []interface{}
}

EventParams wechaty emit params

type EventReadyPayload

type EventReadyPayload = BaseEventPayload

type EventResetPayload

type EventResetPayload = BaseEventPayload

type EventRoomInvitePayload

type EventRoomInvitePayload struct {
	RoomInvitationId string
}

type EventRoomJoinPayload

type EventRoomJoinPayload struct {
	InviteeIdList []string
	InviterId     string
	RoomId        string
	Timestamp     int64
}

type EventRoomLeavePayload

type EventRoomLeavePayload struct {
	RemoveeIdList []string
	RemoverId     string
	RoomId        string
	Timestamp     int64
}

type EventRoomTopicPayload

type EventRoomTopicPayload struct {
	ChangerId string
	NewTopic  string
	OldTopic  string
	RoomId    string
	Timestamp int64
}

type EventScanPayload

type EventScanPayload struct {
	BaseEventPayload
	Status ScanStatus
	QrCode string
}

type FriendshipPayload

type FriendshipPayload struct {
	FriendshipPayloadReceive
}

type FriendshipPayloadBase

type FriendshipPayloadBase struct {
	Id        string `json:"id"`
	ContactId string `json:"contactId"`
	Hello     string `json:"hello"`
	Timestamp int64  `json:"timestamp"`
}

type FriendshipPayloadConfirm

type FriendshipPayloadConfirm struct {
	FriendshipPayloadBase
	Type FriendshipType // FriendshipTypeConfirm
}

type FriendshipPayloadReceive

type FriendshipPayloadReceive struct {
	FriendshipPayloadBase
	Type     FriendshipType      `json:"type"` // FriendshipTypeReceive
	Scene    FriendshipSceneType `json:"scene"`
	Stranger string              `json:"stranger"`
	Ticket   string              `json:"ticket"`
}

type FriendshipPayloadVerify

type FriendshipPayloadVerify struct {
	FriendshipPayloadBase
	Type FriendshipType // FriendshipTypeVerify
}

type FriendshipSceneType

type FriendshipSceneType uint8
const (
	FriendshipSceneTypeUnknown  FriendshipSceneType = 0
	FriendshipSceneTypeQQ       FriendshipSceneType = 1
	FriendshipSceneTypeEmail    FriendshipSceneType = 2
	FriendshipSceneTypeWeiXin   FriendshipSceneType = 3
	FriendshipSceneTypeQQTBD    FriendshipSceneType = 12 // QQ号搜索
	FriendshipSceneTypeRoom     FriendshipSceneType = 14
	FriendshipSceneTypePhone    FriendshipSceneType = 15
	FriendshipSceneTypeCard     FriendshipSceneType = 17 // 名片分享
	FriendshipSceneTypeLocation FriendshipSceneType = 18
	FriendshipSceneTypeBottle   FriendshipSceneType = 25
	FriendshipSceneTypeShaking  FriendshipSceneType = 29
	FriendshipSceneTypeQRCode   FriendshipSceneType = 30
)

type FriendshipSearchCondition

type FriendshipSearchCondition struct {
	Phone  string
	WeiXin string
}

FriendshipSearchCondition use the first non-empty parameter of all parameters to search

type FriendshipType

type FriendshipType uint8
const (
	FriendshipTypeUnknown FriendshipType = 0
	FriendshipTypeConfirm FriendshipType = 1
	FriendshipTypeReceive FriendshipType = 2
	FriendshipTypeVerify  FriendshipType = 3
)

func (FriendshipType) String

func (i FriendshipType) String() string

type ImageType

type ImageType uint8
const (
	ImageTypeUnknown ImageType = iota
	ImageTypeThumbnail
	ImageTypeHD
	ImageTypeArtwork
)

func (ImageType) String

func (i ImageType) String() string

type LocationPayload added in v0.4.12

type LocationPayload struct {
	Accuracy  float32 `json:"accuracy"`  // Estimated horizontal accuracy of this location, radial, in meters. (same as Android & iOS API)
	Address   string  `json:"address"`   // 北京市北京市海淀区45 Chengfu Rd
	Latitude  float64 `json:"latitude"`  // 39.995120999999997
	Longitude float64 `json:"longitude"` // 116.3341
	Name      string  `json:"name"`      // 东升乡人民政府(海淀区成府路45号)
}

type MessagePayload

type MessagePayload struct {
	MessagePayloadBase
	MessagePayloadRoom
}

type MessagePayloadBase

type MessagePayloadBase struct {
	Id string

	// use message id to get rawPayload to get those informations when needed
	// contactId     string        // Contact ShareCard
	MentionIdList []string // Mentioned Contacts' Ids

	FileName  string
	Text      string
	Timestamp time.Time
	Type      MessageType

	// 小程序有些消息类型,wechaty服务端解析不处理,框架端解析。 xml type 36 是小程序
	FixMiniApp bool
}

type MessagePayloadFilterFunction

type MessagePayloadFilterFunction func(payload *MessagePayload) bool

type MessagePayloadRoom

type MessagePayloadRoom struct {
	TalkerId   string
	RoomId     string
	ListenerId string
}

type MessagePayloadTo

type MessagePayloadTo = MessagePayloadRoom

type MessageQueryFilter

type MessageQueryFilter struct {
	TalkerId string
	// Deprecated: please use TalkerId
	FromId     string
	Id         string
	RoomId     string
	Text       string
	TextRegExp *regexp.Regexp
	// Deprecated: please use ListenerId
	ToId       string
	ListenerId string
	Type       MessageType
}

type MessageType

type MessageType uint8
const (
	MessageTypeUnknown     MessageType = 0
	MessageTypeAttachment  MessageType = 1
	MessageTypeAudio       MessageType = 2
	MessageTypeContact     MessageType = 3
	MessageTypeChatHistory MessageType = 4
	MessageTypeEmoticon    MessageType = 5
	MessageTypeImage       MessageType = 6
	MessageTypeText        MessageType = 7
	MessageTypeLocation    MessageType = 8
	MessageTypeMiniProgram MessageType = 9
	MessageTypeGroupNote   MessageType = 10
	MessageTypeTransfer    MessageType = 11
	MessageTypeRedEnvelope MessageType = 12
	MessageTypeRecalled    MessageType = 13
	MessageTypeURL         MessageType = 14
	MessageTypeVideo       MessageType = 15
)

func (MessageType) String

func (i MessageType) String() string

type MiniProgramPayload

type MiniProgramPayload struct {
	Appid       string `json:"appid"`       // optional, Appid, get from wechat (mp.weixin.qq.com)
	Description string `json:"description"` // optional, mini program title
	PagePath    string `json:"pagePath"`    // optional, mini program page path
	ThumbUrl    string `json:"thumbUrl"`    // optional, default picture, convert to thumbnail
	Title       string `json:"title"`       // optional, mini program title
	Username    string `json:"username"`    // original ID, get from wechat (mp.weixin.qq.com)
	ThumbKey    string `json:"thumbKey"`    // original, thumbnailurl and thumbkey will make the headphoto of mini-program better
	ShareId     string `json:"shareId"`     // optional, the unique userId for who share this mini program
	IconUrl     string `json:"iconUrl"`     // optional, mini program icon url
}

func (*MiniProgramPayload) ToJson

func (m *MiniProgramPayload) ToJson() string

type PayloadType added in v0.2.1

type PayloadType int32

PayloadType ...

const (
	// PayloadTypeUnknown unknown
	PayloadTypeUnknown PayloadType = iota
	PayloadTypeMessage
	PayloadTypeContact
	PayloadTypeRoom
	PayloadTypeRoomMember
	PayloadTypeFriendship
)

func (PayloadType) String added in v0.3.1

func (i PayloadType) String() string

type PuppetEventName

type PuppetEventName uint8
const (
	PuppetEventNameUnknown PuppetEventName = iota
	PuppetEventNameFriendship
	PuppetEventNameLogin
	PuppetEventNameLogout
	PuppetEventNameMessage
	PuppetEventNameRoomInvite
	PuppetEventNameRoomJoin
	PuppetEventNameRoomLeave
	PuppetEventNameRoomTopic
	PuppetEventNameScan

	PuppetEventNameDong
	PuppetEventNameError
	PuppetEventNameHeartbeat
	PuppetEventNameReady
	PuppetEventNameReset
	PuppetEventNameDirty

	PuppetEventNameStop
	PuppetEventNameStart
)

func GetEventNames

func GetEventNames() []PuppetEventName

func (PuppetEventName) String

func (i PuppetEventName) String() string

type RoomInvitationPayload

type RoomInvitationPayload struct {
	Id           string    `json:"id"`
	InviterId    string    `json:"inviterId"`
	Topic        string    `json:"topic"`
	Avatar       string    `json:"avatar"`
	Invitation   string    `json:"invitation"`
	MemberCount  int       `json:"memberCount"`
	MemberIdList []string  `json:"memberIdList"`
	Timestamp    time.Time `json:"timestamp"`
	ReceiverId   string    `json:"receiverId"`
}

type RoomMemberPayload

type RoomMemberPayload struct {
	Id        string
	RoomAlias string
	InviterId string
	Avatar    string
	Name      string
}

type RoomMemberQueryFilter

type RoomMemberQueryFilter struct {
	Name         string
	RoomAlias    string
	ContactAlias string
}

type RoomPayload

type RoomPayload struct {
	Id           string
	Topic        string
	Avatar       string
	MemberIdList []string
	OwnerId      string
	AdminIdList  []string
}

type RoomPayloadFilterFunction

type RoomPayloadFilterFunction func(payload *RoomPayload) bool

type RoomQueryFilter

type RoomQueryFilter struct {
	// 使用 room id 过滤
	Id string
	// 使用群名称过滤
	Topic string
	// 群名称正则过滤
	TopicRegexp *regexp.Regexp
}

func (*RoomQueryFilter) All

func (r *RoomQueryFilter) All() bool

func (*RoomQueryFilter) Empty

func (r *RoomQueryFilter) Empty() bool

type ScanStatus

type ScanStatus uint8
const (
	ScanStatusUnknown   ScanStatus = 0
	ScanStatusCancel    ScanStatus = 1
	ScanStatusWaiting   ScanStatus = 2
	ScanStatusScanned   ScanStatus = 3
	ScanStatusConfirmed ScanStatus = 4
	ScanStatusTimeout   ScanStatus = 5
)

func (ScanStatus) String

func (i ScanStatus) String() string

type UrlLinkPayload

type UrlLinkPayload struct {
	Description  string `json:"description"`
	ThumbnailUrl string `json:"thumbnailUrl"`
	Title        string `json:"title"`
	Url          string `json:"url"`
}

func (*UrlLinkPayload) ToJson

func (u *UrlLinkPayload) ToJson() string

type WeChatAppMessageType

type WeChatAppMessageType int
const (
	WeChatAppMessageTypeText                  WeChatAppMessageType = 1
	WeChatAppMessageTypeImg                   WeChatAppMessageType = 2
	WeChatAppMessageTypeAudio                 WeChatAppMessageType = 3
	WeChatAppMessageTypeVideo                 WeChatAppMessageType = 4
	WeChatAppMessageTypeUrl                   WeChatAppMessageType = 5
	WeChatAppMessageTypeAttach                WeChatAppMessageType = 6
	WeChatAppMessageTypeOpen                  WeChatAppMessageType = 7
	WeChatAppMessageTypeEmoji                 WeChatAppMessageType = 8
	WeChatAppMessageTypeVoiceRemind           WeChatAppMessageType = 9
	WeChatAppMessageTypeScanGood              WeChatAppMessageType = 10
	WeChatAppMessageTypeGood                  WeChatAppMessageType = 13
	WeChatAppMessageTypeEmotion               WeChatAppMessageType = 15
	WeChatAppMessageTypeCardTicket            WeChatAppMessageType = 16
	WeChatAppMessageTypeRealtimeShareLocation WeChatAppMessageType = 17
	WeChatAppMessageTypeChatHistory           WeChatAppMessageType = 19
	WeChatAppMessageTypeMiniProgram           WeChatAppMessageType = 33
	WeChatAppMessageTypeTransfers             WeChatAppMessageType = 2000
	WeChatAppMessageTypeRedEnvelopes          WeChatAppMessageType = 2001
	WeChatAppMessageTypeReaderType            WeChatAppMessageType = 100001
)

type WeChatMessageType

type WeChatMessageType int
const (
	WeChatMessageTypeText              WeChatMessageType = 1
	WeChatMessageTypeImage             WeChatMessageType = 3
	WeChatMessageTypeVoice             WeChatMessageType = 34
	WeChatMessageTypeVerifyMsg         WeChatMessageType = 37
	WeChatMessageTypePossibleFriendMsg WeChatMessageType = 40
	WeChatMessageTypeShareCard         WeChatMessageType = 42
	WeChatMessageTypeVideo             WeChatMessageType = 43
	WeChatMessageTypeEmoticon          WeChatMessageType = 47
	WeChatMessageTypeLocation          WeChatMessageType = 48
	WeChatMessageTypeApp               WeChatMessageType = 49
	WeChatMessageTypeVOIPMsg           WeChatMessageType = 50
	WeChatMessageTypeStatusNotify      WeChatMessageType = 51
	WeChatMessageTypeVOIPNotify        WeChatMessageType = 52
	WeChatMessageTypeVOIPInvite        WeChatMessageType = 53
	WeChatMessageTypeMicroVideo        WeChatMessageType = 62
	WeChatMessageTypeTransfer          WeChatMessageType = 2000 // 转账
	WeChatMessageTypeRedEnvelope       WeChatMessageType = 2001 // 红包
	WeChatMessageTypeMiniProgram       WeChatMessageType = 2002 // 小程序
	WeChatMessageTypeGroupInvite       WeChatMessageType = 2003 // 群邀请
	WeChatMessageTypeFile              WeChatMessageType = 2004 // 文件消息
	WeChatMessageTypeSysNotice         WeChatMessageType = 9999
	WeChatMessageTypeSys               WeChatMessageType = 10000
	WeChatMessageTypeRecalled          WeChatMessageType = 10002
)

Jump to

Keyboard shortcuts

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