Procházet zdrojové kódy

add README, modify package.json and LICENSE

Mike L před 3 roky
rodič
revize
bb66d36779
3 změnil soubory, kde provedl 52 přidání a 7 odebrání
  1. 2 1
      LICENSE
  2. 44 0
      README.md
  3. 6 6
      package.json

+ 2 - 1
LICENSE

@@ -1,7 +1,8 @@
 Copyright 2018 梨子
+Copyright 2020 CL_Jeremy
 
 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 
 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
+THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

+ 44 - 0
README.md

@@ -0,0 +1,44 @@
+# Mirai Twitter Bot
+
+修改自:[rikakomoe/cqhttp-twitter-bot](https://github.com/rikakomoe/cqhttp-twitter-bot)
+
+使用 API:[YunYouJun/mirai-ts](https://github.com/YunYouJun/mirai-ts)
+
+## 主要区别
+
+- 去除了 Redis,发送的图片会在本地缓存(请视情况删除)
+- 图片使用 [sharp](https://github.com/lovell/sharp) 压缩为 JPEG
+- 机器人的 QQ 号码必须手动填写
+
+## 配置
+
+它会从命令传入的 JSON 配置文件里读取配置,配置说明如下
+
+| 配置项 | 说明 | 默认 |
+| --- | --- | --- |
+| mirai_access_token | Mirai HTTP API authKey(需保持和插件一致,插件在未配置对应<br />项目时会在 console 给出当前设定值,请将该值填在此处) | (必填) |
+| mirai_http_host | Mirai HTTP API 插件服务端地址 | 127.0.0.1 |
+| mirai_http_port | Mirai HTTP API 插件服务端口 | 8080 |
+| mirai_http_base_dir | Mirai HTTP API 插件起始目录,图片会保存到此目录下的 /images <br />文件夹中。默认设定认为用户已将本应用安装到同一目录下 | .(本应用的工作目录) |
+| mirai_bot_qq | Mirai HTTP API 登录的目标机器人 QQ 号 | 10000(示例值,必填) |
+| twitter_consumer_key | Twitter App consumer_key | (必填) |
+| twitter_consumer_secret |  Twitter App consumer_secret | (必填) |
+| twitter_access_token_key | Twitter App access_token_key | (必填) |
+| twitter_access_token_secret | Twitter App access_token_secret | (必填) |
+| mode | 工作模式,0 为图文模式,1 为纯文本模式,2 为文本附图模式 | 0 |
+| work_interval | 对单个订阅两次拉取更新的最少间隔时间(秒) | 60 |
+| webshot_delay | 抓取网页截图时等待网页加载的延迟时长(毫秒) | 5000 |
+| lockfile | 本地保存订阅信息以便下次启动时恢复 | subscriber.lock |
+| loglevel | 日志调试等级 | info |
+
+示例文件在 [`config.example.json`](./config.example.json)
+
+## Bug
+
+- 原项目的列表订阅功能已失效
+- 好友消息的图片有可能会失效或直接无法接收(后者会被转换为 `[失败的图片:<地址>]` 格式,然后整条消息会以纯文本模式重发)
+
+## Todo
+
+- 重新实现基于 hash 的文件缓存,设定自动清理陈旧图片
+- 添加选项对时间线进行过滤

+ 6 - 6
package.json

@@ -1,14 +1,14 @@
 {
   "name": "cqhttp-twitter-bot",
-  "version": "1.2.5",
-  "description": "CQHTTP Twitter Bot",
+  "version": "0.1",
+  "description": "Mirai Twitter Bot",
   "main": "./dist/main.js",
   "bin": {
-    "cqhttp-twitter-bot": "./dist/main.js"
+    "mirai-twitter-bot": "./dist/main.js"
   },
   "repository": {
     "type": "git",
-    "url": "git+https://github.com/rikakomoe/cqhttp-twitter-bot.git"
+    "url": "git+https://github.com/CL-Jeremy/mirai-twitter-bot.git"
   },
   "keywords": [
     "cq",
@@ -20,9 +20,9 @@
   "author": "Riko",
   "license": "MIT",
   "bugs": {
-    "url": "https://github.com/rikakomoe/cqhttp-twitter-bot/issues"
+    "url": "https://github.com/CL-Jeremy/mirai-twitter-bot/issues"
   },
-  "homepage": "https://github.com/rikakomoe/cqhttp-twitter-bot",
+  "homepage": "https://github.com/CL-Jeremy/mirai-twitter-bot",
   "scripts": {
     "build": "rm -rf dist && tsc --outDir dist",
     "lint": "tslint --fix -c tslint.json --project ./"