wechaty

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Overview

Package wechaty ...

Index

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 ...

func (*Accessory) GetWechaty

func (a *Accessory) GetWechaty() _interface.IWechaty

GetWechaty ...

type Context

type Context struct {
	context.Context
	// contains filtered or unexported fields
}

Context ...

func NewContext

func NewContext() *Context

NewContext ...

func (*Context) Abort

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

func (c *Context) DisableOnce(plugin *Plugin)

DisableOnce disables a plugin temperarily. The plugin will be active again(if it is enable).

func (*Context) GetData

func (c *Context) GetData(name string) interface{}

GetData returns temperary data which only exists in the current context.

func (*Context) IsActive

func (c *Context) IsActive(plugin *Plugin) bool

IsActive returns whether the plugin is active now.

func (*Context) SetData

func (c *Context) SetData(name string, value interface{})

SetData sets temperary data which only exists in the current context.

type EventDong

type EventDong func(context *Context, data string)

EventDong ...

type EventError

type EventError func(context *Context, err error)

EventError ...

type EventFriendship

type EventFriendship func(context *Context, friendship *user.Friendship)

EventFriendship ...

type EventHeartbeat

type EventHeartbeat func(context *Context, data string)

EventHeartbeat ...

type EventLogin

type EventLogin func(context *Context, user *user.ContactSelf)

EventLogin ...

type EventLogout

type EventLogout func(context *Context, user *user.ContactSelf, reason string)

EventLogout ...

type EventMessage

type EventMessage func(context *Context, message *user.Message)

EventMessage ...

type EventReady

type EventReady func(context *Context)

EventReady ...

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 EventStart

type EventStart func(context *Context)

EventStart ...

type EventStop

type EventStop func(context *Context)

EventStop ...

type Option

type Option struct {
	// contains filtered or unexported fields
}

Option wechaty option

type OptionFn

type OptionFn func(opts *Option)

OptionFn func

func WithIOToken

func WithIOToken(ioToken string) OptionFn

WithIOToken with io token

func WithMemoryCard

func WithMemoryCard(memoryCard mc.IMemoryCard) OptionFn

WithMemoryCard with memory card

func WithName

func WithName(name string) OptionFn

WithName with name

func WithPuppet

func WithPuppet(puppet wp.IPuppetAbstract) OptionFn

WithPuppet with puppet impl

func WithPuppetOption

func WithPuppetOption(puppetOption wp.Option) OptionFn

WithPuppetOption with puppet option

func WithPuppetServiceOptions

func WithPuppetServiceOptions(puppetServiceOptions puppetservice.Options) OptionFn

WithPuppetServiceOptions puppet service options

type Plugin

type Plugin struct {
	Wechaty *Wechaty
	// contains filtered or unexported fields
}

Plugin ...

func NewPlugin

func NewPlugin() *Plugin

NewPlugin ...

func (*Plugin) IsEnable

func (p *Plugin) IsEnable() bool

IsEnable returns whether the plugin is activated.

func (*Plugin) OnDong

func (p *Plugin) OnDong(f EventDong) *Plugin

OnDong ...

func (*Plugin) OnError

func (p *Plugin) OnError(f EventError) *Plugin

OnError ...

func (*Plugin) OnFriendship

func (p *Plugin) OnFriendship(f EventFriendship) *Plugin

OnFriendship ...

func (*Plugin) OnHeartbeat

func (p *Plugin) OnHeartbeat(f EventHeartbeat) *Plugin

OnHeartbeat ...

func (*Plugin) OnLogin

func (p *Plugin) OnLogin(f EventLogin) *Plugin

OnLogin ...

func (*Plugin) OnLogout

func (p *Plugin) OnLogout(f EventLogout) *Plugin

OnLogout ...

func (*Plugin) OnMessage

func (p *Plugin) OnMessage(f EventMessage) *Plugin

OnMessage ...

func (*Plugin) OnReady

func (p *Plugin) OnReady(f EventReady) *Plugin

OnReady ...

func (*Plugin) OnRoomInvite

func (p *Plugin) OnRoomInvite(f EventRoomInvite) *Plugin

OnRoomInvite ...

func (*Plugin) OnRoomJoin

func (p *Plugin) OnRoomJoin(f EventRoomJoin) *Plugin

OnRoomJoin ...

func (*Plugin) OnRoomLeave

func (p *Plugin) OnRoomLeave(f EventRoomLeave) *Plugin

OnRoomLeave ...

func (*Plugin) OnRoomTopic

func (p *Plugin) OnRoomTopic(f EventRoomTopic) *Plugin

OnRoomTopic ...

func (*Plugin) OnScan

func (p *Plugin) OnScan(f EventScan) *Plugin

OnScan ...

func (*Plugin) OnStart

func (p *Plugin) OnStart(f EventStart) *Plugin

OnStart ...

func (*Plugin) OnStop

func (p *Plugin) OnStop(f EventStop) *Plugin

OnStop ...

func (*Plugin) SetEnable

func (p *Plugin) SetEnable(value bool)

SetEnable enable or disable a plugin.

type PluginEvent

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 NewWechaty

func NewWechaty(optFns ...OptionFn) *Wechaty

NewWechaty ... instance by golang.

func (*Wechaty) Contact

func (w *Wechaty) Contact() _interface.IContactFactory

Contact ...

func (*Wechaty) DaemonStart

func (w *Wechaty) DaemonStart()

DaemonStart 守护进程运行

func (*Wechaty) Friendship

func (w *Wechaty) Friendship() _interface.IFriendshipFactory

Friendship ...

func (*Wechaty) Image

func (w *Wechaty) Image() _interface.IImageFactory

Image ...

func (*Wechaty) Message

func (w *Wechaty) Message() _interface.IMessageFactory

Message ...

func (*Wechaty) Name

func (w *Wechaty) Name() string

Name Wechaty bot name set by `options.name`

func (*Wechaty) OnDong

func (w *Wechaty) OnDong(f EventDong) *Wechaty

OnDong ...

func (*Wechaty) OnError

func (w *Wechaty) OnError(f EventError) *Wechaty

OnError ...

func (*Wechaty) OnFriendship

func (w *Wechaty) OnFriendship(f EventFriendship) *Wechaty

OnFriendship ...

func (*Wechaty) OnHeartbeat

func (w *Wechaty) OnHeartbeat(f EventHeartbeat) *Wechaty

OnHeartbeat ...

func (*Wechaty) OnLogin

func (w *Wechaty) OnLogin(f EventLogin) *Wechaty

OnLogin ...

func (*Wechaty) OnLogout

func (w *Wechaty) OnLogout(f EventLogout) *Wechaty

OnLogout ...

func (*Wechaty) OnMessage

func (w *Wechaty) OnMessage(f EventMessage) *Wechaty

OnMessage ...

func (*Wechaty) OnReady

func (w *Wechaty) OnReady(f EventReady) *Wechaty

OnReady ...

func (*Wechaty) OnRoomInvite

func (w *Wechaty) OnRoomInvite(f EventRoomInvite) *Wechaty

OnRoomInvite ...

func (*Wechaty) OnRoomJoin

func (w *Wechaty) OnRoomJoin(f EventRoomJoin) *Wechaty

OnRoomJoin ...

func (*Wechaty) OnRoomLeave

func (w *Wechaty) OnRoomLeave(f EventRoomLeave) *Wechaty

OnRoomLeave ...

func (*Wechaty) OnRoomTopic

func (w *Wechaty) OnRoomTopic(f EventRoomTopic) *Wechaty

OnRoomTopic ...

func (*Wechaty) OnScan

func (w *Wechaty) OnScan(f EventScan) *Wechaty

OnScan ...

func (*Wechaty) OnStart

func (w *Wechaty) OnStart(f EventStart) *Wechaty

OnStart ...

func (*Wechaty) OnStop

func (w *Wechaty) OnStop(f EventStop) *Wechaty

OnStop ...

func (*Wechaty) Puppet

func (w *Wechaty) Puppet() wp.IPuppetAbstract

Puppet return puppet impl

func (*Wechaty) Room

func (w *Wechaty) Room() _interface.IRoomFactory

Room ...

func (*Wechaty) RoomInvitation

func (w *Wechaty) RoomInvitation() _interface.IRoomInvitationFactory

RoomInvitation ...

func (*Wechaty) Start

func (w *Wechaty) Start() error

Start ...

func (*Wechaty) String

func (w *Wechaty) String() string

func (*Wechaty) Tag

func (w *Wechaty) Tag() _interface.ITagFactory

Tag ...

func (w *Wechaty) URLLink() _interface.IUrlLinkFactory

URLLink ...

func (*Wechaty) Use

func (w *Wechaty) Use(plugin *Plugin) *Wechaty

Use loads a plugin.

func (*Wechaty) UserSelf

func (w *Wechaty) UserSelf() _interface.IContactSelf

UserSelf return contact self

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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