Documentation
¶
Index ¶
- Constants
- func PbEventType2GeneratePayloadFunc() map[pbwechaty.EventType]func() interface{}
- func PbEventType2PuppetEventName() map[pbwechaty.EventType]PuppetEventName
- type BaseEventPayload
- type ContactGender
- type ContactPayload
- type ContactPayloadFilterFunction
- type ContactQueryFilter
- type ContactType
- type EmitStruct
- type EventDongPayload
- type EventErrorPayload
- type EventFriendshipPayload
- type EventHeartbeatPayload
- type EventLoginPayload
- type EventLogoutPayload
- type EventMessagePayload
- type EventParams
- type EventReadyPayload
- type EventResetPayload
- type EventRoomInvitePayload
- type EventRoomJoinPayload
- type EventRoomLeavePayload
- type EventRoomTopicPayload
- type EventScanPayload
- type FriendshipPayload
- type FriendshipPayloadBase
- type FriendshipPayloadConfirm
- type FriendshipPayloadReceive
- type FriendshipPayloadVerify
- type FriendshipSceneType
- type FriendshipSearchCondition
- type FriendshipType
- type ImageType
- type MessagePayload
- type MessagePayloadBase
- type MessagePayloadFilterFunction
- type MessagePayloadRoom
- type MessagePayloadTo
- type MessageQueryFilter
- type MessageType
- type MiniProgramPayload
- type PuppetEventName
- type PuppetOptions
- type RoomInvitationPayload
- type RoomMemberPayload
- type RoomMemberQueryFilter
- type RoomPayload
- type RoomPayloadFilterFunction
- type RoomQueryFilter
- type ScanStatus
- type UrlLinkPayload
- type WeChatAppMessageType
- type WeChatMessageType
Constants ¶
View Source
const ( ImageTypeUnknown ImageType = 0 ImageTypeThumbnail = 1 ImageTypeHD = 2 ImageTypeArtwork = 3 )
Variables ¶
This section is empty.
Functions ¶
func PbEventType2GeneratePayloadFunc ¶
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 ContactPayloadFilterFunction ¶
type ContactPayloadFilterFunction func(payload *ContactPayload) bool
type ContactQueryFilter ¶
type ContactQueryFilter struct {
Alias string
AliasRegexp *regexp.Regexp
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 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 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 EventRoomLeavePayload ¶
type EventRoomTopicPayload ¶
type EventScanPayload ¶
type EventScanPayload struct {
BaseEventPayload
Status ScanStatus
QrCode string
}
type FriendshipPayload ¶
type FriendshipPayload struct {
FriendshipPayloadReceive
}
type FriendshipPayloadBase ¶
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 ¶
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 MessagePayload ¶
type MessagePayload struct {
MessagePayloadBase
MessagePayloadRoom
}
type MessagePayloadBase ¶
type MessagePayloadFilterFunction ¶
type MessagePayloadFilterFunction func(payload *MessagePayload) bool
type MessagePayloadRoom ¶
type MessagePayloadTo ¶
type MessagePayloadTo = MessagePayloadRoom
type MessageQueryFilter ¶
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
}
func (*MiniProgramPayload) ToJson ¶
func (m *MiniProgramPayload) ToJson() string
type PuppetEventName ¶
type PuppetEventName uint8
const ( PuppetEventNameUnknown PuppetEventName = iota PuppetEventNameFriendship PuppetEventNameLogin PuppetEventNameLogout PuppetEventNameMessage PuppetEventNameRoomInvite PuppetEventNameRoomJoin PuppetEventNameRoomLeave PuppetEventNameRoomTopic PuppetEventNameScan PuppetEventNameDong PuppetEventNameError PuppetEventNameHeartbeat PuppetEventNameReady PuppetEventNameReset PuppetEventNameStop PuppetEventNameStart )
func GetEventNames ¶
func GetEventNames() []PuppetEventName
func (PuppetEventName) String ¶
func (i PuppetEventName) String() string
type PuppetOptions ¶
type PuppetOptions struct {
// contains filtered or unexported fields
}
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 int64 `json:"timestamp"`
ReceiverId string `json:"receiverId"`
}
type RoomMemberPayload ¶
type RoomMemberQueryFilter ¶
type RoomPayload ¶
type RoomPayloadFilterFunction ¶
type RoomPayloadFilterFunction func(payload *RoomPayload) bool
type RoomQueryFilter ¶
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 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 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 )
Source Files
¶
Click to show internal directories.
Click to hide internal directories.