The installation

Environmental requirements

  • PHP > = 7.0
  • PHP FileInfo is needed to extend the stored file
  • PHP GD extension console displays qr code
  • PHP system command Expansion Run the clear command
  • PHP SimpleXML extends parsing XML

The installation

Make sure you already know how to use Composer!

The language of wechat account must be set to simplified Chinese!! Otherwise unknown errors may occur!

1, the git

git clone https://github.com/HanSon/vbot.git
cd vbot
composer install
Copy the code

2, composer,

composer require hanson/vbot
Copy the code

run

The normal operation

php example/index.php

Run with the session

php example/index.php --session yoursession

About the session:

Running with session will automatically search for cookies specified in setting session. If there is no cookies, create a new folder and locate it in/TMP /session. When the code is modified next time, automatic login without scanning will be performed.

If not, Vbot will automatically set a session value of 6 characters, and you can directly set this value for scan login next time.

PS: After running, the QR code will be saved in the cache directory set, named qr.png. The console will also display the QR code and scan it. (For Linux users, please make sure ANSI COLOR is turned on.)

Warning! Check before executing the commandindex.phpComment out code that you don’t think is needed to avoid annoying other people’s friends

Please run in terminal! Please run in terminal! Please run in terminal!

The directory structure

  • vbot
    • Demo (vBOT currently running code, also welcome to provide some of their own practical examples)
    • Example (a more elementary example)
    • SRC (source) -tmp (assuming the cache directory is set here)
      • session
        • Hanson (Set a valuephp index.php --session hanson)
        • 523EB1 (random value)
      • users
        • 23534234345 (UIN value of wechat account)
          • (File)
          • GIF (emoji)
          • JPG (image)
          • Mp3 (Voice)
          • Mp4 (Video)
          • Contact. json (exists in contact debug mode)
          • Json (exists in group debug mode)
          • Json (all members of all groups exist in debug mode)
          • Official. Json (in debug mode)
          • Json (exists in debug mode with special accounts)
          • Message. json (message)

experience

After scanning code, verification input “mountain tiger” can be automatically added as friends and pulled into the VBOT group.

Vbot does not run 24 hours a day, sometimes it is suspended for development and debugging reasons. If you happen to be closed, add Q group 492548647 for opening hours. Send “Pull me” to automatically invite into the group.

Vbot example source github.com/HanSon/vbot…

The document

Detailed documentation is available in the wiki

Small DEMO

Vbot instance

Semi-automatic processing of book purchase

A red envelope to remind

Bomb messages to a group name

forward

Custom processor

A key New Year

Chat operation

The basic use

// The Turing API automatically responds require_once __DIR__. '. /vendor/autoload.php'; use Hanson\Vbot\Foundation\Vbot; use Hanson\Vbot\Message\Entity\Message; use Hanson\Vbot\Message\Entity\Text; $robot = new Vbot(['user_path' => '/path/to/ TMP /', # to generate login QR code and save file 'debug' => true # to output user group JSON]); $robot->server->setMessageHandler(function($message){if ($message instanceof Text) {** @var $message Text */ If ($message->fromType === 'Contact') {return 'hello vbot'; } elseIf ($message->fromType === 'Group' && $message->isAt) {return 'hello everyone'; }}}); $robot->server->run();Copy the code

to do list

Vbot has been implemented and the list of functions to be implemented click to view

Refer to the project

lbbniu/WebWechat

littlecodersh/ItChat

Thank you for your patience with the two writers upstairs

Liuwons /wxBot references the entire wechat login process and message processing

contributors

The rankings are in no particular order, chronological order

Zhuanxuhit terminal Displays the QR code

Littlecodersh loads the number of friends scheme in batches

Yuanshi2016 loads the number of friends scheme, login domain name scheme and test in different times

Q&A

Frequently asked Questions click to view

Make an issue if you have a question or a suggestion

Or join vBOT’s QQ group: 492548647

Donate list

The development of VBOT cannot be separated from your support. Whether it is Star or Donate, I sincerely thank you and will do my best to make VBOT the best.

Donate List (ranked in reverse chronological order)

donors The amount of
xingchenboy RMB 28.80
anonymous RMB 6.66
Cabbage net RMB 16.88
BEIBEI123 RMB 28.88
Steven Lei RMB 88
9688 RMB 8.88
kisexu RMB 88
An anonymous senior RMB 181.80
summerAnd this is a semi-automatic book purchase process with VBOTLaravel Primer (recommended) RMB 66.66
A dream RMB 18.88 * 4
toby2016 RMB 5

Please note your Github account or other links when tipping, thanks for your support!