Giter VIP home page Giter VIP logo

wecab's Introduction

Wecab

Web Content Aggregation Bot 网络内容聚合机器人

最好的综合型订阅制机器人

前身是给CQ-picfinder-robot做的小挂件(已完全脱离)
如果有bug请复制pm2log中的错误信息并提交issus,我会尽快解决(可能) 觉得好用不妨点个Star谢谢

Wiki
更新日志

特色

  1. 所有不需要申请任何api,包括微博,B站,Twitter,翻译,即插即用
  2. 群组分离,互不干扰

注意!!!
近期会支持嵌入式数据库如果不想用MongoDB的人可以等一阵子(可能你们得等久点了...)

目前需要安装MongoDB,没装的参考官方教程https://docs.mongodb.com/manual/installation/ ,端口是默认端口不要改,然后使用mongorestore将dump文件夹中的东西恢复到mongodb中,这样才能使用小游戏功能,当然如果不用的话也可以,删除main中所有pokemon相关的语句就行

部件列表

正在缓慢更新中
TODO:

  1. Pixiv订阅
  2. 接入RSSHub
  3. 从MongoDB换到SQLite或者LevelDB

1. 看微博,B站,Twitter动态

用 “看看谁谁上条微博/B站/Twitter/推特”,谁谁是要看的人的名字,上条可以改,可以要求看置顶,上条,上上条,上上上条.....,也可以直接写第x条,x范围是0~9
反微博小程序,会自动把微博小程序内容给抓出来,造福PC用户
也可以用 看看 url,url为单条微博/B站/Twitter的网址,在app里,选分享链接就好,支持b23短链接

2. 订阅微博,B博,Twitter

每当有新内容时会转发到群内

3. 教说话

教bot对任意关键词做出反应 精确/模糊/正则

4. 教复读

教bot复读任意语句 精确/模糊/正则

5. Pixiv看图

看看p站后接p站图片id或者包含id的url,如果该id有多图会自动合并发送,最多同时发送9张

6. 翻译

翻译> 后接需要翻译的外语句子,自动识别语言并翻译成中文
中译x> x为目标语言,可以是日韩英法德俄,后接中文,会翻译为目标语言
目前使用腾讯翻译

7. 骰子

可以扔出任意面数(<1000),任意个数(<10)的骰子,可以指定最小值,自动统计总分
用法的话,参考
.dice6 扔一个D6
.dice8x5 扔5个D8
.dice16,10 扔1个最低为10的D16
.dice20x3,10 扔3个最低为10的D20

8.简单直接宝可梦

注意!!! 使用前必须先将下载dump然后用mongorestore存进mongoDB
一个极度简化版的群内对战游戏

wecab's People

Contributors

ninzore avatar shitianshiwa avatar

Stargazers

 avatar  avatar  avatar Qinglong Wang avatar  avatar 芸婉佳 avatar  avatar  avatar himawari avatar ding avatar Hugo avatar  avatar Keven Fesperman avatar  avatar  avatar  avatar Maika avatar すずはらるる avatar  avatar  avatar  avatar  avatar  avatar Jiyuan Liu avatar  avatar  avatar  avatar  avatar lazyfier avatar  avatar WDN avatar ClaireLind avatar Sparidae avatar  avatar  avatar Harry Chen avatar zeR0 avatar 辉枪233 avatar 月泪同学 avatar dtlnor avatar chemcat avatar 寂听 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar DaoLuoLTS avatar Jesse Zhao avatar NanaNana avatar Yuan.eio avatar  avatar  avatar memberjoho avatar  avatar ChillWay avatar  avatar  avatar 3.80GHz avatar 空明竹随 avatar 祀画 avatar Pedigree Cat avatar Nolan.Ho avatar  avatar  avatar 謬紗特 avatar Lee Bierbower avatar  avatar jcjrobert avatar  avatar  avatar 羊王杂货铺 avatar utmtl avatar Cateon Huo avatar 天平 avatar  avatar  avatar  avatar  avatar HDeathKnight avatar Fantajī × Neko avatar  avatar  avatar Lee avatar EmiyaGm avatar atdtaigzeng avatar  avatar  avatar WswjzColby avatar Corvo007  avatar YeLi avatar BYEBYESunWukong  avatar Colter avatar  avatar  avatar HP_Zzz avatar 嘿哟 avatar にゃんちゃん avatar

Watchers

fivesix avatar James Cloos avatar  avatar  avatar  avatar  avatar  avatar  avatar

wecab's Issues

[BUG]推特翻译功能无效

描述
推特翻译功能无效

系统信息

  • OS:
  • NodeJS Version:v14.17.0
  • Wecab Version:v1.8.23

复现
在订阅推特的时候选择翻译模式,然后发出来的推特没有翻译内容,只有原内容。

[BUG]使用回忆命令总是返回“从来没学过啊“

描述
使用回忆/想想命令查询教过的话,一直都是返回“从来没学过啊“

系统信息

  • OS: win10 2004
  • NodeJS Version:14.15.1
  • Wecab Version:8c8bf09

复现
image

Error Log
error无报错(最后15行都是推特订阅小于1)

一些反馈建议

1、解析PC端微博链接无效https://weibo.com/5488749285/HAYBHqGJthttps://www.weibo.com/5488749285/HAYBHqGJt
2、go-cqhttpv0.9.25-fix3现在支持发送30MB大小的图片,可以适当放开图片大小限制。
3、b站的api找不到置顶动态信息 https://api.vc.bilibili.com/dynamic_svr/v1/dynamic_svr/space_history
4、发现无法正常解析b站专栏内容
其它补充:gif动图高帧数(至少225张以上),可能无法发送成功,和图片大小无关

function dynamicProcess(dynamic, origin = false) {
    let card = JSON.parse(dynamic.card);
    let text = "";
    let name = "";
    let pics = "";
    let video = "";
    let rt_dynamic = 0;
    let url = "";
    if (origin == false) {
        //logger2.info(dynamic.desc.dynamic_id_str);
        url = "https://t.bilibili.com/" + dynamic.desc.dynamic_id_str.replace(/"/g, "");
    }
    if ("user" in card) {
        if ("uname" in card.user) name = card.user.uname;
        else if ("name" in card.user) name = card.user.name;
    } else if ("author" in card) name = card.author.name;


    //投稿
    if ("videos" in card) {
        name = card.owner.name;
        text = card.dynamic;
        video = "发布视频:\n" + card.title + "\n" + card.desc + "\nhttps://www.bilibili.com/video/" + dynamic.desc.bvid;
    }
    //转发
    if ("origin" in card) {
        let origin = card.origin;
        rt_dynamic = dynamicProcess({
            card: origin
        }, true);
    }
    if ("pic" in card) pics += "[CQ:image,cache=0,file=" + card.pic + "]";
    if ("item" in card) {
        //小视频
        if ("video_playurl" in card.item) {
            video = card.item.video_playurl;
            text = "小视频\n" + card.item.description;
        }
        //通常
        else {
            if ("content" in card.item && card.item.content.length > 0) text = card.item.content;
            else if ("description" in card.item && card.item.description.length > 0) text = card.item.description;
            if ("pictures" in card.item) {
                let pictures = card.item.pictures;
                for (let pic of pictures) pics += "[CQ:image,cache=0,file=" + pic.img_src + "]";
            }
        }
    } else if ("summary" in card) {
        text = "发布文章" + card.title + "\n" + card.summary + "\nhttps://www.bilibili.com/read/cv" + dynamic.desc.rid_str;
        pics += "[CQ:image,cache=0,file=" + card.origin_image_urls[0] + "]";
    }
    //解析CV号专栏
    // logger2.info(name)
    // logger2.info(text)
    let dynamicObj = {
        name: name,
        text: text,
        pics: pics,
        video: video,
        rt_dynamic: rt_dynamic,
        url: url
    };
    return dynamicObj;
}

[建议] [Bug]安装与代理

  1. 是否考虑添加HTTP代理或者SOCKS5代理

解决国内服务器链接Pixiv和Twitter痛处

  1. 安装环境有考虑添加其他安装环境吗?比如 yarn?

windows 2016 server 安装老是卡在node-pre-gyp install, 即使安装完了,也不确定会不会出现奇奇怪怪的问题.

系统环境:Windows 2016 server
其他环境:npm pm2 MongoDB已经安装
pm2 logs Wecab

0|Wecab    | 2020-10-18 10:48:58 ├F10: PM┤ 连接失败[/event]#2
0|Wecab    | 2020-10-18 10:48:58 ├F10: PM┤ 连接失败[/api]#2
0|Wecab    | 2020-10-18 10:49:03 ├F10: PM┤ 连接中[/event]#3
0|Wecab    | 2020-10-18 10:49:03 ├F10: PM┤ 连接中[/api]#3
0|Wecab    | 2020-10-18 10:49:04 ├F10: PM┤ 连接失败[/event]#3
0|Wecab    | 2020-10-18 10:49:04 ├F10: PM┤ 连接失败[/api]#3
0|Wecab    | 2020-10-18 10:49:09 ├F10: PM┤ 连接中[/event]#4
0|Wecab    | 2020-10-18 10:49:09 ├F10: PM┤ 连接中[/api]#4
0|Wecab    | 2020-10-18 10:49:10 ├F10: PM┤ 连接失败[/event]#4
0|Wecab    | 2020-10-18 10:49:10 ├F10: PM┤ 连接失败[/api]#4
0|Wecab    | Twitter无法连接,功能暂停
0|Wecab    | 2020-10-18 10:49:15 ├F10: PM┤ 连接中[/event]#5
0|Wecab    | 2020-10-18 10:49:15 ├F10: PM┤ 连接中[/api]#5
0|Wecab    | 2020-10-18 10:49:15 ├F10: PM┤ 连接成功[/api]#5
0|Wecab    | 2020-10-18 10:49:15 ├F10: PM┤ 连接成功[/event]#5

E:\Wecab-master\logs\error-0.log last 15 lines:
0|Wecab    |   reason: TopologyDescription {
0|Wecab    |     type: 'Single',
0|Wecab    |     setName: null,
0|Wecab    |     maxSetVersion: null,
0|Wecab    |     maxElectionId: null,
0|Wecab    |     servers: Map { '127.0.0.1:27017' => [ServerDescription] },
0|Wecab    |     stale: false,
0|Wecab    |     compatible: true,
0|Wecab    |     compatibilityError: null,
0|Wecab    |     logicalSessionTimeoutMinutes: null,
0|Wecab    |     heartbeatFrequencyMS: 10000,
0|Wecab    |     localThresholdMS: 15,
0|Wecab    |     commonWireVersion: null
0|Wecab    |   }
0|Wecab    | }

0|Wecab  | MongoServerSelectionError: connect ECONNREFUSED 127.0.0.1:27017
0|Wecab  |     at Timeout._onTimeout (E:\Wecab-master\node_modules\mongodb\lib\core\sdam\topology.js:438:30)
0|Wecab  |     at listOnTimeout (internal/timers.js:549:17)
0|Wecab  |     at processTimers (internal/timers.js:492:7) {
0|Wecab  |   reason: TopologyDescription {
0|Wecab  |     type: 'Single',
0|Wecab  |     setName: null,
0|Wecab  |     maxSetVersion: null,
0|Wecab  |     maxElectionId: null,
0|Wecab  |     servers: Map { '127.0.0.1:27017' => [ServerDescription] },
0|Wecab  |     stale: false,
0|Wecab  |     compatible: true,
0|Wecab  |     compatibilityError: null,
0|Wecab  |     logicalSessionTimeoutMinutes: null,
0|Wecab  |     heartbeatFrequencyMS: 10000,
0|Wecab  |     localThresholdMS: 15,
0|Wecab  |     commonWireVersion: null
0|Wecab  |   }
0|Wecab  | }

MongoDB 无法链接?

1.2.2 无法正常开启

提示如下,重装了几次package也不行...但是1.2.1可以正常运行

`> [email protected] start C:\Wecab-master

node index.js

1
file:///C:/Wecab-master/main.js:1
TypeError: _984‍.a(...) is not a constructor
at Object. (file:///C:/Wecab-master/main.js:25:13)
at Generator.next ()
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional log
ging output above.

npm ERR! A complete log of this run can be found in:`

无法订阅Twitter[BUG]

描述
在完成部署后,订阅任意推特无反应,查看日志后发现无返回数据

系统信息

  • OS: WIN10
  • NodeJS Version:14.6
  • Wecab Version:最新master版本

复现
在完成部署后,订阅任意推特无反应

Error Log
You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection:
TypeError: Cannot read property 'data' of undefined
at D:\ChromeCoreDownloads\Wecab-master\Wecab-master\modules\plugin\twitter.js:273:67
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:93:5)
at async addSub (D:\ChromeCoreDownloads\Wecab-master\Wecab-master\modules\plugin\twitter.js:730:16)
You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection:
TypeError: Cannot read property 'data' of undefined
at D:\ChromeCoreDownloads\Wecab-master\Wecab-master\modules\plugin\twitter.js:201:36
at runMicrotasks ()
at processTicksAndRejections (internal/process/task_queues.js:93:5)

[Feature]使用腾讯翻译翻译订阅的b站动态、微博、twitter等

描述
因为bot已经支持腾讯翻译群友对话了,那我觉得还可以加上翻译动态什么的。
比方说“看看谁谁微博”“订阅谁谁微博”变成“看看谁谁微博翻译”“订阅谁谁微博翻译”就可以自动给它们带上翻译,上面外语下面一道分割线然后是中文翻译,b站动态和twitter也可以这样操作。

[BUG]zen插件中的“口他”“放他”指令无效

描述
我是群主,我按照zen.js里的写法即“口他@群友”尝试禁言他人,结果机器人没有反应,放人解除禁言也是一样,但是通过触发关键词禁言的功能仍然正常。

系统信息

  • OS: debian10
  • NodeJS Version:v14.17.0
  • Wecab Version:v1.8.23

复现
操作手法
在群中发“口他@群友名”

启动时报错

file:///opt/Wecab/main.js:1 Error: Cannot find module './modules/plugin/recordMsg' at Object.<anonymous> (file:///opt/Wecab/main.js:1) { code: 'MODULE_NOT_FOUND' }

[BUG] 在Config中填入access_token无法连接

描述
刚刚把Wecab移动到了公网vps上,本不想让我的账号在公网裸奔,所以在gocq中设置好token,发现即使token正确,也会连接失败
本以为可能是路由代理的问题,关闭后仍无法连接,将Wecab搬回内网后仍然无法连接

试了一下cq-picsearcher-bot,填入token后可以连接,应该能排除我gocq的问题www

系统信息

  • OS: Centos7
  • NodeJS Version: 14.16.0
  • Wecab Version: 1.7.31

复现
在gocq中设置token
在Wecab的Config填入对应token

Error Log
Wecab
image

go-cqhttp
image

[BUG]骰子下限位数问题

.dice999,999只能得到最低99的数字:
bug

系统信息

  • OS: Ubuntu 16.04
  • NodeJS Version: v12.18.3
  • Wecab Version: 1.8.25

复现
.dice999,999

启动报错

运行npm run pm2start时报错:
image

go-cqhttp运行没问题:
image

这个是版本导致的错误?

0 info it worked if it ends with ok
1 verbose cli [
1 verbose cli   'C:\\Program Files\\nodejs\\node.exe',
1 verbose cli   'C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js',
1 verbose cli   'start'
1 verbose cli ]
2 info using [email protected]
3 info using [email protected]
4 verbose run-script [ 'prestart', 'start', 'poststart' ]
5 info lifecycle [email protected]~prestart: [email protected]
6 info lifecycle [email protected]~start: [email protected]
7 verbose lifecycle [email protected]~start: unsafe-perm in lifecycle true
8 verbose lifecycle [email protected]~start: PATH: C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\node-gyp-bin;C:\Users\dulou\Desktop\[测试]CQ-icfinder-robot\node_modules\.bin;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Windows\System32\OpenSSH\;C:\Program Files\nodejs\;C:\Users\dulou\AppData\Local\Microsoft\WindowsApps;C:\Users\dulou\AppData\Roaming\npm
9 verbose lifecycle [email protected]~start: CWD: C:\Users\dulou\Desktop\[测试]CQ-icfinder-robot
10 silly lifecycle [email protected]~start: Args: [ '/d /s /c', 'node index.js' ]
11 silly lifecycle [email protected]~start: Returned: code: 1  signal: null
12 info lifecycle [email protected]~start: Failed to exec start script
13 verbose stack Error: [email protected] start: `node index.js`
13 verbose stack Exit status 1
13 verbose stack     at EventEmitter.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\index.js:332:16)
13 verbose stack     at EventEmitter.emit (events.js:311:20)
13 verbose stack     at ChildProcess.<anonymous> (C:\Program Files\nodejs\node_modules\npm\node_modules\npm-lifecycle\lib\spawn.js:55:14)
13 verbose stack     at ChildProcess.emit (events.js:311:20)
13 verbose stack     at maybeClose (internal/child_process.js:1021:16)
13 verbose stack     at Process.ChildProcess._handle.onexit (internal/child_process.js:286:5)
14 verbose pkgid [email protected]
15 verbose cwd C:\Users\dulou\Desktop\[测试]CQ-icfinder-robot
16 verbose Windows_NT 10.0.18363
17 verbose argv "C:\\Program Files\\nodejs\\node.exe" "C:\\Program Files\\nodejs\\node_modules\\npm\\bin\\npm-cli.js" "start"
18 verbose node v12.16.1
19 verbose npm  v6.13.4
20 error code ELIFECYCLE
21 error errno 1

node 10.16.0 也试过安装 也有问题

无法取消订阅,宝可梦正常

玩宝可梦之前没看到有报错,日志不排除是宝可梦带来的

You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection:
Error: connect ETIMEDOUT 203.205.253.140:443
at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1106:14)
You have triggered an unhandledRejection, you may have forgotten to catch a Promise rejection:
MongoError: Cannot use a session that has ended
at applySession (E:\QQBot\Wecab-master\node_modules\mongodb\lib\core\sessions.js:701:12)
at _command (E:\QQBot\Wecab-master\node_modules\mongodb\lib\core\wireprotocol\command.js:58:17)
at command (E:\QQBot\Wecab-master\node_modules\mongodb\lib\core\wireprotocol\command.js:28:5)
at writeCommand (E:\QQBot\Wecab-master\node_modules\mongodb\lib\core\wireprotocol\write_command.js:47:3)
at Object.update (E:\QQBot\Wecab-master\node_modules\mongodb\lib\core\wireprotocol\index.js:9:5)
at Connection.update (E:\QQBot\Wecab-master\node_modules\mongodb\lib\cmap\connection.js:191:8)
at server.s.pool.withConnection (E:\QQBot\Wecab-master\node_modules\mongodb\lib\core\sdam\server.js:483:13)
at Object.checkOut [as callback] (E:\QQBot\Wecab-master\node_modules\mongodb\lib\cmap\connection_pool.js:351:7)
at processWaitQueue (E:\QQBot\Wecab-master\node_modules\mongodb\lib\cmap\connection_pool.js:474:23)
at ConnectionPool.checkIn (E:\QQBot\Wecab-master\node_modules\mongodb\lib\cmap\connection_pool.js:267:5)

微博兼容PC端链接&反微博分享小程序

function weiboAggr(context) {
。。。
else if (/^看看\s?https:\/\/m.weibo.cn\/\d+\/\d+/.test(context.message) || /^看看\s?https:\/\/m.weibo.cn\/status\/\d+/.test(context.message) || /^看看\s?https:\/\/www.weibo.com\/\d+\/[A-Za-z0-9]+/.test(context.message)) { //查看链接内容
        let id = /https:\/\/m\.weibo\.cn\/\d+\/(\d+)/.exec(context.message) || /https:\/\/m\.weibo\.cn\/status\/(\d+)$/.exec(context.message) || /https:\/\/www\.weibo\.com\/\d+\/([A-Za-z0-9]+)/.exec(context.message);
        //https://m.weibo.cn/数字/数字 移动端
        //https://m.weibo.cn/status/数字 移动端
        //https://www.weibo.com/数字/大小写字母+数字 PC端 兼容移动端api返回json
        //console.log(/^看看https:\/\/www\.weibo.com\/\d+\/([A-Za-z0-9]+)$/.test(""));
        //console.log(/https:\/\/www\.weibo\.com\/\d+\/([A-Za-z0-9]+)/.exec("")[1])
        //console.log(/https:\/\/www.weibo.com\/\d+\/[A-Za-z0-9]+/.test(""))
        //console.log(/^看看\s?https:\/\/www.weibo.com\/\d+\/[A-Za-z0-9]+/.test(""))
        console.log(id);
        if (id.length >= 2) {
            console.log(id[1]);
            rtSingleWeibo(id[1], context);
        } else {
            console.log("解析微博链接失败");
        }
        return true;
    }
。。。
}
/*
反微博小程序分享
const url = /<source url="(.+?)"/.exec(CQ.unescape(temp));
console.log(url[0].replace('<source url="', "").replace('"', ""));
const title = /<summary>(.+?)<\/summary>/.exec(CQ.unescape(temp));
console.log(title[0].replace('<summary>', "").replace('</summary>', ""));
const pic = /<picture cover="(.+?)"/.exec(CQ.unescape(temp));
console.log(pic[0].replace('<picture cover="', "").replace('"', ""));
*/
function antiweibo(context) {
    let msg = context.message;
    if (msg.indexOf('CQ:xml') !== -1 && msg.indexOf('微博') !== -1) {
        logger2.info(msg);
        const url = /<source url="(.+?)"/.exec(CQ.unescape(msg))[0].replace('<source url="', "").replace('"', "");
        //logger2.info(url[0].replace('<source url="', "").replace('"', ""));
        const title = /<summary>(.+?)<\/summary>/.exec(CQ.unescape(msg))[0].replace('<summary>', "").replace('</summary>', "");
        //logger2.info(title[0].replace('<summary>', "").replace('</summary>', ""));
        const pic = /<picture cover="(.+?)"/.exec(CQ.unescape(msg))[0].replace('<picture cover="', "").replace('"', "");
        //logger2.info(pic[0].replace('<picture cover="', "").replace('"', ""));
        replyFunc(context, `新浪微博\n封面图:[CQ:image,cache=0,file=${pic}]\n内容${title}\n链接${url}`, true);
    }
}

[BUG]

描述
bot在今天使用git pull&&npm i命令更新后开始报错,无法正常使用(已按照更新日志修改过配置文件和启动命令)

系统信息

  • OS: Ubuntu 20.04
  • NodeJS Version: 10.19.0
  • Wecab Version: 4.15日Master分支最新版

复现
操作手法
bot原来使用的是大概十几天前的版本,今天上午拉取了最新版并使用npm i更新组件,配置文件也按要求更新如下Screenshot_20210415_095135_com.termux_edit_57676588974531.png
其中cqhost指向的是另外一台开放6700端口的服务器,上面运行了go-cqhttp最新版(不太可能是这台服务器的问题,因为使用同样连接方式的cq-picsearch-bot可以正常工作)
npm run start之后管理员账号收到了已上线通知,然后error-0.log中开始不断写入下面的日志,同时无法回应任何消息

Error Log
把pm2log在产生bug时刷新出来的部分贴上来Screenshot_20210415_095114_com.termux.png

[Feature]一些反馈建议

描述
在经过多个大大小小的群聊磨练后有一些建议反馈一下
应用方面:
1. 使用最多的功能是推特的转发,在订阅的人数越来越多后,转发延迟也逐渐增高 (10min+
群友转发已经比Bot快很多了。且因为高延迟的原因,在连续发/转发多个推特后Bot刷屏和风控严重
能不能实现使用推特的API以降低延迟和提高可用性呢www

2. 希望能够实现Admin私聊Bot以增减指定群的订阅列表
在有些群中公开调整订阅挺影响气氛的

3. 在消息滚动快速的群中,即使Bot将推文推送到群,消息也会被快速覆盖
能否像调整推送方式(原创/转发/全部)一样,加上一个给推文消息设置精华消息的变量,这样在消息滚动快速的群中也能方便的查看到推文

4.在一些不可抗力的情况下,需要关闭Bot,Bot会囤积消息
在一次迁移中,关闭Wecab后再次启动,Wecab会把关闭到启动这段时间的推文全部拉取并推送出来
连着刷了十多分钟屏。。

配置方面:
1.希望能将触发的命令和反馈的信息独立放一个配置文件出来
每次版本更迭之后都要重新改。。

2.希望能够在配置文件中调整模块的启动
居然还有一个口球模块ww

一些问题反馈

哔哩哔哩模块:

  1. 如果是转发直播间会识别不出来,可以用roomid判断
  2. 专栏的图片应该取card.image_urls[0]

然后如果用了最新的mongodb依赖的话好像会出问题,不知道是不是我的环境问题

b站链接解析可以扩增下兼容性

function rtBiliByUrl(context) {
    //看看https://t.bilibili.com/h5/dynamic/detail/436188125440999377
    let dynamic_id = /https:\/\/t.bilibili.com\/(\d+)/.exec(context.message) || /https:\/\/t.bilibili.com\/h5\/dynamic\/detail\/(\d+)/.exec(context.message);
    if (dynamic_id != null) {
        rtBilibili(context, "", 0, dynamic_id[1]);
    } else {
       console.error(new Date().toString() + "," + "error rtBiliByUrl:" + context.message);
    }
}
function bilibiliCheck(context) {
。。。
else if (/^看看https:\/\/t.bilibili.com\/h5\/dynamic\/detail\/(\d+).+?/i.test(context.message)) {
        rtBiliByUrl(context);
        return true;
    }
。。。
}

TypeError: Cannot read property 'admin' of undefined

更新后会出现下面这个问题,重新部署也会,旧版本没有这个情况,望指点一下

TypeError: Cannot read property 'admin' of undefined
at Object. (/root/Wecab/modules/plugin/weibo.js:5:41)
at Generator.next ()
at Object. (/root/Wecab/main.js:1)
at Generator.next ()
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node index.js
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR! /root/.npm/_logs/2020-09-20T10_16_25_194Z-debug.log

[FEATURE] Admin群聊内权限提高

描述
当多个群聊订阅同一个推特/B站时,若消息中带有图片,非常容易导致图片上传失败
估计因群发消息时没有设置延迟,希望能给发送的订阅消息适当的增加延迟

同时希望大佬能给BotAdmin增加在群聊中的权限,而不是只有群管理能用www

系统信息

  • OS: Centos7
  • NodeJS Version: 14.16.0
  • Wecab Version: 1.7.31

Error Log
go-cqhttp
image

[BUG]教说话成功但是不回复

描述
wiki里面写着“可以学习图片”,但是实际测试发现经常教说话成功但是不回复
系统信息

  • OS: win10 2004
  • NodeJS Version:v14.15.1
  • Wecab Version:v1.4.9

复现

image
image

Error Log
把pm2log在产生bug时刷新出来的部分贴上来
D:\download\Wecab-master\logs\error-0.log last 15 lines:
0|Wecab | at W3CWebSocket.onConnectFailed (D:\download\Wecab-master\node_modules\websocket\lib\W3CWebSocket.js:217:14)
0|Wecab | at WebSocketClient. (D:\download\Wecab-master\node_modules\websocket\lib\W3CWebSocket.js:59:25)
0|Wecab | at WebSocketClient.emit (events.js:315:20)
0|Wecab | at WebSocketClient.EventEmitter.emit (domain.js:486:12)
0|Wecab | at ClientRequest.handleRequestError (D:\download\Wecab-master\node_modules\websocket\lib\WebSocketClient.js:227:14)
0|Wecab | at ClientRequest.emit (events.js:315:20)
0|Wecab | at ClientRequest.EventEmitter.emit (domain.js:486:12)
0|Wecab | at Socket.socketErrorListener (_http_client.js:469:9)
0|Wecab | twitter subs less than 1
0|Wecab | twitter subs less than 1
0|Wecab | twitter subs less than 1
0|Wecab | twitter subs less than 1
0|Wecab | twitter subs less than 1
0|Wecab | twitter subs less than 1
0|Wecab | twitter subs less than 1

[BUG] 部署出错

今天重新部署了下,但出错,请指教下是不是我部署有问题

0 info it worked if it ends with ok
1 verbose cli [ '/usr/bin/node', '/usr/bin/npm', 'run', 'log' ]
2 info using [email protected]
3 info using [email protected]
4 verbose stack Error: missing script: log
4 verbose stack at run (/usr/lib/node_modules/npm/lib/run-script.js:155:19)
4 verbose stack at /usr/lib/node_modules/npm/lib/run-script.js:63:5
4 verbose stack at /usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:116:5
4 verbose stack at /usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:436:5
4 verbose stack at checkBinReferences_ (/usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:391:45)
4 verbose stack at final (/usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:434:3)
4 verbose stack at then (/usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:161:5)
4 verbose stack at /usr/lib/node_modules/npm/node_modules/read-package-json/read-json.js:382:12
4 verbose stack at /usr/lib/node_modules/npm/node_modules/graceful-fs/graceful-fs.js:123:16
4 verbose stack at FSReqWrap.readFileAfterClose [as oncomplete] (internal/fs/read_file_context.js:53:3)
5 verbose cwd /root/Wecab
6 verbose Linux 4.19.0-12-amd64
7 verbose argv "/usr/bin/node" "/usr/bin/npm" "run" "log"
8 verbose node v10.23.0
9 verbose npm v6.14.8
10 error missing script: log
11 verbose exit [ 1, true ]

推特无法连接 功能暂停

运行环境:
win10 64位
后端:go-cqhttp-v0.9.31-fix1
MongDB:4.4.2

发送看看xx推特等命令都没反应

log如图:
image

设置了下代理,但好像没作用
image

TypeError: Cannot read property 'startsWith' of undefined

git clone 的,commit 是 be99bc5,部署后无法启动

  • OS: Ubuntu 20.04.2 LTS
  • NodeJS Version: v14.16.0
  • Wecab Version: 1.7.3 be99bc5

操作手法
pm2 start ecosystem.config.js --name Wecab

Log:

/opt/Wecab/modules/plugin/twitter.js:1
TypeError: Cannot read property 'startsWith' of undefined
    at setAgent (/opt/Wecab/modules/plugin/twitter.js:65:26)
    at Object.<anonymous> (/opt/Wecab/modules/plugin/twitter.js:829:1)
    at Generator.next (<anonymous>)
    at Object.<anonymous> (/opt/Wecab/main.js:1)
    at Generator.next (<anonymous>)

[BUG]无法正常下载Twitter图片

描述

非常感谢作者提供本工具,目前使用twitter推送功能时无法正常下载图片,带视频的推特下载正常。

系统信息

  • OS: windows server 2019
  • NodeJS Version:v14.16.0.
  • Wecab Version:v1.8.22

复现

随便选了两条推特,以看看+链接为例,只能推送带图片推特的文字。
1
而带视频的推特下载及推送正常。
2

Error Log
第一个截图对应的log

0|wecab    | 2021-05-05T18:12:07: 2021/5/5 下午6:12:06 连接中[/event]#1
0|wecab    | 2021-05-05T18:12:07: 2021/5/5 下午6:12:07 连接中[/api]#1
0|wecab    | 2021-05-05T18:12:07: translate initialisation successed
0|wecab    | 2021-05-05T18:12:07: 2021/5/5 下午6:12:07 连接成功[/api]#1
0|wecab    | 2021-05-05T18:12:07: 2021/5/5 下午6:12:07 连接成功[/event]#1
0|wecab    | 2021-05-05T18:12:07: Twitter successfully connected

0|wecab  | 2021-05-05T18:12:47: info: 下载文件, https://pbs.twimg.com/media/E0nBPCbUYAIp4g8?format=jpg&name=4096x4096, 目标文件名, dfa6033084ea98817eaede3a4bfd9ee3 {"timestamp":"2021-05-05T10:12:47.968Z"}
0|wecab  | 2021-05-05T18:12:50: Error code null, retry times = 2
0|wecab  | 2021-05-05T18:12:54: Error code null, retry times = 1
0|wecab  | 2021-05-05T18:12:58: warn: 下载资源失败: {"config":{"url":"https://pbs.twimg.com/media/E0nBPCbUYAIp4g8?format=jpg&name=4096x4096","method":"get","headers":{"Accept":"application/json, text/plain, */*","User-Agent":"axios/0.21.1"},"transformRequest":[null],"transformResponse":[null],"timeout":3000,"responseType":"stream","xsrfCookieName":"XSRF-TOKEN","xsrfHeaderName":"X-XSRF-TOKEN","maxContentLength":-1,"maxBodyLength":-1,"__retry":0},"code":"ECONNABORTED"}
0|wecab  | 2021-05-05T18:12:58: ReferenceError: err is not defined
0|wecab  |     at download (C:\Users\Administrator\Desktop\Wecab\utils\download.js:61:37)
0|wecab  |     at processTicksAndRejections (internal/process/task_queues.js:93:5)
0|wecab  |     at async format (C:\Users\Administrator\Desktop\Wecab\plugin\twitter.js:594:37)


[BUG]推特订阅模式选择“包含回复”,搬运内容出现了转发

订阅一名用户,模式是包含回复
在搬运这个用户的内容时出现了转发的内容,而且搬运里面没有“RT”两个字,直接显示成这个用户发出来的

系统信息

  • OS: CentOS 7.9.2009(Py3.7.8)
  • NodeJS Version:v14.17.3
  • Wecab Version:当前master版本

复现
100%复现

Error Log
没有异常log

[Feature]希望增加设置命令权限的功能

描述
一觉起来,被某群群友订阅了几十个账号,希望不单清空订阅命令有着只能管理员可以使用的权限,可以将每个群的命令使用权限通过admin私聊的方式独立设置www
M)($SZ`EKCSX~)Z52)N89CD

ps:新版本的Wecab黑名单仍然不对入群欢迎的消息起作用(

关于 dice 缺失

报错信息如下:

node index.js "main.js"

file:///E:/installmenu/KuQ/CQ-picfinder-robot/main.js:1
Error: Cannot find module './modules/plugin/dice'
at Object. (file:///E:/installmenu/KuQ/CQ-picfinder-robot/main.js:1)
npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] start: node index.js "main.js"
npm ERR! Exit status 1
npm ERR!
npm ERR! Failed at the [email protected] start script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

然后我找了一遍仓库,插件文件夹里没有 dice(

教学功能无法正常使用

命令 “我教你、忘记、你学过什么” 可以正常使用

但是 学会后并不能回复对应关键词,并且 “教学成果” 也得不到回应

现在使用 mirai 和 cqhttp-mirai,请问问题可能出在哪,应该如何排查?谢谢!

Sent from PPHub

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.