# wechaty-friend-pass

> Wechat friend application passes automatically

Latest version **0.0.2** (published 2020-06-14) · ISC license · 0 weekly downloads

## Install

```sh
npm install wechaty-friend-pass
pnpm add wechaty-friend-pass
yarn add wechaty-friend-pass
bun add wechaty-friend-pass
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.2 |
| Published | 2020-06-14 |
| First published | 2020-06-13 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 3 |
| Unpacked size | 6.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | isboyjc |
| Maintainers | isboyjc |
| Keywords | wechaty, wechaty plugin, wechaty-friend-pass, wechaty-friendPass, WechatyFriendPass |

## Links

- npm: https://www.npmjs.com/package/wechaty-friend-pass
- Repository: https://github.com/isboyjc/wechaty-friend-pass
- Homepage: https://github.com/isboyjc/wechaty-friend-pass#readme
- Issues: https://github.com/isboyjc/wechaty-friend-pass/issues
- npm.io page: https://npm.io/package/wechaty-friend-pass

## Dependencies (3)

- [wechaty](https://npm.io/package/wechaty.md) 0.39.30
- [qrcode-terminal](https://npm.io/package/qrcode-terminal.md) ^0.12.0
- [wechaty-puppet-padplus](https://npm.io/package/wechaty-puppet-padplus.md) 0.7.15

## Recent versions

- 0.0.2 (latest) — 2020-06-14
- 0.0.1 — 2020-06-13

## README

# wechaty-friend-pass

[![Wechaty Plugin Contrib](https://img.shields.io/badge/Wechaty%20Plugin-wechaty--friend--pass-brightgreen.svg)](https://github.com/isboyjc/wechaty-friend-pass) [![Powered by Wechaty](https://img.shields.io/badge/Powered%20By-Wechaty-brightgreen.svg)](https://github.com/Wechaty/wechaty)

Wechat friend application passes automatically

微信好友申请自动通过

## 开始

### 简介

你是否想要自己的微信机器人自动通过好友请求，或者设置一些关键字，通过好友申请时备注的关键字来校验是否要自动通过该好友申请，并且通过好友申请时自动回复一段话

如果是的话，那么你可以使用这个插件，虽然是一个很简单的功能但是使用 `plugin` 可以使我们的代码更简洁

到这里它的功能你应该了解了，那么我们来看看它如何使用

### 安装

```txt
npm install wechaty-friend-pass

or

yarn add wechaty-friend-pass
```

### 使用

```js
const WechatyFriendPass = require("wechaty-friend-pass")

bot.use(WechatyFriendPass(options))
```

如上所示

使用插件只要按需传入配置对象 `options` 即可

| Options 参数属性 | 类型          | 简介                                                                                                                                         |
| ---------------- | ------------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| keyword          | String\|Array | 好友请求时备注自动通过的关键字，只有一个可以使用字符串类型，多个关键字使用数组类型，全部通过不用校验传入字符串 "\*" 即可，不传即都不自动通过 |
| blackId          | String\|Array | 用户黑名单 ID，该项可填写用户的 ID 来识别用户，让此用户不被自动通过，也可不填                                                                |
| reply            | String        | 自动通过用户好友申请后自动回复一句话，为空或不填则通过后不回复                                                                               |

### 示例

```js
const { Wechaty } = require("wechaty")
const { PuppetPadplus } = require("wechaty-puppet-padplus")
const Qrterminal = require("qrcode-terminal")
// 引入插件 WechatyFriendPass
const WechatyFriendPass = require("wechaty-friend-pass")

// 初始化 bot
const bot = new Wechaty({
  puppet: new PuppetPadplus({
    token: PUPPET_PADPLUS_TOKEN,
  }),
  name: ROBOT_NAME,
})

// 插件配置对象
const options = {
  keyword: ["加群", "前端", "后端", "全栈"],
  blackId: ["*******", "*******"],
  reply:
    "你好，我是机器人小助手圈子 \n 加入技术交流群请回复【加群】\n 联系小主请回复【123】",
}

// 使用插件
bot.use(WechatyFriendPass(options))

bot
  .on("scan", (qrcode, status) => {
    Qrterminal.generate(qrcode, { small: true })
  })
  .start()
```

### 最后

扫描二维码，加圈子微信，进交流群哦，效果如下图，赶快来试试吧

<img src="https://gitee.com/IsboyJC/PictureBed/raw/master/other/asdakshdajshdas1.jpeg" width="200" height="200" alt="图片名称" align=left />

<div style="left">
<img src="https://gitee.com/IsboyJC/PictureBed/raw/master/other/image-20200613231806371.png" width="200" height="420"  alt="图片名称" align=left />
<img src="https://gitee.com/IsboyJC/PictureBed/raw/master/other/image-20200613231757054.png" width="200" height="420"  alt="图片名称" align=right/>
</div>

---
_Source: https://npm.io/package/wechaty-friend-pass · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
