nonebot-plugin-lazy 0.3.2__tar.gz → 0.3.4__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.
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.5
2
2
  Name: nonebot-plugin-lazy
3
- Version: 0.3.2
3
+ Version: 0.3.4
4
4
  Summary: LAZY SERVER 官方支持,在 QQ 内获得学在浙大点名/待办通知
5
5
  Project-URL: homepage, https://github.com/yangshu233/nonebot_plugin_lazy
6
6
  Project-URL: repository, https://github.com/yangshu233/nonebot_plugin_lazy
@@ -16,12 +16,6 @@ from nonebot.log import logger
16
16
  from .config import config
17
17
  from .state import runtime_config
18
18
 
19
- try:
20
- # from nonebot_plugin_htmlrender import html_to_pic
21
- pass
22
- except ImportError:
23
- html_to_pic = None
24
-
25
19
 
26
20
  _ROLLCALL_HTML = """<!DOCTYPE html><html><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">{style}</head><body>{body}</body></html>"""
27
21
 
@@ -112,16 +106,6 @@ class Notifier:
112
106
  )
113
107
  return _ROLLCALL_HTML.format(style=_STYLE, body=body)
114
108
 
115
- async def _render_image(self, html: str) -> bytes | None:
116
- if html_to_pic is None:
117
- logger.error("html_to_pic 不可用(nonebot_plugin_htmlrender 未安装)")
118
- return None
119
- try:
120
- return await html_to_pic(html, viewport={"width": 560})
121
- except Exception as e:
122
- logger.error(f"渲染图片失败: {e}")
123
- return None
124
-
125
109
  def _resolve_at_qq(self, qq_id: int) -> int:
126
110
  if qq_id > 0:
127
111
  return qq_id
@@ -176,17 +160,13 @@ class Notifier:
176
160
  logger.error("没有可用的 Bot 实例")
177
161
  return
178
162
  groups = self._target_groups(qq_id)
179
- html = self._build_rollcall_html(items)
180
- pic = await self._render_image(html)
181
- if pic:
182
- await self._send_image(qq_id, pic, groups)
183
- else:
184
- text = "\n\n".join(
185
- f"🔔 点名\n课程:{i.get('course_title','')}\n"
186
- f"发起人:{i.get('created_by_name','')}"
187
- for i in items
188
- )
189
- await self._send_text_fallback(qq_id, text, groups)
163
+
164
+ text = "\n\n".join(
165
+ f"🔔 点名\n课程:{i.get('course_title','')}\n"
166
+ f"发起人:{i.get('created_by_name','')}"
167
+ for i in items
168
+ )
169
+ await self._send_text_fallback(qq_id, text, groups)
190
170
 
191
171
  async def notify_todos(self, qq_id: int, items: list[dict]):
192
172
  try:
@@ -4,7 +4,7 @@ build-backend = "hatchling.build"
4
4
 
5
5
  [project]
6
6
  name = "nonebot-plugin-lazy"
7
- version = "0.3.2"
7
+ version = "0.3.4"
8
8
  description = "LAZY SERVER 官方支持,在 QQ 内获得学在浙大点名/待办通知"
9
9
  readme = "README.md"
10
10
  requires-python = ">=3.12"