Code Monkey home page Code Monkey logo

yobot's Introduction

yobot's People

Contributors

a-kirami avatar ai-himmel avatar azurcrystal avatar corvo007 avatar diving-fish avatar fengjk12138 avatar girlkiller512 avatar ishkong avatar lancercmd avatar librazy avatar myisjt avatar otz avatar rbameto avatar sonodahanami avatar windylh avatar winrey avatar xhl6666 avatar yuudi avatar zfjdhj 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  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

yobot's Issues

Bug Report yobot.py Line 144

版本3.2.0,作为插件运行,依赖皆已更新到latest。

在yobot.py中的第144~146行的代码为首次出现,错误日志如下

[2020-02-18 23:19:21,688 nonebot] ERROR: Failed to import "hoshino.modules.yobot-plugin.src", error: 'Message' object has no attribute 'Request'
[2020-02-18 23:19:21,688 nonebot] ERROR: 'Message' object has no attribute 'Request'
Traceback (most recent call last):
File "C:\Users\Lan\AppData\Local\Programs\Python\Python38\lib\site-packages\nonebot\plugin.py", line 31, in load_plugin
module = importlib.import_module(module_name)
File "C:\Users\Lan\AppData\Local\Programs\Python\Python38\lib\importlib_init_.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 961, in _find_and_load_unlocked
File "", line 219, in _call_with_frames_removed
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in call_with_frames_removed
File "E:\酷Q_Pro\app\HoshinoBot\hoshino\modules\yobot-plugin_init
.py", line 1, in
from .src.client import nonebot_plugin
File "E:\酷Q_Pro\app\HoshinoBot\hoshino\modules\yobot-plugin\src\client\nonebot_plugin.py", line 48, in
bot = Yobot(data_path="./yobot_data",
File "E:\酷Q_Pro\app\HoshinoBot\hoshino\modules\yobot-plugin\src\client\yobot.py", line 145, in init
if p.Request:
AttributeError: 'Message' object has no attribute 'Request'

尝试将 if p.Request: 替换为 if p: 后,错误日志如下

[2020-02-18 23:23:27,282 nonebot] ERROR: Failed to import "hoshino.modules.yobot-plugin.src", error: 'Updater' object has no attribute 'register_routes'
[2020-02-18 23:23:27,282 nonebot] ERROR: 'Updater' object has no attribute 'register_routes'
Traceback (most recent call last):
File "C:\Users\Lan\AppData\Local\Programs\Python\Python38\lib\site-packages\nonebot\plugin.py", line 31, in load_plugin
module = importlib.import_module(module_name)
File "C:\Users\Lan\AppData\Local\Programs\Python\Python38\lib\importlib_init_.py", line 127, in import_module
return _bootstrap._gcd_import(name[level:], package, level)
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 961, in _find_and_load_unlocked
File "", line 219, in _call_with_frames_removed
File "", line 1014, in _gcd_import
File "", line 991, in _find_and_load
File "", line 975, in _find_and_load_unlocked
File "", line 671, in _load_unlocked
File "", line 783, in exec_module
File "", line 219, in call_with_frames_removed
File "E:\酷Q_Pro\app\HoshinoBot\hoshino\modules\yobot-plugin_init
.py", line 1, in
from .src.client import nonebot_plugin
File "E:\酷Q_Pro\app\HoshinoBot\hoshino\modules\yobot-plugin\src\client\nonebot_plugin.py", line 48, in
bot = Yobot(data_path="./yobot_data",
File "E:\酷Q_Pro\app\HoshinoBot\hoshino\modules\yobot-plugin\src\client\yobot.py", line 146, in init
p.register_routes(quart_app)
AttributeError: 'Updater' object has no attribute 'register_routes'

上述问题会导致yobot指令完全无效,于是决定完全移除144~146行,而后可正常使用。
希望有助于确定并排除问题

不再增加新功能了

刚开始写这个项目的时候水平不够,留下很多隐患慢慢显现出来了,想加新功能但有很多问题不好解决。
现在就修一修bug,新功能也不会再加了。
说不定以后心血来潮又把这个项目重构了。

不建议浪费时间在这个项目上,因为实在是…太乱了。

[已解决]说明文档 中 酷Q安装包和yobot安装链接失效.

访问 酷Q-httpapi 整合包
https://pan.loli.com.se/api/files/onedrive/uploads/2020/05/01/CoolQ_With_Httpapi.7z

Code: InvalidAuthenticationToken
Message: Access token has expired.
Inner error:
	AdditionalData:
	request-id: 3b56ae32-6f0c-4077-9141-32efb2b02ead
	date: 2020-05-08T09:12:57
ClientRequestId: 3b56ae32-6f0c-4077-9141-32efb2b02ead

访问 yobot便携版便捷版本
https://pan.loli.com.se/api/files/onedrive/uploads/2020/05/06/yobot3409.zip

Code: InvalidAuthenticationToken
Message: Access token has expired.
Inner error:
	AdditionalData:
	request-id: 010f65ec-31cf-4dd0-8f42-d14961c8f004
	date: 2020-05-08T09:15:57
ClientRequestId: 010f65ec-31cf-4dd0-8f42-d14961c8f004

Windows 便携版(快速上手版)

是否需要更好Yun源? Any ideas?

请求大佬添加一个解散/删除功能

因为初次使用难免会自建一个群用来测试,结果发现网页端找不到删除按钮,发解散公会/删除公会也无效,请求大佬有空的时候可以考虑一下添加这个功能,插件非常好,非常感谢!!

希望能够通过指令“撤销 @某人 #1”来指定撤销某人的某一刀

我们群有个群员早上7点钟打完两刀,
但是报刀报错了,报了三刀,而如今一直处于失联状态。


按照现有逻辑,如果之前报刀报错了,管理员有两个解决方案:
1.(管理员)通过修改boss血量全局修改。
2.(管理员)通过指令一个个撤销上去 → 撤销到错误位置 → 再重新报刀。

  • 方案1 会导致后续统计出现问题,且查刀的时候容易忘记那位还少一刀。
  • 方案2 较为繁琐,会出现大面积@打扰其他人,且可能出现二次错误。

所以试图来提两个建议:
1.通过指令“撤销 @某人 #1”来指定撤销某人的某一刀(#1代表第一刀)
2.通过指令“撤销 @某人”来指定撤销某人的全部刀

以及额外建议:
1.通过指令“更正报刀 123456 @某人 #1”来指定更正某人的某一刀(#1代表第一刀)

yobot在群聊中无法使用“申请出刀“指令

在使用过程中,发送消息”申请出刀“,机器人并无反馈。
在网页面板上点击按钮”申请出刀“,机器人在群中回复”XXX已开始挑战boss“。说明申请出刀指令运转正常,但是接受消息这里出现了问题。
顺便提下其他群聊消息类型的指令均可使用,只有申请出刀出了问题

添加access_token后启动闪退

httpapi和机器人的access_token都是一样的。
尝试了下httpapi填写了access_token。但是机器人没填写就正常启动。
机器人填写了token就闪退。如图
QQ截图20200430222437

[BUG]抽一井的小bug

gacha.py line172

条件判断 当一天只能抽30次卡时无法抽卡,提示剩余抽卡不足30。

line178

我已经做了不足30次的处理,可以选择一个删除

名称记录问题

在使用yobot的时候发现yobot只能记录最新的名片,在多个群聊使用时候有诸多不便,敬请雨滴佬闲暇之余改善一下,谢谢!

docker部署,私聊机器人version没有反应[Question] 标题

您好,请问docker部署的这个和Windows的不一样吗
我昨天在自己电脑上做的,在酷Q的应用管理有http api,一切都很顺利.但是没有公网ip只能自己一个人用
今天买的服务器ubuntu,docker部署的,但是安装完酷Q以后,在应用管理里只有这么几个插件
图片私聊机器人version也没有反应,发送登录也没有.感觉是不是公会战的插件没有安装到机器人里面吖

[BUG] 权限管理问题

当机器人管理员进入人员管理界面时,可以自由修改【所有人】的权限级别,包括主人。

web网页js加载失败

使用web模式的时候会出现页面样式加载失败的问题,vue.min.js等cdn加载不出来

Docker部署时无法检测版本

Docker部署时代码是直接add的,没有repo结构无法使用git,导致Updater检测不到版本,是不是可以把版本信息分离出来?
更新的话倒是可以在host上另外监控。

使用疑问

在阿里云服务器上跑了docker后,配置文件是在哪里呢,我看文档里说在yobot_data/yobot_config.json,这个是docker里的文件吗还是本地的?我运行docker后就无法操作了,求解答。

非公会成员仍可发送“申请出刀”“挂树”等指令并得到反馈(优化)

rt,而且得到反馈之后,该用户进入用户管理的列表中,但此人仍可以发送“加入公会”来加入公会,不过并不会造成同人多项进入列表的情形,所以只是一个优化上的建议。
建议非工会成员禁止使用除“加入公会”“创建日服公会”“加入全部成员”“面板”“手册”以外的公会战相关指令。

[Feature request] 下树提醒

现在国服挂树最多只能挂一个小时左右,希望能有一个挂树太久at人提醒下树的功能,不然会忘记时间掉刀。

[BUG] Build error with Docker

Better to use this

      bash -c "
      python3 main.py 2>&1 >/dev/null && sh yobotg.sh
      "

To replace

      bash -c "
      python3 main.py > /dev/null 2 > /dev/null
      && sh yobotg.sh
      "

As the old one will run into an error on some Linux

Attached the errors on my server
image version: Canonical-Ubuntu-18.04-Minimal-2020.01.21-0
kernel version: 4.15.0-1033-oracle

 bot_1     | bash: -c: line 2: syntax error near unexpected token `&&'
 bot_1     | bash: -c: line 2: `&& sh yobotg.sh'

web网页版的预约界面加载不出来群名字

在群名字加载不出来显示为“--”的时候,bot会有一些功能无法正常应用,如查树
另外,申请出刀后挂树了其他人依然无法申请出刀是不是不正常?
最后,添加全部成员时依然会将一个不在群中的人加入到公会列表里 而有些在群里的人却没有加进去 已经重启过了几次依然会出现这个问题

作为HoshinoBot的插件使用时无法打开网页

你好
我使用的阿里云服务器
docker配置的酷Q pro版+cqhttp
docker run -d --rm --name=hoshino -p 9000:9000 -p 5700:5700 -v $(pwd)/coolq:/home/user/coolq -e COOLQ_URL=http://dlsec.cqp.me/cqp-full -e COOLQ_ACCOUNT=*****15827 -e VNC_PASSWD=12345678 -e CQHTTP_SERVE_DATA_FILES=yes -e CQHTTP_USE_HTTP=no -e CQHTTP_USE_WS_REVERSE=yes -e CQHTTP_WS_REVERSE_URL=ws://127.0.0.1:9222/ws/ -e CQHTTP_WS_REVERSE_USE_UNIVERSAL_CLIENT=yes --net=host richardchien/cqhttp:latest
按照注意事项,安装了依赖也配置好了子模块
在启动HoshinoBot后,发送version后能正确返回 :yobot[v3.5.5]插件版
但是私聊登录后发现,返回的链接却无法打开。
设置、帮助等返回的链接都无法打开。

/root/HoshinoBot/hoshino/modules/yobot/yobot/src/client/yobot_data/yobot_config.json如下
{
"host": "0.0.0.0",
"port": 9222,
"access_token": null,
"client_salt": "ym3UVj15aJqjBpof",
"public_address": "http://116.62.63.55:9222/",
"public_basepath": "/yobot/",
"web_mode_hint": true,
"super-admin": [],
"black-list": [],
"black-list-group": [],
"setting-restrict": 3,
"auto_update": true,
"update-time": "04:25",
"clan_battle_mode": "web",
"show_jjc_solution": "url",
"gacha_on": false,
"gacha_private_on": false,
"jjc_consult": true,
"news_jp_official": true,
"news_jp_twitter": true,
"news_tw_official": true,
"news_cn_official": true,
"news_cn_bilibili": true,
"news_interval_auto": true,
"news_interval_minutes": 30,
"calender_region": "default",
......

需求笔记

其实这次真正实践主要发现几个问题/改进点,这里先记录下,可以以后讨论修改:

  • 网页端直接修改报刀(比如尾刀忘记报了,把普通刀报成尾刀了 ,但是BOSS已经凉了这种
  • 统计模块(伤害、出勤、出刀时间分布)
  • 关于不加群的工会成员、小号的统计问题,以及群内友会/退会老成员在“加入全部成员”后的退出问题。
  • 阵容仓库自动化?(存疑
  • 识别截图自动报刀
  • BOSS报伤系统(自报各个阵容模拟战伤害,辅助排刀
  • 筛刀系统(多个伤害选一个
  • 排刀自动提醒(可以用预约BOSS的机制

另有JJC分服查询问题?

csrf_token invalid error

当从旧版yobot升级到新版本时,网页登录时会遇到此问题。发现是由于浏览器缓存导致JavaScript的代码未被及时更新,导致js发包中未包含csrf_token字段从而导致错误。希望通过加入随机数等方法强制刷新js资源避免浏览器缓存导致的错误。

执行 pip3 install -r src/client/requirements.txt 报错

# python3 -V
Python 3.8.2
# pip3 -V
pip 20.0.2 from /usr/local/python3/lib/python3.8/site-packages/pip (python 3.8)

安装依赖的时候报错
pip3 install -r src/client/requirements.txt

Looking in indexes: http://mirrors.aliyun.com/pypi/simple/
Collecting APScheduler~=3.6.3
  Downloading http://mirrors.aliyun.com/pypi/packages/f3/34/9ef20ed473c4fd2c3df54ef77a27ae3fc7500b16b192add4720cab8b2c09/APScheduler-3.6.3-py2.py3-none-any.whl (58 kB)
     |████████████████████████████████| 58 kB 4.7 MB/s 
Collecting requests~=2.22.0
  Downloading http://mirrors.aliyun.com/pypi/packages/51/bd/23c926cd341ea6b7dd0b2a00aba99ae0f828be89d72b2190f27c11d4b7fb/requests-2.22.0-py2.py3-none-any.whl (57 kB)
     |████████████████████████████████| 57 kB 72.9 MB/s 
Collecting aiohttp>=3.6.1
  Downloading http://mirrors.aliyun.com/pypi/packages/c2/f7/f0ad3dbace4762fef5d80aa4124b41bf218e4c4dd6d387a86cede707d9a4/aiohttp-3.6.2-py3-none-any.whl (441 kB)
     |████████████████████████████████| 441 kB 98.5 MB/s 
Collecting opencc-python-reimplemented~=0.1.5
  Downloading http://mirrors.aliyun.com/pypi/packages/53/0c/c499c86a719c925a08586085a56f92f3235c03ee8b4db2e59c1e9aab3f55/opencc-python-reimplemented-0.1.5.tar.gz (482 kB)
     |████████████████████████████████| 482 kB 99.1 MB/s 
    ERROR: Command errored out with exit status 1:
     command: /usr/local/python3/bin/python3.8 -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'/tmp/pip-install-39hm2htz/opencc-python-reimplemented/setup.py'"'"'; __file__='"'"'/tmp/pip-install-39hm2htz/opencc-python-reimplemented/setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' egg_info --egg-base /tmp/pip-install-39hm2htz/opencc-python-reimplemented/pip-egg-info
         cwd: /tmp/pip-install-39hm2htz/opencc-python-reimplemented/
    Complete output (11 lines):
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/usr/local/python3/lib/python3.8/site-packages/setuptools/__init__.py", line 20, in <module>
        from setuptools.dist import Distribution, Feature
      File "/usr/local/python3/lib/python3.8/site-packages/setuptools/dist.py", line 35, in <module>
        from setuptools import windows_support
      File "/usr/local/python3/lib/python3.8/site-packages/setuptools/windows_support.py", line 2, in <module>
        import ctypes
      File "/usr/local/python3/lib/python3.8/ctypes/__init__.py", line 7, in <module>
        from _ctypes import Union, Structure, Array
    ModuleNotFoundError: No module named '_ctypes'
    ----------------------------------------
ERROR: Command errored out with exit status 1: python setup.py egg_info Check the logs for full command output.

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.