Documentation ¶
Index ¶
- func NewMessage(id string, accessory _interface.IAccessory) _interface.IMessage
- type Contact
- func (c *Contact) Alias() string
- func (c *Contact) Avatar() *filebox.FileBox
- func (c *Contact) City() string
- func (c *Contact) Friend() bool
- func (c *Contact) Gender() schemas.ContactGender
- func (c *Contact) ID() string
- func (c *Contact) IsReady() bool
- func (c *Contact) Name() string
- func (c *Contact) Province() string
- func (c *Contact) Ready(forceSync bool) (err error)
- func (c *Contact) Say(something interface{}) (msg _interface.IMessage, err error)
- func (c *Contact) Self() bool
- func (c *Contact) SetAlias(newAlias string)
- func (c *Contact) Star() bool
- func (c *Contact) String() string
- func (c *Contact) Sync() error
- func (c *Contact) Type() schemas.ContactType
- func (c *Contact) Weixin() string
- type ContactSelf
- type Friendship
- func (f *Friendship) Accept() error
- func (f *Friendship) Contact() _interface.IContact
- func (f *Friendship) Hello() string
- func (f *Friendship) IsReady() bool
- func (f *Friendship) Ready() (err error)
- func (f *Friendship) String() string
- func (f *Friendship) ToJSON() (string, error)
- func (f *Friendship) Type() schemas.FriendshipType
- type Images
- type Location
- type Message
- func (m *Message) Age() time.Duration
- func (m *Message) Date() time.Time
- func (m *Message) Forward(contactOrRoomId string) error
- func (m *Message) From() _interface.IContact
- func (m *Message) ID() string
- func (m *Message) IsReady() bool
- func (m *Message) Listener() _interface.IContact
- func (m *Message) MentionList() []_interface.IContact
- func (m *Message) MentionSelf() bool
- func (m *Message) MentionText() string
- func (m *Message) Ready() (err error)
- func (m *Message) Recall() (bool, error)
- func (m *Message) Room() _interface.IRoom
- func (m *Message) Say(sayable interface{}) (_interface.IMessage, error)
- func (m *Message) Self() bool
- func (m *Message) String() string
- func (m *Message) Talker() _interface.IContact
- func (m *Message) Text() string
- func (m *Message) To() _interface.IContact
- func (m *Message) ToContact() (_interface.IContact, error)
- func (m *Message) ToFileBox() (*filebox.FileBox, error)
- func (m *Message) ToImage() (_interface.IImage, error)
- func (m *Message) ToLocation() (*Location, error)
- func (m *Message) ToMiniProgram() (*MiniProgram, error)
- func (m *Message) ToRecalled() (_interface.IMessage, error)
- func (m *Message) ToUrlLink() (*UrlLink, error)
- func (m *Message) Type() schemas.MessageType
- type MiniProgram
- func (mp *MiniProgram) AppID() string
- func (mp *MiniProgram) Description() string
- func (mp *MiniProgram) IconUrl() string
- func (mp *MiniProgram) PagePath() string
- func (mp *MiniProgram) Payload() schemas.MiniProgramPayload
- func (mp *MiniProgram) ShareId() string
- func (mp *MiniProgram) ThumbKey() string
- func (mp *MiniProgram) ThumbUrl() string
- func (mp *MiniProgram) Title() string
- func (mp *MiniProgram) Username() string
- type Room
- func (r *Room) Add(contact _interface.IContact) error
- func (r *Room) Alias(contact _interface.IContact) (string, error)
- func (r *Room) Announce() (string, error)
- func (r *Room) Avatar() (*filebox.FileBox, error)
- func (r *Room) Del(contact _interface.IContact) error
- func (r *Room) Has(contact _interface.IContact) (bool, error)
- func (r *Room) ID() string
- func (r *Room) IsReady() bool
- func (r *Room) Member(query interface{}) (_interface.IContact, error)
- func (r *Room) MemberAll(query interface{}) ([]_interface.IContact, error)
- func (r *Room) Owner() _interface.IContact
- func (r *Room) QrCode() (string, error)
- func (r *Room) Quit() error
- func (r *Room) Ready(forceSync bool) (err error)
- func (r *Room) Say(something interface{}, mentionList ..._interface.IContact) (msg _interface.IMessage, err error)
- func (r *Room) SetAnnounce(text string) error
- func (r *Room) SetTopic(topic string) error
- func (r *Room) String() string
- func (r *Room) Sync() error
- func (r *Room) Topic() string
- type RoomInvitation
- func (ri *RoomInvitation) Accept() error
- func (ri *RoomInvitation) Age() (time.Duration, error)
- func (ri *RoomInvitation) Date() (time.Time, error)
- func (ri *RoomInvitation) Inviter() (_interface.IContact, error)
- func (ri *RoomInvitation) MemberCount() (int, error)
- func (ri *RoomInvitation) MemberList() ([]_interface.IContact, error)
- func (ri *RoomInvitation) String() string
- func (ri *RoomInvitation) ToJson() (string, error)
- func (ri *RoomInvitation) ToStringAsync() (string, error)
- func (ri *RoomInvitation) Topic() (string, error)
- type Tag
- type UrlLink
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewMessage ¶
func NewMessage(id string, accessory _interface.IAccessory) _interface.IMessage
NewMessage ...
Types ¶
type Contact ¶
type Contact struct { _interface.IAccessory Id string // contains filtered or unexported fields }
func NewContact ¶
func NewContact(id string, accessory _interface.IAccessory) *Contact
NewContact ...
func (*Contact) Say ¶
func (c *Contact) Say(something interface{}) (msg _interface.IMessage, err error)
Say something params {(string | Contact | FileBox | UrlLink | MiniProgram)}
type ContactSelf ¶
type ContactSelf struct {
*Contact
}
func NewContactSelf ¶
func NewContactSelf(id string, accessory _interface.IAccessory) *ContactSelf
NewContactSelf ...
func (*ContactSelf) SetAvatar ¶
func (c *ContactSelf) SetAvatar(box *filebox.FileBox) error
SetAvatar SET the avatar for a bot
func (*ContactSelf) SetName ¶
func (c *ContactSelf) SetName(name string) error
SetName change bot name
func (*ContactSelf) Signature ¶
func (c *ContactSelf) Signature(signature string) error
Signature change bot signature
type Friendship ¶
type Friendship struct { _interface.IAccessory // contains filtered or unexported fields }
func NewFriendship ¶
func NewFriendship(id string, accessory _interface.IAccessory) *Friendship
NewFriendship ...
func (*Friendship) String ¶
func (f *Friendship) String() string
func (*Friendship) ToJSON ¶
func (f *Friendship) ToJSON() (string, error)
toJSON get friendShipPayload Json
func (*Friendship) Type ¶
func (f *Friendship) Type() schemas.FriendshipType
type Images ¶
type Images struct { _interface.IAccessory ImageId string }
type Location ¶ added in v0.4.12
type Location struct {
// contains filtered or unexported fields
}
func NewLocation ¶ added in v0.4.12
func NewLocation(payload *schemas.LocationPayload) *Location
func (*Location) Payload ¶ added in v0.4.12
func (l *Location) Payload() schemas.LocationPayload
type Message ¶
type Message struct { _interface.IAccessory // contains filtered or unexported fields }
func (*Message) From ¶
func (m *Message) From() _interface.IContact
From get the sender from a message Deprecated: please use Talker()
func (*Message) Listener ¶ added in v0.4.0
func (m *Message) Listener() _interface.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.
func (*Message) MentionList ¶
func (m *Message) MentionList() []_interface.IContact
MentionList get message mentioned contactList.
func (*Message) MentionSelf ¶
func (*Message) MentionText ¶
func (*Message) Room ¶
func (m *Message) Room() _interface.IRoom
Room get the room from the message.
func (*Message) Say ¶
func (m *Message) Say(sayable interface{}) (_interface.IMessage, error)
Say reply a Text or Media File message to the sender. Support msg: string Contact filebox.FileBox UrlLink MiniProgram Location
func (*Message) Talker ¶ added in v0.4.0
func (m *Message) Talker() _interface.IContact
Talker Get the talker of a message.
func (*Message) To ¶
func (m *Message) To() _interface.IContact
To get the destination of the message Deprecated: please use Listener()
func (*Message) ToContact ¶
func (m *Message) ToContact() (_interface.IContact, error)
ToContact Get Share Card of the Message Extract the Contact Card from the Message, and encapsulate it into Contact class
func (*Message) ToFileBox ¶
ToFileBox extract the Media File from the Message, and put it into the FileBox.
func (*Message) ToImage ¶
func (m *Message) ToImage() (_interface.IImage, error)
ToImage extract the Image File from the Message, so that we can use different image sizes.
func (*Message) ToLocation ¶ added in v0.4.12
func (*Message) ToMiniProgram ¶
func (m *Message) ToMiniProgram() (*MiniProgram, error)
func (*Message) ToRecalled ¶
func (m *Message) ToRecalled() (_interface.IMessage, error)
ToRecalled get the recalled message
func (*Message) Type ¶
func (m *Message) Type() schemas.MessageType
Type get the type from the message.
type MiniProgram ¶
type MiniProgram struct {
// contains filtered or unexported fields
}
func NewMiniProgram ¶
func NewMiniProgram(payload *schemas.MiniProgramPayload) *MiniProgram
func (*MiniProgram) AppID ¶
func (mp *MiniProgram) AppID() string
func (*MiniProgram) Description ¶
func (mp *MiniProgram) Description() string
func (*MiniProgram) IconUrl ¶ added in v0.4.0
func (mp *MiniProgram) IconUrl() string
func (*MiniProgram) PagePath ¶
func (mp *MiniProgram) PagePath() string
func (*MiniProgram) Payload ¶ added in v0.4.0
func (mp *MiniProgram) Payload() schemas.MiniProgramPayload
func (*MiniProgram) ShareId ¶ added in v0.4.0
func (mp *MiniProgram) ShareId() string
func (*MiniProgram) ThumbKey ¶
func (mp *MiniProgram) ThumbKey() string
func (*MiniProgram) ThumbUrl ¶
func (mp *MiniProgram) ThumbUrl() string
func (*MiniProgram) Title ¶
func (mp *MiniProgram) Title() string
func (*MiniProgram) Username ¶
func (mp *MiniProgram) Username() string
type Room ¶
type Room struct { _interface.IAccessory // contains filtered or unexported fields }
func (*Room) Alias ¶
func (r *Room) Alias(contact _interface.IContact) (string, error)
Alias return contact's roomAlias in the room
func (*Room) Del ¶
func (r *Room) Del(contact _interface.IContact) error
Del delete a contact from the room it works only when the bot is the owner of the room
func (*Room) Has ¶
func (r *Room) Has(contact _interface.IContact) (bool, error)
Has check if the room has member `contact`
func (*Room) Member ¶
func (r *Room) Member(query interface{}) (_interface.IContact, error)
Member Find all contacts in a room, if get many, return the first one. query params string or RoomMemberQueryFilter
func (*Room) MemberAll ¶
func (r *Room) MemberAll(query interface{}) ([]_interface.IContact, error)
MemberAll all contacts in a room params nil or string or *schemas.RoomMemberQueryFilter
func (*Room) Owner ¶
func (r *Room) Owner() _interface.IContact
Owner get room's owner from the room.
func (*Room) QrCode ¶
QrCode Get QR Code Value of the Room from the room, which can be used as scan and join the room.
func (*Room) Say ¶
func (r *Room) Say(something interface{}, mentionList ..._interface.IContact) (msg _interface.IMessage, err error)
Say something params {(string | Contact | FileBox | UrlLink | MiniProgram )} mentionList @ contact list
func (*Room) SetAnnounce ¶
SetAnnounce set announce from the room It only works when bot is the owner of the room.
type RoomInvitation ¶
type RoomInvitation struct { _interface.IAccessory // contains filtered or unexported fields }
func NewRoomInvitation ¶
func NewRoomInvitation(id string, accessory _interface.IAccessory) *RoomInvitation
NewRoomInvitation ...
func (*RoomInvitation) Age ¶
func (ri *RoomInvitation) Age() (time.Duration, error)
Age returns the room invitation age in seconds
func (*RoomInvitation) Date ¶
func (ri *RoomInvitation) Date() (time.Time, error)
Date get the invitation time
func (*RoomInvitation) Inviter ¶
func (ri *RoomInvitation) Inviter() (_interface.IContact, error)
Inviter get the inviter from room invitation
func (*RoomInvitation) MemberCount ¶
func (ri *RoomInvitation) MemberCount() (int, error)
func (*RoomInvitation) MemberList ¶
func (ri *RoomInvitation) MemberList() ([]_interface.IContact, error)
MemberList list of Room Members that you known(is friend)
func (*RoomInvitation) String ¶
func (ri *RoomInvitation) String() string
func (*RoomInvitation) ToJson ¶
func (ri *RoomInvitation) ToJson() (string, error)
func (*RoomInvitation) ToStringAsync ¶
func (ri *RoomInvitation) ToStringAsync() (string, error)
func (*RoomInvitation) Topic ¶
func (ri *RoomInvitation) Topic() (string, error)
Topic get the room topic from room invitation
type Tag ¶
type Tag struct { _interface.IAccessory // contains filtered or unexported fields }
type UrlLink ¶
type UrlLink struct {
// contains filtered or unexported fields
}
func NewUrlLink ¶
func NewUrlLink(payload *schemas.UrlLinkPayload) *UrlLink
func (*UrlLink) Description ¶
func (*UrlLink) Payload ¶ added in v0.1.2
func (ul *UrlLink) Payload() schemas.UrlLinkPayload
Payload UrlLink payload