Dig friends navigation station: itnet-iite.cn

Open source: github.com/isnl/wechat…

preface

Some time ago, I wrote an article about the implementation of wechat robot using NodeJS and wechaty library:

Juejin. Cn/post / 684490…

However, there are many friends who are limited by the web protocol of wechat login, can not experience the fun of robot development.

Hence this article about using the iPad protocol.

Let’s talk about Wechaty

Introduction of Kangkang official website

Wechaty is an open source wechat robot interface built with Typescript for Node.js applications. Support a variety of wechat access solutions, including web, iPad, ios, Windows, Android, etc. Supports Linux, Windows, Darwin(OSX/Mac) and Docker.

More features include:

  • Message processing: Keyword reply
  • Group management: automatically join the group, pull people, kick people
  • Automatically process friend requests
  • Intelligent dialogue: Through simple configuration, you can join the intelligent dialogue system to complete the specified tasks… Use your own imagination

It is said that wechaty only needs six lines of code to build a wechat robot function, which is used to automatically manage wechat messages.

In the last article, we used the Web protocol, and most of our friends cannot log in on the wechat Web terminal. To verify whether the login is restricted by the Web protocol, you can open wx.qq.com and scan the code to check.

Can not log in the web version of wechat, can not use it! ??

The answer is no! Wechaty has developed protocols based on the iPad and ios in addition to the Web protocol.

But!!!!!!

Non-web protocol is charged!

How much do you charge? It says $200 a month and will issue you a Token valid for one month, after which you can happily use this Token to build your robot using the non-Web version protocol.

Well, then someone said, you said it was bullshit.

There’s only one word on my body.


What can’T I do with 200 a month? Wouldn’t it taste good to buy a spare rib?

Don’t worry, just listen to the old man take his time.

Ribs to eat, robots can write.

How do I get free tokens

The official documentation provides a way to obtain free tokens. Github.com/juzibot/Wel…

They say:

We provide a free access using iPad protocol for the developers who have a strong will and ability to build a valuable chatbot for users.

We can offer free access to the iPad protocol for developers who have a strong desire and ability to build valuable chatbots for their users

See? That’s the power we as programmers have to fight for our users.


Any developers can add JuziBOT Inc’s staff ( Wechat number : botorange_yeah ) as a Wechat friend. You will receive a review form after adding. If you pass the review and willing to Write a blog in Wechaty, you can use our iPad Protocol for Free!

If you add Botorange_yeah as a friend on wechat and fill out a review form, you will be given a Token for 15 days.

After 15 days, a Github repository of MVP (minimum Viable Product) needs to be submitted, and they will fork into the wechaty community and give you a long term free Token.

Apply for Token

Then you add friends and get tokens.

Clone repository code github.com/isnl/wechat…

Is the installation dependent required?

npm install
Copy the code

Listen to me, if NPM can’t install, let’s switch to CNPM, ok?

Aunt Wang next door said to point a star, rely on the thief will install fast.

The directory structure

  • configFolder to store common configuration files as wellsuperagentRequest configuration
  • imgsStore related pictures
  • listenersStore a series of event processing after robot initialization (module)
    • on-friendship.jsHandling friend Requests
    • on-login.jsHandle the login
    • on-message.jsProcess user messages and group messages
    • on-scan.jsProcessing login QR code
  • scheduleYes Scheduled tasknode-scheduleThe library is encapsulated
  • superagentAll data requests and interface encapsulation are stored here
  • utilsEncapsulation of common methods
  • app.jsEntrance to the file

How to use

  1. Open the config/index.js file and change the configuration in it to your own.

  2. Tianaprise API official website: Tianaprise AFTER successful registration, apply for the following interfaces:

    • A: What’s wrong with you?
    • God replies

    After registration, please open superagent/index.js and change the top APIKEY to the key of your own skyline API

Other free interface can be applied for at will, do not want to use the interface can delete the corresponding keywords.

emmm…

Then it’s ready to run

npm start
Copy the code

The terminal will appear a TWO-DIMENSIONAL code, scan the code to log in.

See the effect

Realized function

  • Send add group keyword, automatically pull people into the group.
  • Tainted chicken soup
  • God replies
  • One Word in English
  • Case conversion
  • RGB interturns with hexadecimal colors
  • The weather query
  • Real-time data on COVID-19 by province
  • Send keywords, kick people

List a few interesting features that can be referenced for implementation:

  • Express query
  • Random picture of a girl
  • Send real-time hot search news to the designated group/designated wechat at 9:00 am every day
  • Group chat invitation statistics (business)
  • Collect JINGdong Alliance coupon group news, transfer chain sent to their promotion of the group (business)……
  1. There you go. Click itpraiseBe supportive.
  2. Follow public accountFront end candy houseLearn ducks from each other.
  3. Add little assistant wechatitRobot, pull you inTechnical exchange groupTalk about life.