nonebot-plugin-osubot 6.18.0__py3-none-any.whl → 6.18.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.

Potentially problematic release.


This version of nonebot-plugin-osubot might be problematic. Click here for more details.

@@ -13,7 +13,7 @@ from ..schema.user import UnifiedUser
13
13
  from ..schema import SeasonalBackgrounds
14
14
  from ..api import safe_async_get, get_seasonal_bg
15
15
  from .static import Path, Image, Stars, ColorArr, np, osufile
16
- from ..file import map_path, download_osu, get_projectimg, user_cache_path
16
+ from ..file import map_path, download_osu, get_projectimg, user_cache_path, team_cache_path
17
17
 
18
18
 
19
19
  def draw_fillet(img, radii):
@@ -268,6 +268,18 @@ async def update_icon(info: UnifiedUser):
268
268
  with open(path / f"icon.{info.avatar_url.split('.')[-1]}", "wb") as f:
269
269
  f.write(user_icon.getvalue())
270
270
 
271
+ team_path = team_cache_path / f"{info.team.id}.png"
272
+ if team_path.exists():
273
+ modified_time = team_path.stat().st_mtime
274
+ modified_datetime = datetime.datetime.fromtimestamp(modified_time)
275
+ time_diff = datetime.datetime.now() - modified_datetime
276
+ # 判断文件是否创建超过一天
277
+ if time_diff > datetime.timedelta(days=1):
278
+ team_path.unlink()
279
+ team_icon = await get_projectimg(info.team.flag_url)
280
+ with open(team_path, "wb") as f:
281
+ f.write(team_icon.getvalue())
282
+
271
283
 
272
284
  async def update_map(set_id, map_id):
273
285
  path = map_path / str(set_id)
@@ -31,6 +31,8 @@ if not user_cache_path.exists():
31
31
  user_cache_path.mkdir(parents=True, exist_ok=True)
32
32
  if not badge_cache_path.exists():
33
33
  badge_cache_path.mkdir(parents=True, exist_ok=True)
34
+ if not team_cache_path.exists():
35
+ team_cache_path.mkdir(parents=True, exist_ok=True)
34
36
 
35
37
 
36
38
  async def download_map(setid: int) -> Optional[Path]:
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.1
2
2
  Name: nonebot-plugin-osubot
3
- Version: 6.18.0
3
+ Version: 6.18.1
4
4
  Summary: OSUbot in NoneBot2
5
5
  License: AGPL-3.0
6
6
  Author-email: yaowan233 <572473053@qq.com>
@@ -49,9 +49,9 @@ nonebot_plugin_osubot/draw/templates/bpa_chart.html,sha256=cnpM0qRvvyCMTRP-mIOAB
49
49
  nonebot_plugin_osubot/draw/templates/echarts.min.js,sha256=IF32ooP8NPIzQg_fs7lVHpwG92JcCPE1TZAEyFSgGZU,1022939
50
50
  nonebot_plugin_osubot/draw/templates/mod_chart.html,sha256=Iz71KM5v9z_Rt2vqJ5WIZumRIHgDfcGIUmWGvVGZ-nQ,1508
51
51
  nonebot_plugin_osubot/draw/templates/pp_rank_line_chart.html,sha256=Gyf-GR8ZBlWQTks0TlB3M8EWUBMVwiUaesFAmDISxLo,1417
52
- nonebot_plugin_osubot/draw/utils.py,sha256=zBiT-MJ4OR0atzTeto2yWE65DCDoIFObHfIPV_Qz-XM,13630
52
+ nonebot_plugin_osubot/draw/utils.py,sha256=mwP_wTnuRnp9FrlCqUFvCX2p0_Lm5jQ73PgjjhtF6EA,14205
53
53
  nonebot_plugin_osubot/exceptions.py,sha256=N_FsEk-9Eu2QnuznhdfWn6OoyA1HH73Q7bUaY89gVi0,40
54
- nonebot_plugin_osubot/file.py,sha256=95EbyBYGs50Rh5BYztdvkaOWMKITJbRihbzJ9L4OTNY,4291
54
+ nonebot_plugin_osubot/file.py,sha256=GhG54EdVsxFf8_8GZOPh4YGvw9iw5bAX9JFz4Mg4kMg,4379
55
55
  nonebot_plugin_osubot/info/__init__.py,sha256=I7YlMQiuHExEeJWqyzZb2I-Vl2uql3Py2LdhSH2Z9N0,136
56
56
  nonebot_plugin_osubot/info/bg.py,sha256=Icua4bS38k0c-WbLUjhfS4IXOF83bgyu_oa2HwX4ZEQ,1541
57
57
  nonebot_plugin_osubot/info/bind.py,sha256=b2ua625hbYym7rpb-kLBB-VDP5YWFdmT5RweM58ggWw,4934
@@ -403,6 +403,6 @@ nonebot_plugin_osubot/schema/sayo_beatmap.py,sha256=lS1PQZ-HvHl0VhkzlI0-pNLeJrLY
403
403
  nonebot_plugin_osubot/schema/score.py,sha256=zHU-w2e7RzMDL8vdPkX5vggcqalBo83JTvu96abcflo,3124
404
404
  nonebot_plugin_osubot/schema/user.py,sha256=sxNmqymG_kIVuGuzfchSv9UML6NPG70cqo2_h5xDIpM,2250
405
405
  nonebot_plugin_osubot/utils/__init__.py,sha256=pyv8XxBcCOeQVDj1E4dgvktzcefgQXfKBlarsYGx1sg,815
406
- nonebot_plugin_osubot-6.18.0.dist-info/WHEEL,sha256=B19PGBCYhWaz2p_UjAoRVh767nYQfk14Sn4TpIZ-nfU,87
407
- nonebot_plugin_osubot-6.18.0.dist-info/METADATA,sha256=xgQuB2Jb78tVlv97ni9G8BPFyEBzUcqx7vxg6Qfhnr0,4476
408
- nonebot_plugin_osubot-6.18.0.dist-info/RECORD,,
406
+ nonebot_plugin_osubot-6.18.1.dist-info/WHEEL,sha256=B19PGBCYhWaz2p_UjAoRVh767nYQfk14Sn4TpIZ-nfU,87
407
+ nonebot_plugin_osubot-6.18.1.dist-info/METADATA,sha256=8mVJgIDqkt_Ps9LK9i018HXK-OfPLmJri2RmJp15wZk,4476
408
+ nonebot_plugin_osubot-6.18.1.dist-info/RECORD,,