limb

package
v0.0.0-...-0dd8377 Latest Latest
Warning

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

Go to latest
Published: May 18, 2023 License: MIT Imports: 29 Imported by: 0

Documentation

Index

Constants

View Source
const (
	CLIENT_API_URL = "http://127.0.0.1:%d/api/?type=%d"

	WECHAT_IS_LOGIN                     = 0
	WECHAT_GET_SELF_INFO                = 1
	WECHAT_MSG_SEND_TEXT                = 2
	WECHAT_MSG_SEND_AT                  = 3
	WECHAT_MSG_SEND_IMAGE               = 5
	WECHAT_MSG_SEND_FILE                = 6
	WECHAT_MSG_START_HOOK               = 9
	WECHAT_MSG_START_IMAGE_HOOK         = 11
	WECHAT_MSG_START_VOICE_HOOK         = 13
	WECHAT_CONTACT_GET_LIST             = 15
	WECHAT_CHATROOM_GET_MEMBER_LIST     = 25
	WECHAT_CHATROOM_GET_MEMBER_NICKNAME = 26
	WECHAT_DATABASE_GET_HANDLES         = 32
	WECHAT_DATABASE_QUERY               = 34
	WECHAT_SET_VERSION                  = 35
	WECHAT_MSG_FORWARD_MESSAGE          = 40
	WECHAT_GET_QROCDE_IMAGE             = 41
	WECHAT_LOGOUT                       = 44

	DB_MICRO_MSG      = "MicroMsg.db"
	DB_OPENIM_CONTACT = "OpenIMContact.db"
	DB_MEDIA_MSG      = "MediaMSG0.db"
)

Variables

View Source
var (
	UserAgent = "" /* 130-byte string literal not displayed */
)

Functions

func GetBytes

func GetBytes(url string) ([]byte, error)

func HTTPGetReadCloser

func HTTPGetReadCloser(url string) (io.ReadCloser, error)

func LoadDriver

func LoadDriver() syscall.Handle

func NewGzipReadCloser

func NewGzipReadCloser(reader io.ReadCloser) (io.ReadCloser, error)

Types

type Bot

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

func NewBot

func NewBot(config *common.Configure, pushFunc func(*common.OctopusEvent)) *Bot

func (*Bot) Login

func (b *Bot) Login()

func (*Bot) Start

func (b *Bot) Start()

func (*Bot) Stop

func (b *Bot) Stop()

type ContactResp

type ContactResp struct {
	Data   [][5]string `json:"data,omitempty"`
	Result string      `json:"result"`
}

type GetGroupMembersResp

type GetGroupMembersResp struct {
	Members string `json:"members"`
	Result  string `json:"result"`
}

type GetQRCodeResp

type GetQRCodeResp struct {
	Message string `json:"msg"`
	Result  string `json:"result"`
}

type GetSelfResp

type GetSelfResp struct {
	Data   UserInfo `json:"data"`
	Result string   `json:"result"`
}

type GroupInfo

type GroupInfo struct {
	ID        string   `json:"wxId"`
	Name      string   `json:"wxNickName"`
	BigAvatar string   `json:"wxBigAvatar"`
	Notice    string   `json:"notice"`
	Members   []string `json:"members"`
}

type IsLoginResp

type IsLoginResp struct {
	IsLogin int    `json:"is_login"`
	Result  string `json:"result"`
}

type LimbService

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

func NewLimbService

func NewLimbService(config *common.Configure) *LimbService

func (*LimbService) Start

func (ls *LimbService) Start()

func (*LimbService) Stop

func (ls *LimbService) Stop()

type UserInfo

type UserInfo struct {
	ID        string `json:"wxId"`
	Nickname  string `json:"wxNickName"`
	BigAvatar string `json:"wxBigAvatar"`
	Remark    string `json:"wxRemark"`
}

type WechatClient

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

func NewWechatClient

func NewWechatClient(config *common.Configure) *WechatClient

func (*WechatClient) Dispose

func (c *WechatClient) Dispose() error

func (*WechatClient) ForwardMessage

func (c *WechatClient) ForwardMessage(target string, msgid uint64) error

func (*WechatClient) GetContacts

func (c *WechatClient) GetContacts() ([][5]string, error)

func (*WechatClient) GetFriendList

func (c *WechatClient) GetFriendList() ([]*UserInfo, error)

func (*WechatClient) GetGroupInfo

func (c *WechatClient) GetGroupInfo(wxid string) (*GroupInfo, error)

func (*WechatClient) GetGroupList

func (c *WechatClient) GetGroupList() ([]*GroupInfo, error)

func (*WechatClient) GetGroupMemberNickname

func (c *WechatClient) GetGroupMemberNickname(group, wxid string) (string, error)

func (*WechatClient) GetGroupMembers

func (c *WechatClient) GetGroupMembers(wxid string) ([]string, error)

func (*WechatClient) GetOpenIMContacts

func (c *WechatClient) GetOpenIMContacts() ([][5]string, error)

func (*WechatClient) GetSelf

func (c *WechatClient) GetSelf() (*UserInfo, error)

func (*WechatClient) GetUserInfo

func (c *WechatClient) GetUserInfo(wxid string) (*UserInfo, error)

func (*WechatClient) GetVoice

func (c *WechatClient) GetVoice(msgID uint64) ([]byte, error)

func (*WechatClient) HookMsg

func (c *WechatClient) HookMsg(savePath string) error

func (*WechatClient) IsAlive

func (c *WechatClient) IsAlive() bool

func (*WechatClient) IsLogin

func (c *WechatClient) IsLogin() bool

func (*WechatClient) LoginWtihQRCode

func (c *WechatClient) LoginWtihQRCode() ([]byte, error)

func (*WechatClient) Logout

func (c *WechatClient) Logout() error

func (*WechatClient) SendAtText

func (c *WechatClient) SendAtText(target string, content string, mentions []string) error

func (*WechatClient) SendFile

func (c *WechatClient) SendFile(target string, path string) error

func (*WechatClient) SendImage

func (c *WechatClient) SendImage(target string, path string) error

func (*WechatClient) SendText

func (c *WechatClient) SendText(target string, content string) error

func (*WechatClient) SetVersion

func (c *WechatClient) SetVersion(version string) error

type WechatMessage

type WechatMessage struct {
	PID           int    `json:"pid"`
	MsgID         uint64 `json:"msgid"`
	Time          string `json:"time"`
	Timestamp     int64  `json:"timestamp"`
	WxID          string `json:"wxid"`
	Sender        string `json:"sender"`
	Self          string `json:"self"`
	IsSendMsg     int8   `json:"isSendMsg"`
	IsSendByPhone int8   `json:"isSendByPhone"`
	MsgType       int    `json:"type"`
	Message       string `json:"message"`
	FilePath      string `json:"filepath"`
	Thumbnail     string `json:"thumb_path"`
	ExtraInfo     string `json:"extrainfo"`
}

Jump to

Keyboard shortcuts

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