GithubHelp home page GithubHelp logo

goqqbot's Introduction

This is a client of the smart-web-qq in the Go programming language.

Installation

go get github.com/MrToy/qqbot/examples
cd $GOPATH/github.com/MrToy/qqbot/examples
go build robot.go

or directly

go run robot.go

Usage

  • This is how to get friends list
import "github.com/MrToy/qqbot"
...
user := qqbot.NewUser()
qqbot.WebHandler(user.WaitVerify())
user.Login()
fmt.Println(user.GetFriends())
...

start qqbot and open http://loacalhost:8081/captcha ,then use mobile qq scan this captcha

  • This is how to login with cache
import "github.com/MrToy/qqbot"
...
store := qqbot.NewUserStore("./user")
defer store.DB.Close()
user := store.Get()
if err := user.Login(); err != nil {
	qqbot.WebHandler(user.WaitVerify())
	user.Login()
}
store.Put(user)
fmt.Println(user.GetFriends())
...
  • Message Get and Send 【you must be logined】
...
user.SendMessage(uin,"some text")
...
for msg := range user.Poll() {
   fmt.Println(msg)
}
...

And You can use "图灵机器人" API for reduce the message

qqbot.Tulin(uin int64,msg string, key string) string
//This uin is a tag who speaked
//This key you can get by 图灵机器人's website

More usage examples please view https://github.com/MrToy/qqbot/examples

Documentation

You can read APIs in package documentation here https://godoc.org/github.com/MrToy/qqbot

goqqbot's People

Contributors

mrtoy avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.