arondight / adachi-bot Goto Github PK
View Code? Open in Web Editor NEW一个在 QQ 中运行的原神助手
License: MIT License
一个在 QQ 中运行的原神助手
License: MIT License
例如神里绫华
的 ID 是10000002
,这个在哪个网站能查到?
C:\Users\Administrator\Desktop\Adachi-BOT-master\src\utils\detail.js:70
let { game_role_id, nickname, region, level } = baseInfo;
^
TypeError: Cannot destructure property 'game_role_id' of 'baseInfo' as it is und
efined.
at C:\Users\Administrator\Desktop\Adachi-BOT-master\src\utils\detail.js:70:1
5
at new Promise ()
at exports.basePromise (C:\Users\Administrator\Desktop\Adachi-BOT-master\src
\utils\detail.js:60:12)
at runMicrotasks ()
at processTicksAndRejections (node:internal/process/task_queues:96:5)
at async Object.module.exports [as character] (C:\Users\Administrator\Deskto
p\Adachi-BOT-master\src\plugins\character\index.js:33:26)
类似十连和圣遗物之类的功能,很多群不太喜欢这样的刷屏,能不能加个某个功能默认新群聊是关闭或者打开的选项
安装Node.js
git或者下载zip后解压
git clone https://github.com/Arondight/Adachi-BOT.git
cd ./Adachi-BOT/
npm install
配置config/setting.yml和config/cookies.yml
npm start
直接运行就行,无需使用pm2,如果非要pm2管理及开机启动请额外安装pm2-windows-service
npm i -g pm2-windows-service
当前查询 ID,会随机分配到一个 Cookie 上,虽然有缓存,但是同一个 Cookie 在一天之内是可以查询若干次相同 ID 的。当前的策略会造成查询次数的浪费。
当前日志会全部输出到一个log文件中,时间长了体积会非常庞大,不方便查看。建议为pm2启用pm2-logrotate插件,并配置每天4:00自动分割日志,方便管理~
请问这个可以查询个人的活动信息吗 比如说无相交响诗、风来人这种活动的数据。
虽然我还没搞明白 nodejs 的模块到底咋导入,不过看上去都不够规范
在此项目里,原作者写了一个插件overview用于展示角色的官方数据,在新版本中,原作者废弃了此项目该插件使用的API,导致了依然使用旧API 的此项目无法查询新出角色的信息。原作者改用一个新的插件info,在可以展示角色官方数据的基础上,也加入了武器信息的展示。
此项目中对应的插件使用JS+Vue?,原作者的新项目则使用了TS+Vue3,因为我没有前端开发经验,所以在升级该项目插件的API 上遇到了困难。新的API 返回到Json 已经截然不同,而且Vue 的view 也有了较大改动,目前我的进展较慢,如果有熟悉的大佬欢迎帮忙修改一下。只需要能查询新出角色即可(现有功能对接到原作者的Version2 的API 上)。
除了setting和cookie的内容,绑定的米游社信息也全部消失了,要重新绑定,请问下是什么原因呢
0|bot | [2021-08-16T17:26:14.798] [INFO] [iPad:178186691] - 用户 1xxxxxxx6 在一小时内进行过查询操作,将返回上次数据
0|bot | TimeoutError: Navigation timeout of 30000 ms exceeded
0|bot | at /home/yakult/Adachi-BOT/node_modules/puppeteer/lib/cjs/puppeteer/common/LifecycleWatcher.js:106:111
0|bot | TimeoutError: Navigation timeout of 30000 ms exceeded
0|bot | at /home/yakult/Adachi-BOT/node_modules/puppeteer/lib/cjs/puppeteer/common/LifecycleWatcher.js:106:111
0|bot | TimeoutError: Navigation timeout of 30000 ms exceeded
0|bot | at /home/yakult/Adachi-BOT/node_modules/puppeteer/lib/cjs/puppeteer/common/LifecycleWatcher.js:106:111
这个理论上不会误触吧
滑动最后一步取出ticket,打开活动页面之后,F12获取ticket,{"result":"0","ticket":"t038-jcKCMfNAmxQ
然后直接输入ticket部分?
输入完之后,提示 [禁止登录]当前上网环境异常,请更换网络环境或在常用设备上登录或 稍后再试。(错误码:237)
试过更换1-5设备,依然都是一样问题。本地直接登录这个账号是没问题的。求教这个是QQ账号问题还是登录的OICQ问题。
好友:昵称(ID)
或者群:群名称(ID)
参考项目cocogoat
可以通过 bot,和任意 bot 的好友和群聊通话
一共两个 API,需要有一张圣遗物的截图。
$ file 圣遗物截图.png
圣遗物截图.png: PNG image data, 513 x 540, 8-bit/color RGB, non-interlaced
$ echo "{\"image\":\"$(cat ./圣遗物截图.png | base64 -w0)\"}" >圣遗物截图.png.json
$ file 圣遗物截图.png.json
圣遗物截图.png.txt: ASCII text, with very long lines
圣遗物评分
$ curl -X POST https://api.genshin.pub/api/v1/app/ocr -H 'Content-Type: application/json' -d @圣遗物截图.png.json | tee 圣遗物.json
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
100 204k 100 334 100 204k 316 193k 0:00:01 0:00:01 --:--:-- 193k
{"name":"勋绩之花","pos":"生之花","star":5,"level":20,"main_item":{"type":"hp","name":"生命值","value":"4780"},"sub_item":[{"type":"em","name":"元素精通","value":"23"},{"type":"atk","name":"攻击力","value":"11.7%"},{"type":"cr","name":"暴击率","value":"10.5%"},{"type":"cd","name":"暴击伤害","value":"14.0%"}]}
$ curl -X POST https://api.genshin.pub/api/v1/relic/rate -H 'Content-Type: application/json' -d @圣遗物.json
{"total_score":700.4420866489831,"total_percent":"77.83","main_score":0,"main_percent":"0.00","sub_score":700.4420866489831,"sub_percent":"77.83"}
npm ERR! code EJSONPARSE
npm ERR! path /root/Adachi-BOT/package.json
npm ERR! JSON.parse Unexpected token "<" (0x3C) in JSON at position 478 while parsing near "... "pm2": "^5.1.0",\n<<<<<<< Updated upst..."
npm ERR! JSON.parse Failed to parse JSON data.
npm ERR! JSON.parse Note: package.json must be actual JSON, not just JavaScript.
使用 UID 指令查询用户信息时无法显示旅行者名称、旅行者等级和世界等级。
CentOS 7
node v16.6.1
npm v7.20.3
PM2 log 未见报错:
0|gsbot | [2021-08-11T11:31:16.521] [INFO] [MacOS:xxxxxxxxxx] - recv from: [Private: xxxxxxxx(friend)] UID xxxxx
0|gsbot | [2021-08-11T11:31:16.649] [INFO] [MacOS:xxxxxxxxxx] - 用户 xxxxx 查询成功,数据已缓存
0|gsbot | [2021-08-11T11:31:18.024] [DEBUG] [MacOS:xxxxxxxxxx] - 转换base64图片
0|gsbot | [2021-08-11T11:31:18.036] [DEBUG] [MacOS:xxxxxxxxxx] - 开始请求上传图片到tx服务器
0|gsbot | [2021-08-11T11:31:18.351] [DEBUG] [MacOS:xxxxxxxxxx] - highway ip:117.184.246.123 port:14000
0|gsbot | [2021-08-11T11:31:18.883] [DEBUG] [MacOS:xxxxxxxxxx] - highway chunk uploaded (100.00%)
0|gsbot | [2021-08-11T11:31:18.888] [DEBUG] [MacOS:xxxxxxxxxx] - 请求图片上传结束
0|gsbot | [2021-08-11T11:31:19.023] [INFO] [MacOS:xxxxxxxxxx] - send to: [Private: xxxxxxxx / message_id: AlE4SAAAAXlpmH5VYRNEhgE=]
另外天赋、周本、武器等命令查询后发送的图片太大被压缩后看不太清,尤其是武器突破材料的图片清晰度损失较大,有发送原图的方法吗?
根据我这两个月从零到一的 JS 知识,和观察经验到以下事实。
require
会直接报错我当前的想法如下。
这些做完之后,就可以使用较新的模块了,这是很重要的一件事。我不太明白 JS 的(具体是哪些)标准之间有什么区别,仅在此表述我的想法,但是需要支持导入 ESM 的目的是明确的。
因为当前代码也不是不能跑,所以此事不紧急。
由于本人账号加入了数十个各种类型的群聊,还有一些班级群,在开启机器人后我一些群聊直接踢出,所以能不能只在指定群聊开启机器人。
不确定可行,目前仅有一个想法。
/baseinfo/overview/${encodeURI(name)}.json
/characters/profile/
/gacha/items/
/gacha/items/background.png
/item/
/item/${this.data.name}.png
/item/lock.png
/item/rarity.png
/module/artifact.png
/module/card-new-bottom.png
/module/card-new-middle.png
/module/card-new-package.png
/module/element.png
/Version2/
/Version2/artifact/
/Version2/character/
/Version2/info/docs/$.json
/Version2/info/image/
/Version2/info/other/BaseBackground
/Version2/info/other/BaseStar
/Version2/wish/character/
/Version2/wish/weapon/
/characters/profile/${ props.profile }.png
/item/${ props.data.name }.png
/item/lock.png
/Version2/${ link }
/Version2/artifact/${ id }/${ slot }.png
/Version2/artifact/artifact.yml
/Version2/artifact/other/${ props.pos }.png
/Version2/artifact/other/rarity.png
/Version2/character/${ props.id }.png
/Version2/info/docs/$.json
/Version2/info/image/${ name }.png
/Version2/info/other/BaseBackground${ props.rarity }.png
/Version2/info/other/BaseStar${ props.rarity }.png
/Version2/module/${ parseInt( props.level ) === 0 ?
/Version2/module/artifact.png
/Version2/module/card-bottom.png
/Version2/module/card-middle.png
/Version2/module/card-package.png
/Version2/module/element.png
/Version2/slip/index.yml
/Version2/wish/${ type }/${ props.d.name }.png
/Version2/wish/config/$.json
Arondight $ grep -oP "(?<=aliyuncs\.com).+?(?=[\"'\`])" * -rins | cut -d: -f3 | sort | uniq
/baseinfo/overview/${encodeURI(name)}.json
/characters/profile/
/gacha/items/
/gacha/items/background.png
/item/
/item/${this.data.name}.png
/item/lock.png
/item/rarity.png
/module/artifact.png
/module/card-new-bottom.png
/module/card-new-middle.png
/module/card-new-package.png
/module/element.png
/Version2/
/Version2/artifact/
/Version2/character/
/Version2/info/docs/$.json
/Version2/info/image/
/Version2/info/other/BaseBackground
/Version2/info/other/BaseStar
/Version2/wish/character/
/Version2/wish/weapon/
SilveryStar $ grep -oP "(?<=aliyuncs\.com).+?(?=[\"'\`])" * -rins | cut -d: -f3 | sort | uniq
/characters/profile/${ props.profile }.png
/item/${ props.data.name }.png
/item/lock.png
/Version2/${ link }
/Version2/artifact/${ id }/${ slot }.png
/Version2/artifact/artifact.yml
/Version2/artifact/other/${ props.pos }.png
/Version2/artifact/other/rarity.png
/Version2/character/${ props.id }.png
/Version2/info/docs/$.json
/Version2/info/image/${ name }.png
/Version2/info/other/BaseBackground${ props.rarity }.png
/Version2/info/other/BaseStar${ props.rarity }.png
/Version2/module/${ parseInt( props.level ) === 0 ?
/Version2/module/artifact.png
/Version2/module/card-bottom.png
/Version2/module/card-middle.png
/Version2/module/card-package.png
/Version2/module/element.png
/Version2/slip/index.yml
/Version2/wish/${ type }/${ props.d.name }.png
/Version2/wish/config/$.json
多次遭到投诉当前菜单过于沙雕……例如早上吃奶酪啥的。
此 issue 已经过时,请参阅项目的文档。
Lines 32 to 38 in 69595aa
Ref #81
一定是哪里出错了,应当只有第一次加群和每次上线时才会问好
启动bot时提示以下错误信息:
(node:24354) UnhandledPromiseRejectionWarning: Error: Failed to launch the browser process!
/root/Adachi-BOT/node_modules/puppeteer/.local-chromium/linux-901912/chrome-linux/chrome: error while loading shared libraries: libgbm.so.1: cannot open shared object file: No such file or directory
TROUBLESHOOTING: https://github.com/puppeteer/puppeteer/blob/main/docs/troubleshooting.md
at onClose (/root/Adachi-BOT/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:197:20)
at Interface.<anonymous> (/root/Adachi-BOT/node_modules/puppeteer/lib/cjs/puppeteer/node/BrowserRunner.js:187:68)
at Interface.emit (events.js:387:35)
at Interface.close (readline.js:451:8)
at Socket.onend (readline.js:224:10)
at Socket.emit (events.js:387:35)
at endReadableNT (internal/streams/readable.js:1317:12)
at processTicksAndRejections (internal/process/task_queues.js:82:21)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:24354) 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:24354) [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.
在执行指令是也出现了报错:日志如下(以指令“十连”为例):
0|bot | ReferenceError: browser is not defined
0|bot | at render (/root/Adachi-BOT/src/utils/render.js:4:16)
0|bot | at Object.module.exports [as gacha] (/root/Adachi-BOT/src/plugins/gacha/index.js:57:11)
0|bot | at processTicksAndRejections (internal/process/task_queues.js:95:5)
在进行npm install 时并未见到failed字眼,chromium可以正常下载。想知道该如何解决上述问题,期待得到开发大大的解答,谢谢!
指定群号,歇逼之后停止一切响应。
建议使用 uid 也应该能够触发UID查询功能
我发现没有自我介绍,都会认为拉进来一个哑巴
圣遗物的计算方法是否是以暴击率x2加爆伤加攻击力?感觉和其他评分规则计算出的分数不一样
武器 鱼叉
直接返回「渔获」
的图片,不必输入武器 「渔获」
,就是说别名匹配到直接等效于输入原名,不必返回一堆花里胡哨的猜测名称。
类似的还有角色的别名,姥爷->迪卢克
、炸弹人->可莉
这种。
支持多个别名,在config
下引入配置文件。
现在借了几十个矿号,有用户名、密码,可登录,但是拿 Cookie 太痛苦了
由于修改了部分文件,git pull -p时报错。
root@localhost: ~/Adachi-BOT 10:36:06
# git pull -p
warning: 不建议在没有为偏离分支指定合并策略时执行 pull 操作。 您可以在执行下一次
pull 操作之前执行下面一条命令来抑制本消息:
git config pull.rebase false # 合并(缺省策略)
git config pull.rebase true # 变基
git config pull.ff only # 仅快进
您可以将 "git config" 替换为 "git config --global" 以便为所有仓库设置
缺省的配置项。您也可以在每次执行 pull 命令时添加 --rebase、--no-rebase,
或者 --ff-only 参数覆盖缺省设置。
error: 无法拉取,因为您有未合并的文件。
提示:请在工作区改正文件,然后酌情使用 'git add/rm <文件>' 命令标记
提示:解决方案并提交。
fatal: 因为存在未解决的冲突而退出。
一个cookie上限之后怎么自己切换下一个,都写在里面他不会自动换,上限了只能手动删
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.