wechatbot

package module
v0.0.0-...-7e5cd25 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2018 License: Apache-2.0 Imports: 23 Imported by: 0

README

wechatbot

基于golang的微信机器人

#目前已实现功能
1.扫码登录微信
2.获取所有联系人
3.数据接收
4.发送文本内容
5.发送文件内容
6.保存登录状态
7.加载登录状态

#例子

demo.go
里已基本完成了各种功能的应用

Documentation

Index

Constants

This section is empty.

Variables

View Source
var NickName, UserName string
View Source
var SKey, Sid, Uin, DeviceID, PassTicket string
View Source
var SaveFileName string = "wx.data"
View Source
var SyncKey gjson.Result
View Source
var UserNameToNickName map[string]string

Functions

func CheckLogin

func CheckLogin(UUID string) bool

func CookieDataTicket

func CookieDataTicket() string

func GetAllContact

func GetAllContact() string

func GetQrcode

func GetQrcode(UUID string, QrcodeStr *string) bool

func GetRandomString

func GetRandomString(index int, length int) string

func GetUUID

func GetUUID() (UUID string)

func InviteMember

func InviteMember(memberUserName string, chatRoomUserName string)

func IsLogin

func IsLogin() bool

func JSONMarshal

func JSONMarshal(t interface{}) (string, error)

func LoadLogin

func LoadLogin() bool

func NotifyStatus

func NotifyStatus() bool

func SaveLogin

func SaveLogin()

func SendFileMsg

func SendFileMsg(filepath, to string) error

func SendMsg

func SendMsg(con map[string]interface{})

func SendMsgEmoticon

func SendMsgEmoticon(con map[string]interface{})

func SendMsgFile

func SendMsgFile(con map[string]interface{})

func SendMsgImage

func SendMsgImage(con map[string]interface{})

func SendMsgVideo

func SendMsgVideo(con map[string]interface{})

func SendTextMsg

func SendTextMsg(content, to string) error

func SetRemark

func SetRemark(remark, to string) (bool, error)

func SyncCheck

func SyncCheck() (retcode, selector int)

func SyncKeyToJson

func SyncKeyToJson(S gjson.Result) string

func SyncKeyToString

func SyncKeyToString(S gjson.Result) string

func UploadMedia

func UploadMedia(buf []byte, kind types.Type, info os.FileInfo, to string) (string, error)

func WebWxSync

func WebWxSync() gjson.Result

Types

type BaseRequest

type BaseRequest struct {
	Uin      int
	Sid      string
	SKey     string
	DeviceID string
}

func GetBaseRequestStr

func GetBaseRequestStr() BaseRequest

type ContactList

type ContactList struct {
	MemberCount int    `json:"MemberCount"`
	MemberList  []User `json:"MemberList"`
}
var Contact ContactList

type LoginXML

type LoginXML struct {
	XMLName     xml.Name `xml:"error"` /* 根节点定义 */
	Ret         string   `xml:"ret"`
	Message     string   `xml:"message"`
	SKey        string   `xml:"skey"`
	WXSid       string   `xml:"wxsid"`
	WXUin       string   `xml:"wxuin"`
	PassTicket  string   `xml:"pass_ticket"`
	IsGrayscale string   `xml:"isgrayscale"`
}

type User

type User struct {
	Uin        int64  `json:"Uin"`
	UserName   string `json:"UserName"`
	NickName   string `json:"NickName"`
	RemarkName string `json:"RemarkName"`
	Sex        int8   `json:"Sex"`
	Province   string `json:"Province"`
	City       string `json:"City"`
}

type UserInfoModel

type UserInfoModel struct {
	Name      string
	Pic       string
	LastLogin string
}
var UserInfo UserInfoModel

Jump to

Keyboard shortcuts

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