nonebot-plugin-splatoon3-schedule 2.0.2__tar.gz → 2.0.3__tar.gz

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.
Files changed (63) hide show
  1. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/PKG-INFO +1 -1
  2. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/__init__.py +8 -0
  3. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/data/data_source.py +2 -6
  4. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/image/image_processer.py +12 -4
  5. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/utils/utils.py +8 -8
  6. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/pyproject.toml +1 -1
  7. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/LICENSE +0 -0
  8. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/README.md +0 -0
  9. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/check.py +0 -0
  10. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/config.py +0 -0
  11. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/data/__init__.py +0 -0
  12. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/data/db_control.py +0 -0
  13. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/data/db_image.py +0 -0
  14. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/data/static_data_getter.py +0 -0
  15. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/image/__init__.py +0 -0
  16. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/image/image.py +0 -0
  17. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/image/image_processer_tools.py +0 -0
  18. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/10024.png +0 -0
  19. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/10025.ico +0 -0
  20. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/10026.png +0 -0
  21. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/AREA.png +0 -0
  22. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/CLAM.png +0 -0
  23. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/Cohozuna.png +0 -0
  24. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/GOAL.png +0 -0
  25. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/Horrorboros.png +0 -0
  26. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/LOFT.png +0 -0
  27. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/Megalodontia.png +0 -0
  28. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/Random.png +0 -0
  29. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/Ranked-Challenge.png +0 -0
  30. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/Ranked-Open.png +0 -0
  31. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/Ranked.png +0 -0
  32. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/Regular.png +0 -0
  33. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/TURF_WAR.png +0 -0
  34. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/Triumvirate.png +0 -0
  35. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/X.png +0 -0
  36. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/bg.png +0 -0
  37. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/bg2.png +0 -0
  38. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/bg3.png +0 -0
  39. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/big_run.png +0 -0
  40. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/black-texture.png +0 -0
  41. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/cat_paw_mask.png +0 -0
  42. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/coop.png +0 -0
  43. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/coop_bg2.png +0 -0
  44. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/coop_fish.png +0 -0
  45. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/coop_mask.png +0 -0
  46. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/event_bg.png +0 -0
  47. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/festival_mask.png +0 -0
  48. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/fight_mask.png +0 -0
  49. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/filleted_corner.png +0 -0
  50. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/private.png +0 -0
  51. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/swim_ring.png +0 -0
  52. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/team_coop.png +0 -0
  53. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/ImageData/time_head_bg.png +0 -0
  54. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/db/image.db +0 -0
  55. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/font/Splatfont1.otf +0 -0
  56. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/font/Splatfont2.otf +0 -0
  57. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/font/cn.ttf +0 -0
  58. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/resource/font/common.otf +0 -0
  59. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/util.py +0 -0
  60. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/utils/__init__.py +0 -0
  61. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/utils/bot.py +0 -0
  62. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/utils/dataClass.py +0 -0
  63. {nonebot_plugin_splatoon3_schedule-2.0.2 → nonebot_plugin_splatoon3_schedule-2.0.3}/nonebot_plugin_splatoon3_schedule/utils/translation.py +0 -0
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: nonebot-plugin-splatoon3-schedule
3
- Version: 2.0.2
3
+ Version: 2.0.3
4
4
  Summary: 一个基于nonebot2框架的splatoon3游戏日程查询插件
5
5
  License-File: LICENSE
6
6
  Author: cypas
@@ -1,3 +1,4 @@
1
+ from pathlib import Path
1
2
  from typing import Union, Tuple
2
3
 
3
4
  from .check import _permission_check, _guild_owner_check, ChannelInfo, init_blacklist
@@ -252,6 +253,13 @@ async def _(bot: Bot, event: Event, re_tuple: Tuple = RegexGroup()):
252
253
  if not build_info:
253
254
  msg = f"该关键词 {weapon_name} 未查询到对应武器,请试试使用官方中文武器名称或其他常用名称后再试,若为贴牌需要加上贴牌二字,如:\n/配装 小绿\n指定模式查询:\n/配装 贴牌碳刷 塔楼"
254
255
  logger.warning(f"该关键词未匹配到武器 {weapon_name}")
256
+ # 未匹配武器写到指定文件
257
+ file_path = Path(os.path.join(DIR_RESOURCE, "未匹配武器.txt"))
258
+ os.makedirs(os.path.dirname(file_path), exist_ok=True)
259
+ # 以追加模式打开文件,编码指定为utf-8(避免中文乱码)
260
+ with open(file_path, "a", encoding="utf-8") as f:
261
+ f.write(f"{weapon_name}\n") # 每行一个关键词
262
+
255
263
  await send_msg(bot, event, msg)
256
264
  return
257
265
  zh_name: str = build_info.get("zh_name")
@@ -88,8 +88,8 @@ def get_coop_info(_all=None):
88
88
 
89
89
  # 取时间信息
90
90
  def get_str_time(sch):
91
- _start_time = time_converter_mdhm(sch["startTime"])
92
- _end_time = time_converter_mdhm(sch["endTime"])
91
+ _start_time = time_converter_ymdhm(sch["startTime"])
92
+ _end_time = time_converter_ymdhm(sch["endTime"])
93
93
  return "{} - {}".format(_start_time, _end_time)
94
94
 
95
95
  # 取boss名称
@@ -98,10 +98,6 @@ def get_coop_info(_all=None):
98
98
 
99
99
  # 校验普通打工时间,是否在特殊打工模式之后
100
100
  def check_salmonrun_time(_start_time, _special_mode_start_time):
101
- # 输入时间都缺少年份,需要手动补充一个年份后还原为date对象
102
- year = get_time_now_china().year
103
- _start_time = str(year) + "-" + _start_time
104
- _special_mode_start_time = str(year) + "-" + _special_mode_start_time
105
101
  st = datetime.datetime.strptime(_start_time, "%Y-%m-%d %H:%M")
106
102
  su_st = datetime.datetime.strptime(_special_mode_start_time, "%Y-%m-%d %H:%M")
107
103
  if st > su_st:
@@ -445,14 +445,22 @@ def get_coop_stages(stage, weapon, time, boss, mode) -> Image.Image:
445
445
  def check_coop_fish(_time):
446
446
  start_time = _time.split(" - ")[0]
447
447
  now_time = get_time_now_china()
448
- # 输入时间都缺少年份,需要手动补充一个年份后还原为date对象
449
- year = now_time.year
450
- start_time = str(year) + "-" + start_time
451
448
  st = datetime.datetime.strptime(start_time, "%Y-%m-%d %H:%M")
452
449
  if st < now_time:
453
450
  return True
454
451
  return False
455
452
 
453
+ def time_remove_year(_time):
454
+ """移除日期的年份数据"""
455
+ str_p = "%Y-%m-%d %H:%M"
456
+ str_f = "%m-%d %H:%M"
457
+ start_time = _time.split(" - ")[0]
458
+ end_time = _time.split(" - ")[1]
459
+ st = datetime.datetime.strptime(start_time, str_p)
460
+ et = datetime.datetime.strptime(end_time, str_p)
461
+ t = f"{st.strftime(str_f)} - {et.strftime(str_f)}"
462
+ return t
463
+
456
464
  top_size_pos = (0, -2)
457
465
  bg_size = (800, len(stage) * 162 + top_size_pos[1])
458
466
  stage_bg_size = (300, 160)
@@ -478,7 +486,7 @@ def get_coop_stages(stage, weapon, time, boss, mode) -> Image.Image:
478
486
  time_text_pos = (50, 5 + pos * 160)
479
487
 
480
488
  time_text_size = ttf_get_size(font, val)
481
- dr.text(time_text_pos, val, font=font, fill="#FFFFFF")
489
+ dr.text(time_text_pos, time_remove_year(val), font=font, fill="#FFFFFF")
482
490
  if check_coop_fish(val):
483
491
  # 现在时间处于打工时间段内,绘制小鲑鱼
484
492
  coop_fish_img = get_file("coop_fish").resize(coop_fish_size)
@@ -120,6 +120,12 @@ def time_converter_mdhm(time_str):
120
120
  return datetime.datetime.strftime(dt, "%m-%d %H:%M")
121
121
 
122
122
 
123
+ def time_converter_ymdhm(time_str):
124
+ """时间转换 年-月-日 时:分"""
125
+ dt = time_converter(time_str)
126
+ return datetime.datetime.strftime(dt, "%Y-%m-%d %H:%M")
127
+
128
+
123
129
  def time_converter_weekday(time_str):
124
130
  """时间转换 周几,如周一"""
125
131
  dt = time_converter(time_str)
@@ -149,15 +155,9 @@ def get_time_now_china() -> datetime.datetime:
149
155
 
150
156
  def trigger_with_probability():
151
157
  """
152
- 该函数有30/1000的概率返回True(触发),970/1000的概率返回False(不触发)
153
-
154
- 返回:
155
- bool: 触发状态,True表示触发,False表示未触发
158
+ 该函数有2/100的概率返回True(触发)
156
159
  """
157
- # 生成0到999之间的随机整数(包含0和999)
158
- random_number = random.randint(0, 999)
159
- # 如果随机数是0、1或2,则触发(3种情况)
160
- return random_number < 30
160
+ return random.random() < 0.02
161
161
 
162
162
 
163
163
  def ttf_get_size(font: ImageFont.FreeTypeFont, text: str) -> tuple:
@@ -1,6 +1,6 @@
1
1
  [tool.poetry]
2
2
  name = "nonebot-plugin-splatoon3-schedule"
3
- version = "2.0.2"
3
+ version = "2.0.3"
4
4
  description = "一个基于nonebot2框架的splatoon3游戏日程查询插件"
5
5
  authors = ["cypas <ayano05@outlook.com>"]
6
6
  readme = "README.md"