{"id":27037113,"url":"https://github.com/isboyjc/wechaty-room-remove","last_synced_at":"2025-04-05T01:16:29.418Z","repository":{"id":65472307,"uuid":"276358169","full_name":"isboyjc/wechaty-room-remove","owner":"isboyjc","description":"Quick automatic removal from group chat","archived":false,"fork":false,"pushed_at":"2020-07-01T14:26:59.000Z","size":7,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-14T22:48:19.111Z","etag":null,"topics":["room-remove","wechaty","wechaty-plugin"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/isboyjc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2020-07-01T11:21:38.000Z","updated_at":"2023-02-07T14:45:39.000Z","dependencies_parsed_at":"2023-01-25T01:45:23.156Z","dependency_job_id":null,"html_url":"https://github.com/isboyjc/wechaty-room-remove","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isboyjc%2Fwechaty-room-remove","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isboyjc%2Fwechaty-room-remove/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isboyjc%2Fwechaty-room-remove/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/isboyjc%2Fwechaty-room-remove/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/isboyjc","download_url":"https://codeload.github.com/isboyjc/wechaty-room-remove/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247271505,"owners_count":20911587,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["room-remove","wechaty","wechaty-plugin"],"created_at":"2025-04-05T01:16:28.857Z","updated_at":"2025-04-05T01:16:29.412Z","avatar_url":"https://github.com/isboyjc.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# wechaty-room-remove\n\n[![Wechaty Plugin Contrib](https://img.shields.io/badge/Wechaty%20Plugin-wechaty--room--remove-brightgreen.svg)](https://github.com/isboyjc/wechaty-room-remove) [![Powered by Wechaty](https://img.shields.io/badge/Powered%20By-Wechaty-brightgreen.svg)](https://github.com/Wechaty/wechaty)\n\nQuick automatic removal from group chat\n\n快捷自动移出群聊\n\n## 开始\n\n### 简介\n\n你可以在群聊中@一个违规的人并携带你所设置的关键字，机器人监听到后会帮你快捷的移除他并且给出提示，这比手动删除群聊中某一个人要方便的多\n\n### 安装\n\n```txt\nnpm install wechaty-room-remove\n\nor\n\nyarn add wechaty-room-remove\n```\n\n### 使用\n\n```js\nconst WechatyRoomRemove = require(\"wechaty-room-remove\")\n\nbot.use(WechatyRoomRemove(options))\n```\n\n如上所示\n\n使用插件只要按需传入配置对象 `options` 即可\n\n| Options 参数属性 | 类型          | 简介                                                         |\n| ---------------- | ------------- | ------------------------------------------------------------ |\n| keyword          | String\\|Array | 触发移除该用户的关键字，只有一个可以使用字符串类型，多个关键字使用数组类型，默认为 [\"飞机\", \"踢\"] |\n| time             | Number         | 触发移除后的延时/ms，默认3000，即3s |\n| adminList            | Array        | 可触发命令的管理员列表，一个数组对象，单个数组对象属性请看下面配置示例 |\n| replyInfo | String\\|Function | 移除前@提示该用户的一句话，可为字符串类型，也可以是函数类型，函数类型时，有一个参数msg，即当前消息实例，函数最终需返回一个字符串function(msg){return ...}，此项有默认值，请看下文示例 |\n| replyDone | String | 移除成功提示，字符串类型，默认成功时返回done |\n| replyNoPermission | String | 无权限移除成员时机器人的回复，即当一个不在adminList配置中的用户发出命令时回复，默认不做出回复 |\n\n我们来看 `adminList` 数组的配置示例\n\n```js\nadminList: [\n  {\n    // 管理员昵称，用以区分，可选\n    name: \"isboyjc\",\n    // 管理员id，必填\n    id: \"wxid_nrsh4yc8yupm22\",\n  },\n  {\n    name: \"工具人小杨\",\n    id: \"wxid_vkovzba0b0c212\",\n  },\n  ...\n]\n```\n\n### 示例\n\n```js\nconst { Wechaty } = require(\"wechaty\")\nconst { PuppetPadplus } = require(\"wechaty-puppet-padplus\")\nconst Qrterminal = require(\"qrcode-terminal\")\n// 插件 WechatyRoomWelcome\nconst WechatyRoomWelcome = require(\"../index\")\n\n// 初始化 bot\nconst bot = new Wechaty({\n  puppet: new PuppetPadplus({\n    // 机器人padplus协议token\n    token: PUPPET_PADPLUS_TOKEN,\n  }),\n  // 机器人名字\n  name: ROBOT_NAME,\n})\n\nconst options = {\n  // 触发关键字数组\n  keyword: [\"飞机\", \"踢\", \"慢走\", \"不送\"],\n  // 管理员列表\n  adminList: [\n    {\n      name: \"isboyjc\",\n      id: \"wxid_nrsh4yc8yupm22\",\n    },\n    {\n      name: \"工具人小杨\",\n      id: \"wxid_vkovzba0b0c212\",\n    },\n    {\n      name: \"便便\",\n      id: \"wxid_4mnet5yeqo5d21\",\n    },\n  ],\n  // 延时\n  time: 3000,\n  // 移除前提示，以下配置是默认配置，这里用来展示函数类型配置\n  // 可根据函数回调中msg消息实例参数自由发挥，也可直接填写一段字符串\n  replyInfo: function (msg) {\n    return `您可能违反了社群规则，并收到举报，${this.time / 1000}s后将您移出群聊，如有问题请联系管理！！！🚀\\n\\n移除原因：违反社群规则\\n操作时间：${dateTimeFormat()}\\n操作管理员：${msg.from().name()}\\n\\nYou may have violated the community rules and received a report. After ${this.time / 1000}S, you will be removed from the group chat. If you have any questions, please contact the management！！！🚀\\n\\nReason for removal：Violation of community rules\\nOperation time：${dateTimeFormat()}\\nOperation administrator：${msg.from().name()}`\n  },\n  // 移除成功后提示\n  replyDone: \"移除成功\",\n  // 无权限人员触发命令后回复，可选项，默认不进行回复\n  replyNoPermission: \"您暂时没有权限哦，联系管理员吧😊\",\n}\n\n// 使用插件\nbot.use(WechatyRoomRemove(options))\n\nbot\n  .on(\"scan\", (qrcode, status) =\u003e {\n    Qrterminal.generate(qrcode, { small: true })\n  })\n  .start()\n\n/**\n * @description 日期时间转格式\n * @param {Object} date 时间，非必选，默认当前时间\n * @return {String}\n */\nfunction dateTimeFormat(date = new Date()) {\n  ...\n}\n```\n\n\n\n### 最后\n\n扫描二维码，加圈子微信，可进交流群哦，效果如下图，赶快来试试吧\n\n\u003cimg src=\"https://gitee.com/IsboyJC/PictureBed/raw/master/other/asdakshdajshdas1.jpeg\" width=\"200\" height=\"200\" alt=\"图片名称\" align=left /\u003e\n\n\u003cdiv\u003e\n\u003cimg src=\"https://gitee.com/IsboyJC/PictureBed/raw/master/other/image-20200701221539434.png\" width=\"200\" height=\"420\"  alt=\"图片名称\" align=left /\u003e\n\u003cimg src=\"https://gitee.com/IsboyJC/PictureBed/raw/master/other/image-20200701221855779.png\" width=\"200\" height=\"420\"  alt=\"图片名称\" align=left /\u003e\n\u003c/div\u003e\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisboyjc%2Fwechaty-room-remove","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fisboyjc%2Fwechaty-room-remove","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fisboyjc%2Fwechaty-room-remove/lists"}