Giter Club home page Giter Club logo

amiya-bot's People

Contributors

haukuen avatar hsyhhssyy avatar initial-heart-1 avatar vivien8261 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

amiya-bot's Issues

运行amiya.py时报错

求助大佬
PS C:\Files\lzy的bot\amiya\Amiya-Bot> python amiya.py
loading tags data...
Building prefix dict from the default dictionary ...
Loading model from cache C:\Users\ADMINI~1\AppData\Local\Temp\2\jieba.cache
Loading model cost 1.474 seconds.
Prefix dict has been built successfully.
loading operators data...
loading materials data...
Traceback (most recent call last):
File "C:\Files\lzy的bot\amiya\Amiya-Bot\amiya.py", line 4, in
from modules.network.websocketClient import Websocket
File "C:\Files\lzy的bot\amiya\Amiya-Bot\modules\network\websocketClient.py", line 7, in
from message.messageHandler import MessageHandler
File "C:\Files\lzy的bot\amiya\Amiya-Bot\message\messageHandler.py", line 7, in
from message.replies import reply_func_list
File "C:\Files\lzy的bot\amiya\Amiya-Bot\message\replies_init_.py", line 5, in
from .emotion import emotion
File "C:\Files\lzy的bot\amiya\Amiya-Bot\message\replies\emotion.py", line 8, in
amiya_name = database.config.get_amiya_name()
File "C:\Files\lzy的bot\amiya\Amiya-Bot\database\controller\configController.py", line 16, in get_amiya_name
self.get_config('amiya_name', 'good_name', True)['config_values'].split(','),
TypeError: 'NoneType' object is not subscriptable

[Bug]在 mysql 下 console 查询群组列表会出错

在 Console 中回报了一个 500 错误(Internal Server Error)
在控制台中(已脱敏):

[2022-03-27 20:42:44][INFO] Server.access - ***** - POST /group/getGroupByPages HTTP/1.1 500 Internal Server Error
[2022-03-27 20:42:44][INFO] Server.default - Exception in ASGI application
Traceback (most recent call last):
  File "***\Python37\lib\site-packages\peewee.py", line 3177, in execute_sql
    cursor.execute(sql, params or ())
  File "***\Python37\lib\site-packages\pymysql\cursors.py", line 148, in execute
    result = self._query(query)
  File "***\Python37\lib\site-packages\pymysql\cursors.py", line 310, in _query
    conn.query(q)
  File "***\Python37\lib\site-packages\pymysql\connections.py", line 548, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "***\Python37\lib\site-packages\pymysql\connections.py", line 775, in _read_query_result
    result.read()
  File "***\Python37\lib\site-packages\pymysql\connections.py", line 1156, in read
    first_packet = self.connection._read_packet()
  File "***\Python37\lib\site-packages\pymysql\connections.py", line 725, in _read_packet
    packet.raise_for_error()
  File "***\Python37\lib\site-packages\pymysql\protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "***\Python37\lib\site-packages\pymysql\err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.ProgrammingError: (1064, 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'"group" g                  left join group_active g2 on g.group_id = g2.group_id\' at line 1')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "***\Python37\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 366, in run_asgi
    result = await app(self.scope, self.receive, self.send)
  File "***\Python37\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 75, in __call__
    return await self.app(scope, receive, send)
  File "***\Python37\lib\site-packages\fastapi\applications.py", line 208, in __call__
    await super().__call__(scope, receive, send)
  File "***\Python37\lib\site-packages\starlette\applications.py", line 112, in __call__
    await self.middleware_stack(scope, receive, send)
  File "***\Python37\lib\site-packages\starlette\middleware\errors.py", line 181, in __call__
    raise exc
  File "***\Python37\lib\site-packages\starlette\middleware\errors.py", line 159, in __call__
    await self.app(scope, receive, _send)
  File "***\Python37\lib\site-packages\starlette\middleware\cors.py", line 92, in __call__
    await self.simple_response(scope, receive, send, request_headers=headers)
  File "***\Python37\lib\site-packages\starlette\middleware\cors.py", line 147, in simple_response
    await self.app(scope, receive, send)
  File "***\Python37\lib\site-packages\starlette\exceptions.py", line 82, in __call__
    raise exc
  File "***\Python37\lib\site-packages\starlette\exceptions.py", line 71, in __call__
    await self.app(scope, receive, sender)
  File "***\Python37\lib\site-packages\starlette\routing.py", line 656, in __call__
    await route.handle(scope, receive, send)
  File "***\Python37\lib\site-packages\starlette\routing.py", line 259, in handle
    await self.app(scope, receive, send)
  File "***\Python37\lib\site-packages\starlette\routing.py", line 61, in app
    response = await func(request)
  File "***\Python37\lib\site-packages\fastapi\routing.py", line 227, in app
    dependant=dependant, values=values, is_coroutine=is_coroutine
  File "***\Python37\lib\site-packages\fastapi\routing.py", line 159, in run_endpoint_function
    return await dependant.call(**values)
  File "***\AmiyaBot\interfaces\group.py", line 82, in get_group_by_pages
    res = group.execute_sql(sql).fetchall()
  File "***\Python37\lib\site-packages\peewee.py", line 3184, in execute_sql
    self.commit()
  File "***\Python37\lib\site-packages\peewee.py", line 2950, in __exit__
    reraise(new_type, new_type(exc_value, *exc_args), traceback)
  File "***\Python37\lib\site-packages\peewee.py", line 191, in reraise
    raise value.with_traceback(tb)
  File "***\Python37\lib\site-packages\peewee.py", line 3177, in execute_sql
    cursor.execute(sql, params or ())
  File "***\Python37\lib\site-packages\pymysql\cursors.py", line 148, in execute
    result = self._query(query)
  File "***\Python37\lib\site-packages\pymysql\cursors.py", line 310, in _query
    conn.query(q)
  File "***\Python37\lib\site-packages\pymysql\connections.py", line 548, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "***\Python37\lib\site-packages\pymysql\connections.py", line 775, in _read_query_result
    result.read()
  File "***\Python37\lib\site-packages\pymysql\connections.py", line 1156, in read
    first_packet = self.connection._read_packet()
  File "***\Python37\lib\site-packages\pymysql\connections.py", line 725, in _read_packet
    packet.raise_for_error()
  File "***\Python37\lib\site-packages\pymysql\protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "***\Python37\lib\site-packages\pymysql\err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
peewee.ProgrammingError: (1064, 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'"group" g                  left join group_active g2 on g.group_id = g2.group_id\' at line 1')

在 phpMyAdmin 中直接执行相同的语句,报错与底部信息一致
此 Bug 可以稳定复现

MySQL 版本:8.0.28 - MySQL Community Server - GPL
协议版本: 10
数据库客户端版本: libmysql - mysqlnd 8.1.2

Amiya 版本:Clone 仓库,确定同步了最新的更改

建议优化操作逻辑

现在很多功能需要也只能“两步走”,也就是先唤出列表再回复序号
建议是可以选择直接带上序号来一次查询
比如我要查莫斯提马的某档案,我可以直接用
阿米娅莫斯提马档案[列表中的序号]
而不是
阿米娅莫斯提马档案
[列表中的序号]
在相对大量的数据查询时,这会更加方便,也更节省资源

访问网页控制台报Internal Server Error错误

操作系统:windows10
软件版本:AmiyaBot-v5.0.5.exe
启动方式:浏览器访问127.0.0.1:5000

错误日志:
[2022-03-09 08:32:56][INFO] Server.access - 127.0.0.1:6899 - GET / HTTP/1.1 500 Internal Server Error
[2022-03-09 08:33:01][INFO] Server.default - Exception in ASGI application
Traceback (most recent call last):
File "uvicorn\protocols\http\h11_impl.py", line 364, in run_asgi
File "uvicorn\middleware\proxy_headers.py", line 75, in call
File "fastapi\applications.py", line 208, in call
File "starlette\applications.py", line 112, in call
File "starlette\middleware\errors.py", line 181, in call
File "starlette\middleware\errors.py", line 159, in call
File "starlette\middleware\cors.py", line 84, in call
File "starlette\exceptions.py", line 82, in call
File "starlette\exceptions.py", line 71, in call
File "starlette\routing.py", line 656, in call
File "starlette\routing.py", line 259, in handle
File "starlette\routing.py", line 61, in app
File "fastapi\routing.py", line 226, in app
File "fastapi\routing.py", line 159, in run_endpoint_function
File "core\network\httpServer_init_.py", line 81, in index
File "starlette\templating.py", line 89, in TemplateResponse
File "starlette\templating.py", line 76, in get_template
File "jinja2\environment.py", line 997, in get_template
File "jinja2\environment.py", line 958, in _load_template
File "jinja2\loaders.py", line 125, in load
File "jinja2\loaders.py", line 214, in get_source
jinja2.exceptions.TemplateNotFound: index.html

TypeError: 'NoneType' object is not subscriptable

OS: ubuntu 18.04 aliyunserver
python version: 3.7.5
mysql version: 8.0.23 for Linux on x86_64 (MySQL Community Server - GPL)
mirai: 自部署,使用mcl工具独立运行,并安装mirai-api-http

已完成资源导入,依赖安装,config也已修改为本机配置,第四步时出现如下问题

$ python3 amiya.py
Traceback (most recent call last):
  File "amiya.py", line 8, in <module>
    from message.messageHandler import MessageHandler
  File "/home/nsc-root/Amiya-Bot/message/messageHandler.py", line 10, in <module>
    from message.replies import Replies
  File "/home/nsc-root/Amiya-Bot/message/replies/__init__.py", line 2, in <module>
    from .emotion import emotion
  File "/home/nsc-root/Amiya-Bot/message/replies/emotion.py", line 8, in <module>
    amiya_name = database.config.get_amiya_name()
  File "/home/nsc-root/Amiya-Bot/database/controller/configController.py", line 16, in get_amiya_name
    self.get_config('amiya_name', 'good_name', True)['config_values'].split(','),
TypeError: 'NoneType' object is not subscriptable
$ python3 quickStart.py Test
Traceback (most recent call last):
  File "quickStart.py", line 3, in <module>
    from message.messageHandler import MessageHandler
  File "/home/nsc-root/Amiya-Bot/message/messageHandler.py", line 10, in <module>
    from message.replies import Replies
  File "/home/nsc-root/Amiya-Bot/message/replies/__init__.py", line 2, in <module>
    from .emotion import emotion
  File "/home/nsc-root/Amiya-Bot/message/replies/emotion.py", line 8, in <module>
    amiya_name = database.config.get_amiya_name()
  File "/home/nsc-root/Amiya-Bot/database/controller/configController.py", line 16, in get_amiya_name
    self.get_config('amiya_name', 'good_name', True)['config_values'].split(','),
TypeError: 'NoneType' object is not subscriptable

资源无法更新到最新

私聊中输入 强制更新 后 依旧无法更新下载失败的资源文件
QQ截图20220122001918

已有的资源文件似乎很旧
2YUJ(A`H V)I0$LR39GJ4

尝试手动从 https://github.com/yuanyan3060/Arknights-Bot-Resource 此处下载资源文件替换(似乎文件夹名字有点不一样,自己手动改了下),依旧不是最新版

找了半天 没找到其他资源的下载地址,请问如何手动使资源更新到最新?

亿些功能建议和小问题

以下是部署项目近三个月以来收集的一些经用户反馈与我筛选认为需要优化的问题。

1.优化干员相关资料查询

1.1 优化干员档案查询

现在,想要查询一个干员的档案需要的操作比较复杂,如果想要查询一个干员的所有档案资料是非常繁琐的,但单独查询大多数时候并没有意义。
建议由需要一项项查询档案改为一次性呼出。
从用户角度看,应该是这样:
阿米娅查看(干员名称)(档案标题)x N → 阿米娅查看(干员名称)的档案资料(此处合并前 x N 次指令的输出结果

1.2 优化干员立绘(皮肤)查询

如果想查询某干员的精一或精二立绘,可以直接使用“精一/精二”作为关键词而非现在的“精英一/精英二”,查询皮肤可直接使用皮肤名称检索而非先呼出阿米娅,查找皮肤列表后使用“阿米娅查看(干员名)第 N 个立绘”来检索。

1.3 优化干员语音查询

如果想查询某干员的语音,在未检索到语音标题时返回语音列表以供检索。

1.4 优化干员晋级材料查询

如果想查询某干员的晋级材料,提供一个指令查询将该干员升级至满配需要多少材料。

例如指令为:阿米娅查询银灰满配材料
返回:
全技能专三总共需要的材料
一技能专三总共需要的材料
二技能专三总共需要的材料
三技能专三总共需要的材料

(这是一个新功能)1.5 干员生日查询、订阅

详见 #40

2.优化模拟抽卡相关功能

2.1 优化模拟抽卡卡池列表

很多时候,用户不会去刻意记忆某卡池的名称(我相信你也不会)
所以,建议在卡池列表的返回数据中添加当期 up 的干员名称,以便检索。

2.2(请注意,这是一个新功能建议)添加模拟抽卡抽卡记录

顾名思义,加个干员盒子,记录用户抽取到的干员及潜能数,供用户查询。
我的实现思路:
大家都知道,每一个干员都有一个唯一的数字 id,那么,在数据库用户表中添加一个字段,记录每个用户抽取到的干员 id,潜能可以另开亿个字段记下来。
那么可以在用户抽卡时对抽卡结果进行处理(可能会导致结果返回延迟较高),或者采用延迟处理,先将用户的抽卡数据缓存,在闲时(每分钟消息量小于一个数值)时处理数据并操作数据库。
查询时,提出这个建议的人是这么设想的:
在返回开头列出现有的总干员数量,然后列出六星、五星、四星的数量
然后将所有干员的头像排好,获得了的点亮为彩色,没有获得的干员头像黑白
我个人再加一点:查询也需要消耗寻访凭证。不然服务器扛不住啊扛不住

3.(请注意,这个是我自己提的)别名识别添加审核可选择 Amiya 私聊与全局应用该别名

理由是,console 对小屏设备太太太太不友好了......(或许可以开坑移动适配?)
然后就是,方便
还有就是,建议顺便加个寻访凭证奖励,鼓励用户当工具人添加别名
另外,在记录审核请求时,记得全局查重,以免一打开后台一半重复的

(请注意,此处大多为新功能)4.其他数值查询与计算

详见 #40

Bug:有时会漏掉维护

发生了什么一概不知,没有报错,但是就是漏了
天知道为什么,TMD
只知道没有维护完成的提示

亿点点功能

1免兔计算狗粮功能
1.1 计算干员升级所需的狗粮和龙门币数量
输入0~90级需要多少高级/中级/低级/基础作战记录(后期可以简化关键字呼叫)输出需要12004 (瞎编的数字)高级作战记录
1.2换算狗粮之间的数量
输入兔兔1高级等于多少中级/低级/基础
输出计算结果(狗粮数量和龙门币数量)
2查询干员专三到一级技能数值,希望实现-个查看 -一个技能全部数值而且是一个图浏览输入查看单个技能数值
例如:兔兔查看42三技能数值
输出结果
三技能一级数值贴图
三技能二级数值贴图
三技能三级数值贴图
以此类推到专三
全部合并成一-图查看
3查看半个月之内的方舟频道热门前十视频
输入前十热门明日方舟视频个人认为缩写前十视频的关键词就可以了
输出前十视频名单
格式:标题+bv号
top1视频格式
top2视频格式
top3视频格式
以此类推
4兔兔关于干员生日功能的部分
4.1是查看这个月/这天干员生日
输入兔免这个月有谁生日
输出,渲染- -张这个月的日历,上面标记干员生日具体日期
输入免兔今天有谁生日
输出,回复今天(写上今天日期, 1.22) 42生日,送上祝福台词
多个干员生日同一天情况, 安哲拉,空弦生日,祝福台词
4.2查看干员生日
输入兔兔42生日几号
输出42生日1.22
4.3订阅干员生日功能,订阅之后,到期时推送信息
输入兔兔订阅42生日(可以优化-下订阅台词)
输出,艾特订阅用户,提醒今天42生日

关于公招功能的功能与接口分享

或许可以让Amy增加一个公招分析功能?

我自己找了一个公招分析的数据接口
但是,我不会写qaq
(菜鸡爬了)
这里希望Amy能实现这个功能

接口

https://www.bigfun.cn/static/aktools/【最新版本】/data/akhr.json
其中的最新版本要从bigfun明日方舟工具箱获取
我使用正则来获取
<script src="/static/aktools/(\d+)/js/runtime-es2015.js" type="module">

想法

因为一般玩家对公招三星的结果不感兴趣
或许功能应该返回必出四星的tags组合

补充

在2020/12/12晚7点时
最新版本为1604978022

重启命令问题

私聊重启关了就开不了了,直接贴日志
Amiya控制台日志

Amiya-Bot-master\Amiya-Bot-master>python amiya.py
[2021-09-05 01:10:22][Info] Starting AmiyaBot...
[2021-09-05 01:10:22][Info] Init http session: *******
[2021-09-05 01:10:22][Info] Release session: *******
[2021-09-05 01:10:22][Info] Checking update...
[2021-09-05 01:10:22][Info] Version is up to date: 21.7.0
[2021-09-05 01:10:24][Info] Building operator's materials keywords dict...
[2021-09-05 01:10:24][Info] Building operator's stories keywords dict...
[2021-09-05 01:10:24][Info] Building operator's skins keywords dict...
[2021-09-05 01:10:25][Info] Building material's names keywords dict...
[2021-09-05 01:10:25][Info] Building operator's tags keywords dict...
[2021-09-05 01:10:25][Info] Building enemies's names keywords dict...
[2021-09-05 01:10:25][Info] AmiyaBot ready to connect, starting used 2 sec.
[2021-09-05 01:10:25][Info] Init websocket session: *******
[2021-09-05 01:10:25][Info] Websocket connect succeeded.

Amiya-Bot-master\Amiya-Bot-master>C:\Program: can't open file 'Files\Python37\python.exe': [Errno 2] No such file or directory

mcl日志

2021-09-05 01:10:05 V/Bot.: Initial heart() -> 重启
2021-09-05 01:10:06 V/Bot.: Event: FriendMessagePreSendEvent(target=Friend(), message=即将重新启动...)
2021-09-05 01:10:06 V/Bot.: Friend() <- 即将重新启动...
2021-09-05 01:10:06 V/Bot.: Event: FriendMessagePostSendEvent(target=Friend(), message=即将重新启动..., exception=null, receipt=net.mamoe.mirai.message.MessageReceipt@*)

.

希望兔妈能够在项目根目录下加入存有当前版本号的文件

[Bug]在 mysql 下 console 查询群组列表会出错

在 Console 中回报了一个 500 错误(Internal Server Error)
在控制台中(已脱敏):

[2022-03-27 20:42:44][INFO] Server.access - ***** - POST /group/getGroupByPages HTTP/1.1 500 Internal Server Error
[2022-03-27 20:42:44][INFO] Server.default - Exception in ASGI application
Traceback (most recent call last):
  File "***\Python37\lib\site-packages\peewee.py", line 3177, in execute_sql
    cursor.execute(sql, params or ())
  File "***\Python37\lib\site-packages\pymysql\cursors.py", line 148, in execute
    result = self._query(query)
  File "***\Python37\lib\site-packages\pymysql\cursors.py", line 310, in _query
    conn.query(q)
  File "***\Python37\lib\site-packages\pymysql\connections.py", line 548, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "***\Python37\lib\site-packages\pymysql\connections.py", line 775, in _read_query_result
    result.read()
  File "***\Python37\lib\site-packages\pymysql\connections.py", line 1156, in read
    first_packet = self.connection._read_packet()
  File "***\Python37\lib\site-packages\pymysql\connections.py", line 725, in _read_packet
    packet.raise_for_error()
  File "***\Python37\lib\site-packages\pymysql\protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "***\Python37\lib\site-packages\pymysql\err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.ProgrammingError: (1064, 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'"group" g                  left join group_active g2 on g.group_id = g2.group_id\' at line 1')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "***\Python37\lib\site-packages\uvicorn\protocols\http\h11_impl.py", line 366, in run_asgi
    result = await app(self.scope, self.receive, self.send)
  File "***\Python37\lib\site-packages\uvicorn\middleware\proxy_headers.py", line 75, in __call__
    return await self.app(scope, receive, send)
  File "***\Python37\lib\site-packages\fastapi\applications.py", line 208, in __call__
    await super().__call__(scope, receive, send)
  File "***\Python37\lib\site-packages\starlette\applications.py", line 112, in __call__
    await self.middleware_stack(scope, receive, send)
  File "***\Python37\lib\site-packages\starlette\middleware\errors.py", line 181, in __call__
    raise exc
  File "***\Python37\lib\site-packages\starlette\middleware\errors.py", line 159, in __call__
    await self.app(scope, receive, _send)
  File "***\Python37\lib\site-packages\starlette\middleware\cors.py", line 92, in __call__
    await self.simple_response(scope, receive, send, request_headers=headers)
  File "***\Python37\lib\site-packages\starlette\middleware\cors.py", line 147, in simple_response
    await self.app(scope, receive, send)
  File "***\Python37\lib\site-packages\starlette\exceptions.py", line 82, in __call__
    raise exc
  File "***\Python37\lib\site-packages\starlette\exceptions.py", line 71, in __call__
    await self.app(scope, receive, sender)
  File "***\Python37\lib\site-packages\starlette\routing.py", line 656, in __call__
    await route.handle(scope, receive, send)
  File "***\Python37\lib\site-packages\starlette\routing.py", line 259, in handle
    await self.app(scope, receive, send)
  File "***\Python37\lib\site-packages\starlette\routing.py", line 61, in app
    response = await func(request)
  File "***\Python37\lib\site-packages\fastapi\routing.py", line 227, in app
    dependant=dependant, values=values, is_coroutine=is_coroutine
  File "***\Python37\lib\site-packages\fastapi\routing.py", line 159, in run_endpoint_function
    return await dependant.call(**values)
  File "***\AmiyaBot\interfaces\group.py", line 82, in get_group_by_pages
    res = group.execute_sql(sql).fetchall()
  File "***\Python37\lib\site-packages\peewee.py", line 3184, in execute_sql
    self.commit()
  File "***\Python37\lib\site-packages\peewee.py", line 2950, in __exit__
    reraise(new_type, new_type(exc_value, *exc_args), traceback)
  File "***\Python37\lib\site-packages\peewee.py", line 191, in reraise
    raise value.with_traceback(tb)
  File "***\Python37\lib\site-packages\peewee.py", line 3177, in execute_sql
    cursor.execute(sql, params or ())
  File "***\Python37\lib\site-packages\pymysql\cursors.py", line 148, in execute
    result = self._query(query)
  File "***\Python37\lib\site-packages\pymysql\cursors.py", line 310, in _query
    conn.query(q)
  File "***\Python37\lib\site-packages\pymysql\connections.py", line 548, in query
    self._affected_rows = self._read_query_result(unbuffered=unbuffered)
  File "***\Python37\lib\site-packages\pymysql\connections.py", line 775, in _read_query_result
    result.read()
  File "***\Python37\lib\site-packages\pymysql\connections.py", line 1156, in read
    first_packet = self.connection._read_packet()
  File "***\Python37\lib\site-packages\pymysql\connections.py", line 725, in _read_packet
    packet.raise_for_error()
  File "***\Python37\lib\site-packages\pymysql\protocol.py", line 221, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "***\Python37\lib\site-packages\pymysql\err.py", line 143, in raise_mysql_exception
    raise errorclass(errno, errval)
peewee.ProgrammingError: (1064, 'You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near \'"group" g                  left join group_active g2 on g.group_id = g2.group_id\' at line 1')

在 phpMyAdmin 中直接执行相同的语句,报错与底部信息一致
此 Bug 可以稳定复现

MySQL 版本:8.0.28 - MySQL Community Server - GPL
协议版本: 10
数据库客户端版本: libmysql - mysqlnd 8.1.2

Amiya 版本:Clone 仓库,确定同步了最新的更改

建议添加更多小游戏

现在的小游戏太少了,用户们都说不带劲
所以,多搞点(
比如,猜干员立绘模糊(
(其他小游戏我脑子不够用想不出来

无法下载干员语音

emmm不知道是不是我自己的问题。
这里的url,少了http:,导致后面语音下载失败。我试了下切到原版的上面也是同样的问题,手动加上http:之后就可以正常下载了

image
image

Bug:在运行amiya的时候出现Runtime Error

image

如图,Amiya-Bot-dev目录是从主仓库V5-master分支clone下来的,chromium已安装,版本信息如图,依赖已安装。

很离谱,今天上午在写新功能的时候一点事没有,然后等我尝试新建一个dev的git分支后,运行就出现了这个问题。然后我想看下主repo有没有这个问题,结果整下来,嘿,还是报错。

原因尚不清楚,在查询之后我认为是asyncio.run会自动关闭loop,当我尝试直接使用loop的run_until_complete时,更离谱了,Pycharm的exit code是1,也就是说虽然没有报错,但是程序异常终止了,btw?

附上报错信息:

Exception ignored in: <function _ProactorBasePipeTransport.__del__ at 0x0000027122CB6AF0>
Traceback (most recent call last):
 File "C:\Users\FogFo.conda\envs\amiya-run\lib\asyncio\proactor_events.py", line 116, in __del__
  self.close()
 File "C:\Users\FogFo.conda\envs\amiya-run\lib\asyncio\proactor_events.py", line 108, in close
  self._loop.call_soon(self._call_connection_lost, None)
 File "C:\Users\FogFo.conda\envs\amiya-run\lib\asyncio\base_events.py", line 719, in call_soon
  self._check_closed()
 File "C:\Users\FogFo.conda\envs\amiya-run\lib\asyncio\base_events.py", line 508, in _check_closed
  raise RuntimeError('Event loop is closed')
RuntimeError: Event loop is closed

建议优化干员数据查询

貌似现在只能获得精二90级的数据
image
所以建议添加一个新命令来查询精一和精二,不同等级,不同潜能的数据
数据来源似乎有很多,可以随便找一个

最新版出现报错

root@localhost:~/Amiya-Bot# python3 amiya.py 
[2022-01-09 00:31:40][INFO] Starting AmiyaBot...
[2022-01-09 00:31:40][INFO] Init http session: TA5hE872
[2022-01-09 00:31:40][INFO] Release session: TckLvaHM
[2022-01-09 00:31:40][INFO] Checking GameData update...
[2022-01-09 00:31:40][INFO] GameData version is up to date: 24.2.0
[2022-01-09 00:31:40][INFO] [=========================] 100% 15/15 (15 TT, 15 OK, 0 NG) <gameData>
[2022-01-09 00:31:40][INFO] Checking Console update...
[2022-01-09 00:31:41][INFO] Console version is up to date: 1637233491718
[2022-01-09 00:31:41][INFO] [=========================] 100% 16/16 (16 TT, 16 OK, 0 NG) <console>
[2022-01-09 00:31:41][INFO] [=========================] 100% 16/16 (16 TT, 16 OK, 0 NG) <face>
[2022-01-09 00:31:41][INFO] [=========================] 100% 3/3 (3 TT, 3 OK, 0 NG) <style>
[2022-01-09 00:31:41][INFO] [=========================] 100% 8/8 (8 TT, 8 OK, 0 NG) <class>
[2022-01-09 00:31:41][INFO] [=========================] 100% 7/7 (7 TT, 7 OK, 0 NG) <gacha>
[2022-01-09 00:31:41][INFO] [=========================] 100% 2/2 (2 TT, 2 OK, 0 NG) <database>
[2022-01-09 00:31:41][INFO] [=========================] 100% 70/70 (13 TT, 13 OK, 0 NG) <AmiyaVoices>
[2022-01-09 00:31:42][INFO] [                         ] 0% 0/225 (0 TT, 0 OK, 0 NG) <operators>Traceback (most recent call last):
  File "/root/Amiya-Bot/amiya.py", line 42, in <module>
    amiya = Main()
  File "/root/Amiya-Bot/amiya.py", line 19, in __init__    self.handlers = Handlers(self)
  File "/root/Amiya-Bot/handlers/handleMessage.py", line 19, in __init__
    super().__init__(bot)
  File "/root/Amiya-Bot/handlers/functions/__init__.py", line 23, in __init__
    self.arknights = Arknights(bot)
  File "/root/Amiya-Bot/handlers/functions/arknights/__init__.py", line 12, in __init__
    super().__init__(auto_update=True, check_assets=True)
  File "/root/Amiya-Bot/dataSource/__init__.py", line 31, in __init__
    self.download_operators_images(self.operators)
  File "/root/Amiya-Bot/dataSource/__init__.py", line 183, in download_operators_images
    res = self.get_pic(f'portrait/{item.id}_1', 'portraits')
  File "/root/Amiya-Bot/dataSource/sourceBank.py", line 66, in get_pic
    escape_name = name.repalce("#", "%23")
AttributeError: 'str' object has no attribute 'repalce'

建议简单记录每个用户的功能使用情况

这有助于分析筛选恶意用户并将其拉黑
简单记录:指记下谁用了,用了什么,什么时候用的,(指定时间段内)用了几次

能直接筛出恶意用户就最好了,把数据显著高于平均值的置顶显示什么的

毕竟OCR是付费的,免费额度多的一批的兔妈感受不到我们的痛

TypeError: 'NoneType' object is not subscriptable

运行 python amiya.py时报错,

Traceback (most recent call last):
  File "amiya.py", line 6, in <module>
    from message.messageHandler import MessageHandler
  File "H:\Amiya-Bot\message\messageHandler.py", line 7, in <module>
    from message.replies import reply_func_list
  File "H:\Amiya-Bot\message\replies\__init__.py", line 5, in <module>
    from .emotion import emotion
  File "H:\Amiya-Bot\message\replies\emotion.py", line 8, in <module>
    amiya_name = database.config.get_amiya_name()
  File "H:\Amiya-Bot\database\controller\configController.py", line 16, in get_amiya_name
    self.get_config('amiya_name', 'good_name', True)['config_values'].split(','),
TypeError: 'NoneType' object is not subscriptable

执行amiya.py时报错TypeError: 'bool' object is not subscriptable

具体日志如下:

loading tags data...
Building prefix dict from the default dictionary ...
Loading model from cache /tmp/jieba.cache
Loading model cost 1.088 seconds.
Prefix dict has been built successfully.
loading operators data...
loading materials data...
Traceback (most recent call last):
File "/root/amiya-bot/Amiya-Bot/amiya.py", line 23, in
start()
File "/root/amiya-bot/Amiya-Bot/amiya.py", line 11, in start
HttpRequests().init_session()
File "/root/amiya-bot/Amiya-Bot/modules/network/httpRequests.py", line 35, in init_session
session = response['session']
TypeError: 'bool' object is not subscriptable

AttributeError: 'Mysql' object has no attribute 'db'

OS:Windows 10
Python version:Python 3.8.2
MySQL version:mysql-8.0.23-winx64
使用Mirai 2.4.0-MCL 1.0.5
config.json已配置与本机相符
数据全部导入到amiya库中,使用查询命令后有返回结果

select * from t_config_amiya where config_name = "amiya_name" AND config_keyword = "good_name"

在第四步报错

>python amiya.py
Building prefix dict from the default dictionary ...
Loading model from cache C:\Users\ADMINI~1\AppData\Local\Temp\jieba.cache
Loading model cost 1.344 seconds.
Prefix dict has been built successfully.
Traceback (most recent call last):
  File "amiya.py", line 8, in <module>
    from message.messageHandler import MessageHandler
  File "G:\QQbot\Mirai\amiya-bot\Amiya-Bot\message\messageHandler.py", line 21, in <module>
    function = FunctionsIndex()
  File "G:\QQbot\Mirai\amiya-bot\Amiya-Bot\functions\functionsIndex.py", line 31, in __init__
    module = importlib.import_module(module_path, package='functions')
  File "D:\Python18\lib\importlib\__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "G:\QQbot\Mirai\amiya-bot\Amiya-Bot\functions\userInfo\init.py", line 8, in <module>
    database = BaseController()
  File "G:\QQbot\Mirai\amiya-bot\Amiya-Bot\database\baseController.py", line 21, in __init__
    self.comb = Mysql(base_config)
  File "G:\QQbot\Mirai\amiya-bot\Amiya-Bot\database\sqlCombiner.py", line 7, in __init__
    self.db = pymysql.connect(
  File "D:\Python18\lib\site-packages\pymysql\__init__.py", line 94, in Connect
    return Connection(*args, **kwargs)
  File "D:\Python18\lib\site-packages\pymysql\connections.py", line 327, in __init__
    self.connect()
  File "D:\Python18\lib\site-packages\pymysql\connections.py", line 587, in connect
    self._get_server_information()
  File "D:\Python18\lib\site-packages\pymysql\connections.py", line 969, in _get_server_information
    packet = self._read_packet()
  File "D:\Python18\lib\site-packages\pymysql\connections.py", line 676, in _read_packet
    packet.raise_for_error()
  File "D:\Python18\lib\site-packages\pymysql\protocol.py", line 223, in raise_for_error
    err.raise_mysql_exception(self._data)
  File "D:\Python18\lib\site-packages\pymysql\err.py", line 107, in raise_mysql_exception
    raise errorclass(errno, errval)
pymysql.err.OperationalError: (1040, 'ny connections')
Exception ignored in: <function Mysql.__del__ at 0x0000015996FF9430>
Traceback (most recent call last):
  File "G:\QQbot\Mirai\amiya-bot\Amiya-Bot\database\sqlCombiner.py", line 19, in __del__
    self.close()
  File "G:\QQbot\Mirai\amiya-bot\Amiya-Bot\database\sqlCombiner.py", line 124, in close
    self.db.close()
AttributeError: 'Mysql' object has no attribute 'db'

更新mirai后报错

所有包含兔兔/阿米娅的命令都会报错,反而带有驴子的指令可以正常使用
image

简单的问题

简单的不需要的新建issue的问题,可以在这里提问 (๑๑)

Bug:疫情查询出现问题

如题,疫情查询出现问题,目前确认问题在于疫情数据加载时(由于腾讯api格式问题,共两次json.loads,此次问题出现在第二次loads),正在尝试解决,在解决之前疫情查询功能可能不可用

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.