Compare commits

..

4 Commits
1.2.4 ... 1.2.6

Author SHA1 Message Date
c9f6817c6a 🔖 1.2.6 2024-05-15 08:56:46 +08:00
4c7cd00a76 🐛 修复 histories 只有一条时推算数据出现除数为0的bug 2024-05-15 08:56:22 +08:00
b8cf10b45d 🔖 1.2.5 2024-05-15 04:43:30 +08:00
4ec5c3bde1 🐛 修复 TETR.IO 大写用户名查询失败 2024-05-15 04:42:27 +08:00
3 changed files with 5 additions and 4 deletions

View File

@@ -43,7 +43,7 @@ class Player:
if self.user_id is not None:
return self.user_id
if self.user_name is not None:
return self.user_name
return self.user_name.lower()
msg = 'Invalid user'
raise ValueError(msg)

View File

@@ -172,9 +172,10 @@ async def query_historical_data(user: User, user_info: UserInfoSuccess) -> list[
# 按照时间排序
histories = sorted(histories, key=lambda x: x.record_at)
print(histories)
for index, value in enumerate(histories):
# 在历史记录里找有没有今天0点后的数据
if value.record_at > today:
# 在历史记录里找有没有今天0点后的数据, 并且至少要有两个数据点
if value.record_at > today and len(histories) >= 2: # noqa: PLR2004
histories = histories[:index] + [
get_specified_point(histories[index - 1], histories[index], today.replace(microsecond=1000))
]

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = 'nonebot-plugin-tetris-stats'
version = '1.2.4'
version = '1.2.6'
description = '一款基于 NoneBot2 的用于查询 Tetris 相关游戏数据的插件'
authors = ['scdhh <wallfjjd@gmail.com>']
readme = 'README.md'