takayama-lily / node-onebot Goto Github PK
View Code? Open in Web Editor NEWLicense: MIT License
License: MIT License
pm2 start main.js --node-args="123456" -n onebot
↑ 这样好像报错?
一直都是用下边方法搞定的:
if (Number.isNaN(account) && global_config.autoLogin) {
account = global_config.autoLogin.account;
}
[root@Yui node-onebot]# node main xxxxxxxxx
node:internal/modules/cjs/loader:936
throw err;
^
Error: Cannot find module '/root/node-onebot/main'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:933:15)
at Function.Module._load (node:internal/modules/cjs/loader:778:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
看了眼onebot文件夹,里面的lib文件夹、以及config.js都被自动删除了,我重复clone也会这样
我想对接青龙面板的sillyGirl,是我其他地方有问题吗
[2022-08-02T11:30:28.857] [MARK] [Android:3093884692] - ----------
[2022-08-02T11:30:28.858] [MARK] [Android:3093884692] - Package Version: [email protected] (Released on 2021/12/08)
[2022-08-02T11:30:28.858] [MARK] [Android:3093884692] - View Changelogs:https://github.com/takayama-lily/oicq/releases
[2022-08-02T11:30:28.858] [MARK] [Android:3093884692] - ----------
[2022-08-02T11:30:29.363] [MARK] [Android:3093884692] - 正在探索可用服务器...
[2022-08-02T11:30:29.509] [MARK] [Android:3093884692] - connecting to 42.187.184.99:8080
[2022-08-02T11:30:29.521] [MARK] [Android:3093884692] - 42.187.184.99:8080 connected
[2022-08-02T11:30:29.636] [MARK] [Android:3093884692] - 收到滑动验证码,请访问以下地址完成滑动,并从网络响应中取出ticket输入:https://ssl.captcha.qq.com/template/wireless_mqq_captcha.html?style=simple&aid=16&uin=3093884692&sid=455096505870096981&cap_cd=1JIRrpwUygvepR39E1Ws_ooU5btATmgNUHoSxghghXDiZPeftjJrdQ**&clientype=1&apptype=2
t03bqQD-ppQU5GZmsxPUBh92h_4DDp3FJI6gbBxakKoZMGjKrwHhQKofmyiHUaXRVfwRJRCPN6LWBQR3eVUUIi80vsAw9mX-7-w_SkpQM_D96R3Aup5pOuS3fjbMksi0RzKzcPGv2J9ZF4*
[2022-08-02T11:31:27.068] [ERROR] [Android:3093884692] - [温馨提示]当前QQ版本过低,请升级至最新版本后再登录。点击进入下载页面(错误码:235)
使用了Dicker镜像mzzsfy/node-onebot,创建后扫码无法登录
安卓手机发送图片+文字,parseMultiMsg处理后图片的url没有了
注释了之后正常,不知道会不会有其他问题?
请问可以通过post请求send_group_msg吗,我试了只有GET可以
想托管在unicloud上面
求尽快实现set_group_snonymous_ban
C:\Users\zp\mystuff\onebot>node main 1101170736
[2020-09-25T15:21:33.221] [INFO] [SYSTEM] - OICQ程序启动。当前内核版本:v1.7.2
[2020-09-25T15:21:33.253] [INFO] [SYSTEM] - 已加载配置文件:
{
platform: 2,
kickoff: false,
ignore_self: true,
web_image_timeout: 30,
web_record_timeout: 30,
debug: false,
host: '0.0.0.0',
port: 5700,
use_http: true,
use_ws: false,
access_token: '',
secret: '',
post_timeout: 30,
post_message_format: 'string',
enable_heartbeat: false,
heartbeat_interval: 15000,
post_url: [ 'http://127.0.0.1:8081' ],
ws_reverse_url: [ 'ws://127.0.0.1:8082' ],
ws_reverse_reconnect_interval: 3000,
event_filter: ''
}
[2020-09-25T15:21:33.297] [INFO] [SYSTEM] - 开启http服务器成功,监听0.0.0.0:5700
[2020-09-25T15:21:34.298] [INFO] [BOT:1101170736] - connecting to msfwifi.3g.qq.com:8080
[2020-09-25T15:21:34.347] [INFO] [BOT:1101170736] - 113.96.12.224:8080 connected
events.js:187
throw er; // Unhandled 'error' event
^
TypeError [ERR_INVALID_ARG_TYPE]: The "chunk" argument must be one of type string, Buffer, or Uint8Array. Received type number
at chunkInvalid (_stream_readable.js:329:12)
at readableAddChunk (_stream_readable.js:261:12)
at Readable.push (_stream_readable.js:224:10)
at next (internal/streams/from.js:34:27)
at processTicksAndRejections (internal/process/task_queues.js:93:5)
Emitted 'error' event on Readable instance at:
at emitErrorNT (internal/streams/destroy.js:92:8)
at emitErrorAndCloseNT (internal/streams/destroy.js:60:3)
at processTicksAndRejections (internal/process/task_queues.js:80:21) {
code: 'ERR_INVALID_ARG_TYPE'
}
方便后续更新。。
如果已经支持的话,应该在哪里设置?
鉴权格式应为:
POST / HTTP/1.1
X-Signature: sha1=...
使用ws时,可能会1000ms内无法建立连接但机器人已经启动。
Header可能不包含authorization(这个问题我不是很确定,但看了一下规范上是说一定会以query的形式传入一个access_token),这样的请求会被拒绝(403/401)。
使用ws并启用心跳时,可能会在心跳时处于CLOSING/READYSTATE/CONNECTING等非打开状态,导致进程直接被kill掉。好吧,是说缺少try catch代码块。
我想问一下 这个项目支持 设置 发送消息的 频率 吗
比如 10秒内 只允许发一条, 其他的消息 在后面排队. 按照顺序慢慢发.
发送太快. 容易封号
账号登录 先让我ticket 然后就是要用手机扫码 扫码之后就直接下线通知了 说密码泄露 怎么也登录不上去 换了2个qq号都这样 怎么办啊
日志里显示
生成message_id失败,此消息大概率被风控了。
此消息将尝试以另一种方式再发送一次。
这种类型的消息,在mac qq 和iPhone看起来是一个转发的图文消息,可以点开,看到内容
但是在Android手机看来就是”[图文消息]“这几个文字
问:
尝试过管理员权限,重启,更换盘符都无效
音频转码到amr失败,请确认你的ffmpeg可以处理此转换。
转换的是m4a文件,请解决谢谢
在 onebot 标准中提到
目前,除了合并转发相关的特殊消息段外,几乎所有消息段参数值类型均为字符串,以支持与 CQ 码的相互转换。
而目前从 node-onebot 接收到的 at 消息段中 qq 参数是整型。
如果是密码登录就会提示这个:[温馨提示]当前QQ版本过低,请升级至最新版本后再登录。点击进入下载页面(错误码:235)
如果是扫码登录,就会在手机端提示“当前设备网络不稳定或处于复杂网络环境,为了你的安全建议将两个设备连接同一网络...”
我尝试了将配置文件里的platform: 1, //1:安卓手机 2:aPad 3:安卓手表 4:MacOS 5:iPad, 依次设置成1,4,5。
换了3个QQ号。
换个两部扫码的手机。
但是,以上两种登录失败情况均会出现,无法登陆。
这是onebot收到的消息日志
安卓QQ群友:
recv from: [Group: 魔女茶会(**), Member: C.(***)] /image upload 妹妹 [CQ:image,file=73d6aab64d3a085632bcae9b7d34258383654]
我用mac QQ 发的正常
recv from: [Group: 魔女茶会(***), Member: 野原小牛(***)] /image upload 妹妹
[CQ:image,file=73d6aab64d3a085632bcae9b7d34258383654,url=http://gchat.qpic.cn/gchatpic_new/****/1041024975-2201102273-73D6AAB64D3A085632BCAE9B7D342583/0?term=2]
从时间上来讲同一张图后发,应该和缓存没有关系?
不知道是不是和设备有关,调试了一下,没啥头绪QAQ
敏感信息*
了
(node:9988) UnhandledPromiseRejectionWarning: TypeError [ERR_INVALID_ARG_TYPE]: The "iterable" argument must be an instance of Iterable. Received null
at from (internal/streams/from.js:31:11)
at Function.Readable.from (_stream_readable.js:1204:10)
at AndroidClient.decodeLoginResponse (E:\onebot-master\node_modules\oicq\lib\wtlogin\wt.js:422:29)
at AndroidClient.captchaLogin (E:\onebot-master\node_modules\oicq\lib\wtlogin\wt.js:199:25)
at processTicksAndRejections (internal/process/task_queues.js:97:5)
(node:9988) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag --unhandled-rejections=strict
(see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
(node:9988) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
使用习惯里在文件夹中使用了“[”和“]”符号,导致于图片路径解读时出现了错误。
虽然可以用更换文件夹路径的方式避开,但是想问一下有办法通过转义符之类的方式来兼容么?
不知道是否可在配置文件中实现
如题,首次登陆时因为需要交互,容器化放到docker内部署有点怪,希望首次的交互可以支持从配置文件读取账号密码,或者环境变量
使用node main QQ之后我输入密码,输入滑块ticket之后说我在此设备登录存在安全风险让我用手机号或者常用设备登录,然后我切换扫码登录就会报错 length of encrypted data must be a multiple of 8 请问这个怎么解决
if (type === 160) {
const url = String(t[0x204]);
const filepath = path.join(this.dir, `safe.url`);
fs.writeFileSync(filepath, `[InternetShortcut]\nURL=${url}`);
this.logger.info("需要扫码验证设备信息,验证地址:" + url);
this.logger.info(`或者通过(${filepath})访问`);
return common.emit(this, "system.login.device", {url});
}
现在大多数情况长信息几乎100%生成Id失败,是否考虑加一个配置项,让长信息使用分片发送的方式?
这样是否对避免风控更友好一点
出现故障!如果这个问题持续出现,请和我说“重置会话” 来开启一段新的会话,或者发送 “回滚对话” 来回溯到上一条对话,你上一条说的我就当作没看见。
That model does not exist
先打开nonebot2,接着打开onebot,可以连接上
这时候关闭nonebot2(onebot还是开着),再打开nonebot2,ws反向代理连不上
[温馨提示]当前版本过低,请先升级到手机QQ最新版本。
请问有什么解决办法?
想问一下如何添加ZeroBot的插件啊
琢磨着要不要发在 node-oicq 里去,毕竟这个 bug 出在 node-oicq 影响了 node-onebot(雾)
data
字段直接包含了 package.json ....,这样强行组合的话不符合 onebot 中对该 API 的规范:
get_version_info
获取版本信息参数
无
响应数据
字段名 数据类型 说明 app_name
string 应用标识,如 mirai-native
app_version
string 应用版本,如 1.2.3
protocol_version
string OneBot 标准版本,如 v11
…… - OneBot 实现自行添加的其它内容
也就是无法正确获取 app_name
和 app_version
等参数,得用 name
和 version
(按照 package.json 写法的话),protocol_version
也没有提供
修改的话在 oicq/client.js
的 683 行左右:
// ...
getVersionInfo() {
return buildApiRet(0, version);
}
// ...
改成以下即可:
// ...
getVersionInfo() {
const result = Object.assign({}, version);
result.app_name = result.name;
result.app_version = result.version;
result.protocol_version = "v11";
return buildApiRet(0, result);
}
// ...
可能会有点消耗性能,可以看情况稍微优化,谢谢大佬了
错误报告如下,应该是 ws
库因为错误码不合法抛出了一个错误:
C:\Path\To\onebot\node_modules\ws\lib\sender.js:112
throw new TypeError('First argument must be a valid error code number');
^
TypeError: First argument must be a valid error code number
at Sender.close (C:\Path\To\onebot\node_modules\ws\lib\sender.js:112:13)
at WebSocket.close (C:\Path\To\onebot\node_modules\ws\lib\websocket.js:233:18)
at WebSocketServer.<anonymous> (C:\Path\To\onebot\lib\core.js:248:31)
at WebSocketServer.emit (events.js:315:20)
at WebSocketServer.completeUpgrade (C:\Path\To\onebot\node_modules\ws\lib\websocket-server.js:330:5)
at WebSocketServer.handleUpgrade (C:\Path\To\onebot\node_modules\ws\lib\websocket-server.js:246:10)
at Server.upgrade (C:\Path\To\onebot\node_modules\ws\lib\websocket-server.js:92:16)
at Server.emit (events.js:315:20)
at onParserExecuteCommon (_http_server.js:695:14)
at onParserExecute (_http_server.js:608:3)
重现步骤:在配置里添加 access_token
字段,然后使用任意的客户端连接(token 故意设置不正确)(我使用了自己的 oneui
),然后报错退出。
这个问题有可能会影响到服务器的运行,别人可以使用这个方式来强制关闭后端。
最近将bot服务迁移到了k8s内,遇到一个问题,当因为某些原因无法正常连接ws的时候,会不断尝试重连:反向ws连接被关闭,将在xxxxx毫秒后尝试连接。
我需要该bot服务在发生断线后,发生异常停止服务而不是不断尝试断线重连,这样容器才能监测到bot服务已不再健康,重启容器。
是否有配置项可以关闭ws断线重连,或者是否有tcp or http的健康检测端口?
下载源码是不是太奇怪了一点?也不方便其他方式的拓展
如题
console.log(bot.gl);
的输出为
Map(0) {}
是我的使用方法有问题吗
求解答
请问为什么回调JS无法运行只有php可以
Error: failed to start container "bot-tata": Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process caused: exec: "node": executable file not found in $PATH: unknown
dockerfile没有改动
edit:
我自己编写dockerfile就好了 怀疑项目内base镜像有问题
修改如下
FROM node:14-alpine
WORKDIR /app
COPY . .
CMD ["node", "main","2456202949"]
直接用node的镜像不就好了吗_(:з」∠)_ 为啥要用centos
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.