keaimao

package module
v0.0.0-...-0981023 Latest Latest
Warning

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

Go to latest
Published: May 6, 2021 License: BSD-2-Clause Imports: 8 Imported by: 1

README

keaimao

可爱猫(ke ai mao) sdk in Go

使用教程

robot := NewRobot("robot-wxid")

// or with a new send api
// robot := NewRobot("dont-care-robot-id", WithSendAPI(testSendAPI))

robot.SendTextMessage(context.Background(), "to-wxid", "hello world")

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EventType

type EventType uint32
const (
	// EventSendTextMessage 私聊消息
	EventSendTextMessage EventType = 100

	// EventSendGroupMessage 群聊消息
	EventSendGroupMessage = 102
)

type M

type M map[string]interface{}

type Robot

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

func NewRobot

func NewRobot(robotID string, opts ...RobotOption) *Robot

NewRobot to create a robot.

func (*Robot) SendGroupMessage

func (robot *Robot) SendGroupMessage(ctx context.Context, towxid, atwxid, msg string) error

SendGroupMessage to send group message.

func (*Robot) SendTextMessage

func (robot *Robot) SendTextMessage(ctx context.Context, towxid, msg string) error

SendTextMessage send `msg` to `towxid`.

type RobotOption

type RobotOption func(*Robot)

func WithSendAPI

func WithSendAPI(sendAPI string) RobotOption

WithSendAPI set send url.

func WithTimeout

func WithTimeout(timeout time.Duration) RobotOption

WithTimeout set post timeout.

Jump to

Keyboard shortcuts

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