Compare commits

..

5 Commits
1.4.4 ... 1.4.5

Author SHA1 Message Date
12a934566d 🔖 1.4.5 2024-08-07 16:44:13 +08:00
ff71dba516 给截图加个耗时统计 2024-08-07 16:41:52 +08:00
e029d51494 🔥 忘记删测试用配置了 2024-08-07 14:38:09 +08:00
dependabot[bot]
b1f48da6fe ⬆️ Bump nonebot-plugin-alconna from 0.50.3 to 0.51.0 (#388)
Bumps [nonebot-plugin-alconna](https://github.com/nonebot/plugin-alconna) from 0.50.3 to 0.51.0.
- [Release notes](https://github.com/nonebot/plugin-alconna/releases)
- [Commits](https://github.com/nonebot/plugin-alconna/compare/v0.50.3...v0.51.0)

---
updated-dependencies:
- dependency-name: nonebot-plugin-alconna
  dependency-type: direct:production
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-08-06 23:43:04 +08:00
9a2927542a 🔥 移除不需要的常量 2024-08-06 20:43:00 +08:00
5 changed files with 33 additions and 13 deletions

View File

@@ -1,3 +1 @@
BIND_COMMAND: list[str] = ['绑定', 'bind']
QUERY_COMMAND: list[str] = ['', '查询', 'query', 'stats']
CANT_VERIFY_MESSAGE = '* 由于无法验证绑定信息, 不能保证查询到的用户为本人\n'

View File

@@ -4,11 +4,13 @@ from playwright.async_api import TimeoutError, ViewportSize
from ..config.config import Config
from .browser import BrowserManager
from .retry import retry
from .time_it import time_it
config = get_plugin_config(Config)
@retry(exception_type=TimeoutError, reply='截图失败, 重试中')
@time_it
async def screenshot(url: str) -> bytes:
browser = await BrowserManager.get_browser()
async with (

View File

@@ -0,0 +1,21 @@
from collections.abc import Callable, Coroutine
from functools import wraps
from time import time_ns
from typing import Any, ParamSpec, TypeVar
from nonebot.log import logger
T = TypeVar('T')
P = ParamSpec('P')
def time_it(func: Callable[P, Coroutine[Any, Any, T]]) -> Callable[P, Coroutine[Any, Any, T]]:
@wraps(func)
async def wrapper(*args: P.args, **kwargs: P.kwargs) -> T:
start = time_ns()
try:
return await func(*args, **kwargs)
finally:
logger.debug(f'{func.__name__} took {(time_ns() - start) / 1e6}ms')
return wrapper

18
poetry.lock generated
View File

@@ -285,13 +285,13 @@ full = ["arclet-alconna-tools (>=0.2.0)"]
[[package]]
name = "arclet-alconna-tools"
version = "0.7.8"
version = "0.7.9"
description = "Builtin Tools for Alconna"
optional = false
python-versions = ">=3.8"
files = [
{file = "arclet_alconna_tools-0.7.8-py3-none-any.whl", hash = "sha256:be57595d0f07882e1b221dacff0a81d492643915b85219d1b1e7ba5bee034c36"},
{file = "arclet_alconna_tools-0.7.8.tar.gz", hash = "sha256:4c54944bc4e495e730f41f96f1af23b86f3c8cde6c332699a9d82f839790ad32"},
{file = "arclet_alconna_tools-0.7.9-py3-none-any.whl", hash = "sha256:01a3462bb9f8dbe55010b394f7a0ac11e331799d463e326738870dce191aa608"},
{file = "arclet_alconna_tools-0.7.9.tar.gz", hash = "sha256:bded24c4157e13e2d803fe7b77ee246fda456206451337015513f150d1e4449c"},
]
[package.dependencies]
@@ -1721,23 +1721,23 @@ nonebot2 = ">=2.3.0"
[[package]]
name = "nonebot-plugin-alconna"
version = "0.50.3"
version = "0.51.0"
description = "Alconna Adapter for Nonebot"
optional = false
python-versions = ">=3.9"
files = [
{file = "nonebot_plugin_alconna-0.50.3-py3-none-any.whl", hash = "sha256:4c8e2f8615eb984706f292e3ec9b9e0af904aeaf25a96c888b77851a3a2685c5"},
{file = "nonebot_plugin_alconna-0.50.3.tar.gz", hash = "sha256:f29428dbea17420e34625f21bd806e7c12b0f383e4f972d3ce42aa09d5c84e97"},
{file = "nonebot_plugin_alconna-0.51.0-py3-none-any.whl", hash = "sha256:0889f2a16824fe9e07adca6d2c1197db989208ace20f70f59829b6dec0f67b7e"},
{file = "nonebot_plugin_alconna-0.51.0.tar.gz", hash = "sha256:cf4c8f0d638e547993cb1ef13ccd2d5fa968206f83f1e7fc281dc359a497e8a1"},
]
[package.dependencies]
arclet-alconna = ">=1.8.21"
arclet-alconna-tools = ">=0.7.8"
arclet-alconna = ">=1.8.23"
arclet-alconna-tools = ">=0.7.9"
importlib-metadata = ">=4.13.0"
nepattern = ">=0.7.4"
nonebot-plugin-waiter = ">=0.6.0"
nonebot2 = ">=2.3.0"
tarina = ">=0.5.4"
tarina = ">=0.5.5"
[[package]]
name = "nonebot-plugin-apscheduler"

View File

@@ -1,6 +1,6 @@
[tool.poetry]
name = 'nonebot-plugin-tetris-stats'
version = '1.4.4'
version = '1.4.5'
description = '一款基于 NoneBot2 的用于查询 Tetris 相关游戏数据的插件'
authors = ['scdhh <wallfjjd@gmail.com>']
readme = 'README.md'
@@ -130,4 +130,3 @@ quote-style = 'single'
[tool.nonebot]
plugins = ['nonebot_plugin_tetris_stats']
# plugins = ['test_datetime']