Giter Club home page Giter Club logo

adachi-bot's People

Contributors

490720818 avatar arondight avatar btmuli avatar buzhibujuelb avatar by-ha avatar catusax avatar ixciel avatar kernelbin avatar mark9804 avatar minigraygay avatar monsterxcn avatar silverystar avatar sqsora avatar sunist-c avatar xm798 avatar yuan488 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

adachi-bot's Issues

game_role_id is undefined

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)

机器人随机挑选群聊发送问好消息

如图……机器人会随机挑选群聊发送消息“提瓦特第一可爱向你问好,说help开始我们的互动吧!”
0861E494DFE7C3090F3271EF8642CE0C

Config中配置已修改为不发送群通知

# 复读群消息的概率%(1-100),0 不复读
repeatProb: 0

# 上线是否发送群通知,1 发送通知,0 不发送通知
groupHello: 0

设置功能默认关闭

类似十连和圣遗物之类的功能,很多群不太喜欢这样的刷屏,能不能加个某个功能默认新群聊是关闭或者打开的选项

Cookie 查询次数浪费问题

当前查询 ID,会随机分配到一个 Cookie 上,虽然有缓存,但是同一个 Cookie 在一天之内是可以查询若干次相同 ID 的。当前的策略会造成查询次数的浪费。

  • 确保一天之内某一个 ID 只锁定到一个 Cookie
  • 某个 Cookie 被分配到 30 次时,停止使用该 Cookie
  • 每天单独计算次数,历史数据可以删除

个人信息查询问题

请问这个可以查询个人的活动信息吗 比如说无相交响诗、风来人这种活动的数据。

对接原作者新API求助

在此项目里,原作者写了一个插件overview用于展示角色的官方数据,在新版本中,原作者废弃了此项目该插件使用的API,导致了依然使用旧API 的此项目无法查询新出角色的信息。原作者改用一个新的插件info,在可以展示角色官方数据的基础上,也加入了武器信息的展示。
此项目中对应的插件使用JS+Vue?,原作者的新项目则使用了TS+Vue3,因为我没有前端开发经验,所以在升级该项目插件的API 上遇到了困难。新的API 返回到Json 已经截然不同,而且Vue 的view 也有了较大改动,目前我的进展较慢,如果有熟悉的大佬欢迎帮忙修改一下。只需要能查询新出角色即可(现有功能对接到原作者的Version2 的API 上)。

查询信息时,没有返回图片,日志中有超时

image

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

提示网络环境异常,错误码:237。

滑动最后一步取出ticket,打开活动页面之后,F12获取ticket,{"result":"0","ticket":"t038-jcKCMfNAmxQ
然后直接输入ticket部分?
输入完之后,提示 [禁止登录]当前上网环境异常,请更换网络环境或在常用设备上登录或 稍后再试。(错误码:237)
试过更换1-5设备,依然都是一样问题。本地直接登录这个账号是没问题的。求教这个是QQ账号问题还是登录的OICQ问题。

查看好友和群

  • 群列表
  • 好友列表
  • 列表(QQ号),返回好友:昵称(ID)或者群:群名称(ID)

增加完整的传话机制

可以通过 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 install时报错error code EJSONPARSE

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=]

另外天赋、周本、武器等命令查询后发送的图片太大被压缩后看不太清,尤其是武器突破材料的图片清晰度损失较大,有发送原图的方法吗?

项目支持 ESM

根据我这两个月从零到一的 JS 知识,和观察经验到以下事实。

  1. 本项目当前使用的是 CJS,因为 CJS 某些方面的缺陷,现在已经少有新项目使用 CJS 了
  2. 还在维护的模块很多已经变成 ESM,我不是很理解 ESM 和 CJS 的关系,但是一个结果就是较新的模块已经无法使用了,require 会直接报错
  3. 当前大多数项目已经转移到了 TS,它和 JS 的关系据我理解可能像 Qt 之于 CPP,即是 JS 的一个语法扩展(带来了很多好的特性),但是仍然需要编译为 JS 才能被解释

我当前的想法如下。

  1. 如果只有 TS 能使用 ESM,那么此项目改为 TS
  2. 如果有 CJS 之外其他的 JS 标准能够使用 ESM,那么改用那个支持 ESM 的标准,这样修改可以最小化,但是因为 CJS 风评看上去不好,所以尽量不再使用 CJS
  3. 有必要的话项目的文件结构按照新的 JS 标准的约定或者习俗组织
  4. 代码尽量符合新的规范

这些做完之后,就可以使用较新的模块了,这是很重要的一件事。我不太明白 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
  1. 服务端资源直接存放到本仓库,同时修改API
  2. 提供一个脚本可以一键更新

启动时报错 Failed to launch the browser process

启动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可以正常下载。想知道该如何解决上述问题,期待得到开发大大的解答,谢谢!

做个自我介绍

我发现没有自我介绍,都会认为拉进来一个哑巴

  • 入群
  • 加好友

增加别名机制

武器 鱼叉 直接返回「渔获」的图片,不必输入武器 「渔获」,就是说别名匹配到直接等效于输入原名,不必返回一堆花里胡哨的猜测名称。

类似的还有角色的别名,姥爷->迪卢克炸弹人->可莉这种。

支持多个别名,在config下引入配置文件。

请问在更改部分文件后如何更新?

由于修改了部分文件,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

一个cookie上限之后怎么自己切换下一个,都写在里面他不会自动换,上限了只能手动删

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.