Documentation ¶
Overview ¶
Package wechaty ...
Index ¶
- type Accessory
- type Context
- type EventDong
- type EventError
- type EventFriendship
- type EventHeartbeat
- type EventLogin
- type EventLogout
- type EventMessage
- type EventReady
- type EventRoomInvite
- type EventRoomJoin
- type EventRoomLeave
- type EventRoomTopic
- type EventScan
- type EventStart
- type EventStop
- type Option
- type OptionFn
- func WithIOToken(ioToken string) OptionFn
- func WithMemoryCard(memoryCard mc.IMemoryCard) OptionFn
- func WithName(name string) OptionFn
- func WithPuppet(puppet wp.IPuppetAbstract) OptionFn
- func WithPuppetOption(puppetOption wp.Option) OptionFn
- func WithPuppetServiceOptions(puppetServiceOptions puppetservice.Options) OptionFn
- type Plugin
- func (p *Plugin) IsEnable() bool
- func (p *Plugin) OnDong(f EventDong) *Plugin
- func (p *Plugin) OnError(f EventError) *Plugin
- func (p *Plugin) OnFriendship(f EventFriendship) *Plugin
- func (p *Plugin) OnHeartbeat(f EventHeartbeat) *Plugin
- func (p *Plugin) OnLogin(f EventLogin) *Plugin
- func (p *Plugin) OnLogout(f EventLogout) *Plugin
- func (p *Plugin) OnMessage(f EventMessage) *Plugin
- func (p *Plugin) OnReady(f EventReady) *Plugin
- func (p *Plugin) OnRoomInvite(f EventRoomInvite) *Plugin
- func (p *Plugin) OnRoomJoin(f EventRoomJoin) *Plugin
- func (p *Plugin) OnRoomLeave(f EventRoomLeave) *Plugin
- func (p *Plugin) OnRoomTopic(f EventRoomTopic) *Plugin
- func (p *Plugin) OnScan(f EventScan) *Plugin
- func (p *Plugin) OnStart(f EventStart) *Plugin
- func (p *Plugin) OnStop(f EventStop) *Plugin
- func (p *Plugin) SetEnable(value bool)
- type PluginEvent
- type Wechaty
- func (w *Wechaty) Contact() _interface.IContactFactory
- func (w *Wechaty) DaemonStart()
- func (w *Wechaty) Friendship() _interface.IFriendshipFactory
- func (w *Wechaty) Image() _interface.IImageFactory
- func (w *Wechaty) Message() _interface.IMessageFactory
- func (w *Wechaty) Name() string
- func (w *Wechaty) OnDong(f EventDong) *Wechaty
- func (w *Wechaty) OnError(f EventError) *Wechaty
- func (w *Wechaty) OnFriendship(f EventFriendship) *Wechaty
- func (w *Wechaty) OnHeartbeat(f EventHeartbeat) *Wechaty
- func (w *Wechaty) OnLogin(f EventLogin) *Wechaty
- func (w *Wechaty) OnLogout(f EventLogout) *Wechaty
- func (w *Wechaty) OnMessage(f EventMessage) *Wechaty
- func (w *Wechaty) OnReady(f EventReady) *Wechaty
- func (w *Wechaty) OnRoomInvite(f EventRoomInvite) *Wechaty
- func (w *Wechaty) OnRoomJoin(f EventRoomJoin) *Wechaty
- func (w *Wechaty) OnRoomLeave(f EventRoomLeave) *Wechaty
- func (w *Wechaty) OnRoomTopic(f EventRoomTopic) *Wechaty
- func (w *Wechaty) OnScan(f EventScan) *Wechaty
- func (w *Wechaty) OnStart(f EventStart) *Wechaty
- func (w *Wechaty) OnStop(f EventStop) *Wechaty
- func (w *Wechaty) Puppet() wp.IPuppetAbstract
- func (w *Wechaty) Room() _interface.IRoomFactory
- func (w *Wechaty) RoomInvitation() _interface.IRoomInvitationFactory
- func (w *Wechaty) Start() error
- func (w *Wechaty) String() string
- func (w *Wechaty) Tag() _interface.ITagFactory
- func (w *Wechaty) URLLink() _interface.IUrlLinkFactory
- func (w *Wechaty) Use(plugin *Plugin) *Wechaty
- func (w *Wechaty) UserSelf() _interface.IContactSelf
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Accessory ¶
type Accessory struct {
// contains filtered or unexported fields
}
Accessory ...
func (*Accessory) GetPuppet ¶
func (a *Accessory) GetPuppet() wechatypuppet.IPuppetAbstract
GetPuppet ...
type Context ¶ added in v0.2.0
Context ...
func (*Context) Abort ¶ added in v0.2.0
func (c *Context) Abort()
Abort stops executing all follow-up plugins and terminates goroutuines which listen to Context.Done() (See go programming language context.Context. https://golang.org/pkg/context/)
func (*Context) DisableOnce ¶ added in v0.2.0
DisableOnce disables a plugin temperarily. The plugin will be active again(if it is enable).
func (*Context) GetData ¶ added in v0.2.0
GetData returns temperary data which only exists in the current context.
type EventFriendship ¶
type EventFriendship func(context *Context, friendship *user.Friendship)
EventFriendship ...
type EventLogout ¶
type EventLogout func(context *Context, user *user.ContactSelf, reason string)
EventLogout ...
type EventMessage ¶
EventMessage ...
type EventRoomInvite ¶
type EventRoomInvite func(context *Context, roomInvitation *user.RoomInvitation)
EventRoomInvite ...
type EventRoomJoin ¶
type EventRoomJoin func(context *Context, room *user.Room, inviteeList []_interface.IContact, inviter _interface.IContact, date time.Time)
EventRoomJoin ...
type EventRoomLeave ¶
type EventRoomLeave func(context *Context, room *user.Room, leaverList []_interface.IContact, remover _interface.IContact, date time.Time)
EventRoomLeave ...
type EventRoomTopic ¶
type EventRoomTopic func(context *Context, room *user.Room, newTopic string, oldTopic string, changer _interface.IContact, date time.Time)
EventRoomTopic ...
type EventScan ¶
type EventScan func(context *Context, qrCode string, status schemas.ScanStatus, data string)
EventScan ...
type Option ¶
type Option struct {
// contains filtered or unexported fields
}
Option wechaty option
type OptionFn ¶
type OptionFn func(opts *Option)
OptionFn func
func WithMemoryCard ¶
func WithMemoryCard(memoryCard mc.IMemoryCard) OptionFn
WithMemoryCard with memory card
func WithPuppetOption ¶
WithPuppetOption with puppet option
func WithPuppetServiceOptions ¶ added in v0.4.11
func WithPuppetServiceOptions(puppetServiceOptions puppetservice.Options) OptionFn
WithPuppetServiceOptions puppet service options
type Plugin ¶ added in v0.2.0
type Plugin struct { Wechaty *Wechaty // contains filtered or unexported fields }
Plugin ...
func (*Plugin) OnFriendship ¶ added in v0.2.0
func (p *Plugin) OnFriendship(f EventFriendship) *Plugin
OnFriendship ...
func (*Plugin) OnHeartbeat ¶ added in v0.2.0
func (p *Plugin) OnHeartbeat(f EventHeartbeat) *Plugin
OnHeartbeat ...
func (*Plugin) OnLogout ¶ added in v0.2.0
func (p *Plugin) OnLogout(f EventLogout) *Plugin
OnLogout ...
func (*Plugin) OnMessage ¶ added in v0.2.0
func (p *Plugin) OnMessage(f EventMessage) *Plugin
OnMessage ...
func (*Plugin) OnRoomInvite ¶ added in v0.2.0
func (p *Plugin) OnRoomInvite(f EventRoomInvite) *Plugin
OnRoomInvite ...
func (*Plugin) OnRoomJoin ¶ added in v0.2.0
func (p *Plugin) OnRoomJoin(f EventRoomJoin) *Plugin
OnRoomJoin ...
func (*Plugin) OnRoomLeave ¶ added in v0.2.0
func (p *Plugin) OnRoomLeave(f EventRoomLeave) *Plugin
OnRoomLeave ...
func (*Plugin) OnRoomTopic ¶ added in v0.2.0
func (p *Plugin) OnRoomTopic(f EventRoomTopic) *Plugin
OnRoomTopic ...
type PluginEvent ¶ added in v0.2.0
type PluginEvent struct {
// contains filtered or unexported fields
}
PluginEvent stores the event name and the callback function.
type Wechaty ¶
type Wechaty struct { *Option // contains filtered or unexported fields }
Wechaty ...
func (*Wechaty) Friendship ¶
func (w *Wechaty) Friendship() _interface.IFriendshipFactory
Friendship ...
func (*Wechaty) OnFriendship ¶
func (w *Wechaty) OnFriendship(f EventFriendship) *Wechaty
OnFriendship ...
func (*Wechaty) OnHeartbeat ¶
func (w *Wechaty) OnHeartbeat(f EventHeartbeat) *Wechaty
OnHeartbeat ...
func (*Wechaty) OnRoomInvite ¶
func (w *Wechaty) OnRoomInvite(f EventRoomInvite) *Wechaty
OnRoomInvite ...
func (*Wechaty) OnRoomLeave ¶
func (w *Wechaty) OnRoomLeave(f EventRoomLeave) *Wechaty
OnRoomLeave ...
func (*Wechaty) OnRoomTopic ¶
func (w *Wechaty) OnRoomTopic(f EventRoomTopic) *Wechaty
OnRoomTopic ...
func (*Wechaty) Puppet ¶ added in v0.2.0
func (w *Wechaty) Puppet() wp.IPuppetAbstract
Puppet return puppet impl
func (*Wechaty) RoomInvitation ¶
func (w *Wechaty) RoomInvitation() _interface.IRoomInvitationFactory
RoomInvitation ...