Documentation ¶
Index ¶
- type IAccessory
- type IContact
- type IContactFactory
- type IContactSelf
- type IContactSelfFactory
- type IFriendship
- type IFriendshipFactory
- type IImage
- type IImageFactory
- type IMessage
- type IMessageFactory
- type IMiniProgram
- type IRoom
- type IRoomFactory
- type IRoomInvitation
- type IRoomInvitationFactory
- type ITag
- type ITagFactory
- type IUrlLink
- type IUrlLinkFactory
- type IWechaty
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IAccessory ¶
type IAccessory interface { GetPuppet() wechatyPuppet.IPuppetAbstract GetWechaty() IWechaty }
IAccessory accessory interface
type IContact ¶
type IContact interface { // Ready is For FrameWork ONLY! Ready(forceSync bool) (err error) IsReady() bool // Sync force reload data for Contact, sync data from lowlevel API again. Sync() error String() string ID() string Name() string // Say something params {(string | Contact | FileBox | UrlLink | MiniProgram)} Say(something interface{}) (msg IMessage, err error) // Friend true for friend of the bot, false for not friend of the bot Friend() bool Type() schemas.ContactType // Star check if the contact is star contact Star() bool Gender() schemas.ContactGender Province() string City() string // Avatar get avatar picture file stream Avatar() *filebox.FileBox // Self Check if contact is self Self() bool // Weixin get the weixin number from a contact // Sometimes cannot get weixin number due to weixin security mechanism, not recommend. Weixin() string // Alias get alias Alias() string // SetAlias set alias SetAlias(newAlias string) }
type IContactFactory ¶
type IContactFactory interface { Load(id string) IContact LoadSelf(id string) IContactSelf // Find query params is string or *schemas.ContactQueryFilter // when the parameter is a string type, the name search is used by default Find(query interface{}) IContact // FindAll query params is string or *schemas.ContactQueryFilter // when the parameter is a string type, the name search is used by default FindAll(query interface{}) []IContact // Tags get tags for all contact Tags() []ITag }
type IContactSelf ¶
type IContactSelfFactory ¶
type IContactSelfFactory interface { IContactFactory }
type IFriendship ¶
type IFriendshipFactory ¶
type IFriendshipFactory interface { Load(id string) IFriendship // Search search a Friend by phone or weixin. Search(query *schemas.FriendshipSearchCondition) (IContact, error) // Add send a Friend Request to a `contact` with message `hello`. // The best practice is to send friend request once per minute. // Remember not to do this too frequently, or your account may be blocked. Add(contact IContact, hello string) error // FromJSON create friendShip by friendshipJson FromJSON(payload string) (IFriendship, error) // FromPayload create friendShip by friendshipPayload FromPayload(payload *schemas.FriendshipPayload) (IFriendship, error) }
type IImageFactory ¶
type IMessage ¶
type IMessage interface { Ready() (err error) IsReady() bool String() string Room() IRoom // Type get the type from the message. Type() schemas.MessageType // Deprecated: please use Talker() From() IContact // Talker Get the talker of a message. Talker() IContact Text() string // Self check if a message is sent by self Self() bool Age() time.Duration // Date sent date Date() time.Time // Deprecated: please use Listener() To() IContact // Listener Get the destination of the message // listener() will return nil if a message is in a room // use Room() to get the room. Listener() IContact // ToRecalled Get the recalled message ToRecalled() (IMessage, error) // Say reply a Text or Media File message to the sender. Say(textOrContactOrFileOrUrlOrMini interface{}) (IMessage, error) // Recall recall a message Recall() (bool, error) // MentionList get message mentioned contactList. MentionList() []IContact MentionText() string MentionSelf() bool Forward(contactOrRoomId string) error // ToFileBox extract the Media File from the Message, and put it into the FileBox. ToFileBox() (*filebox.FileBox, error) // ToImage extract the Image File from the Message, so that we can use different image sizes. ToImage() (IImage, error) // ToContact Get Share Card of the Message // Extract the Contact Card from the Message, and encapsulate it into Contact class ToContact() (IContact, error) }
type IMessageFactory ¶
type IMiniProgram ¶
type IRoom ¶
type IRoom interface { // Ready is For FrameWork ONLY! Ready(forceSync bool) (err error) IsReady() bool String() string ID() string // MemberAll all contacts in a room // params nil or string or *schemas.RoomMemberQueryFilter MemberAll(query interface{}) ([]IContact, error) // Member Find all contacts in a room, if get many, return the first one. // query params string or *schemas.RoomMemberQueryFilter Member(query interface{}) (IContact, error) // Alias return contact's roomAlias in the room Alias(contact IContact) (string, error) // Sync Force reload data for Room, Sync data from puppet API again. Sync() error // Say something params {(string | Contact | FileBox | UrlLink | MiniProgram )} // mentionList @ contact list Say(something interface{}, mentionList ...IContact) (msg IMessage, err error) // Add contact in a room Add(contact IContact) error // Del delete a contact from the room // it works only when the bot is the owner of the room Del(contact IContact) error // Quit the room itself Quit() error // Topic get topic from the room Topic() string // Topic set topic from the room SetTopic(topic string) error // Announce get announce from the room Announce() (string, error) // Announce set announce from the room // It only works when bot is the owner of the room. SetAnnounce(text string) error // QrCode Get QR Code Value of the Room from the room, which can be used as scan and join the room. QrCode() (string, error) // Has check if the room has member `contact` Has(contact IContact) (bool, error) // Owner get room's owner from the room. Owner() IContact // Avatar get avatar from the room. Avatar() (*filebox.FileBox, error) }
type IRoomFactory ¶
type IRoomFactory interface { // Create a new room. Create(contactList []IContact, topic string) (IRoom, error) FindAll(query *schemas.RoomQueryFilter) []IRoom // Find query params is string or *schemas.RoomQueryFilter // when the parameter is a string type, the room name search is used by default Find(query interface{}) IRoom Load(id string) IRoom }
type IRoomInvitation ¶
type IRoomInvitationFactory ¶
type IRoomInvitationFactory interface { Load(id string) IRoomInvitation FromJSON(s string) (IRoomInvitation, error) FromPayload(payload *schemas.RoomInvitationPayload) IRoomInvitation }
type ITagFactory ¶
type IUrlLinkFactory ¶
type IWechaty ¶
type IWechaty interface { Room() IRoomFactory Contact() IContactFactory Message() IMessageFactory Tag() ITagFactory Friendship() IFriendshipFactory Image() IImageFactory UserSelf() IContactSelf }
IWechaty interface
Click to show internal directories.
Click to hide internal directories.