Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pre-commit.ci] pre-commit autoupdate #82

Open
wants to merge 2 commits into
base: release
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
repos:
- repo: https://github.com/psf/black
rev: '23.9.1'
rev: '24.10.0'
hooks:
- id: black
# It is recommended to specify the latest version of Python
Expand All @@ -10,13 +10,13 @@ repos:
language_version: python3.9

- repo: https://github.com/astral-sh/ruff-pre-commit
rev: 'v0.0.290'
rev: 'v0.9.3'
hooks:
- id: ruff
args: [--fix]

- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v4.4.0
rev: v5.0.0
hooks:
- id: end-of-file-fixer
- id: trailing-whitespace
1 change: 1 addition & 0 deletions app/extend/message_queue.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""消息队列,控制消息发送频率"""

import asyncio
from queue import Queue
from time import sleep
Expand Down
4 changes: 3 additions & 1 deletion app/plugin/basic/__06_permission/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,9 @@ async def grant(target: Union[Friend, Member], sender: Union[Friend, Group], cmd
return message("master level 不可更改!若想进行修改请直接修改配置文件!").target(sender).send()
elif result == 3:
if not Permission.manual(target, 4):
return message("权限不足,你必须达到等级4(master level)才可修改超级管理员权限!").target(sender).send() # noqa: E501
return (
message("权限不足,你必须达到等级4(master level)才可修改超级管理员权限!").target(sender).send()
) # noqa: E501
ADMIN_USER.remove(target)
if level == 2:
GROUP_ADMIN_USER.append(target)
Expand Down
4 changes: 3 additions & 1 deletion app/plugin/basic/__07_group_qa/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,9 @@ async def answer(user: Member, group: Group, msg: MessageChain):
return msg.display

qa = await get_config("group_qa", sender) or []
message("请在180秒内输入关键词, 若关键词一致则修改相关回答内容, 发送 #取消# 取消添加/修改").target(sender).quote(source).send()
message("请在180秒内输入关键词, 若关键词一致则修改相关回答内容, 发送 #取消# 取消添加/修改").target(sender).quote(
source
).send()
keyword = await DefaultFunctionWaiter(answer, [GroupMessage]).wait(180, "TimeoutError")
if keyword == "TimeoutError":
return message("等待超时!").target(sender).send()
Expand Down
4 changes: 3 additions & 1 deletion app/plugin/basic/__11_game/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,9 @@ async def rank(target: Union[Friend, Member], sender: Union[Friend, Group]):
@command.parse("auto")
async def auto(target: Union[Friend, Member], sender: Union[Friend, Group], cmd: Arpamar):
await BotGame(target.id).auto_signin(cmd.query("status"))
return message("开启成功,将于每日 8 点为您自动签到!" if cmd.query("status") else "关闭成功!").target(sender).send() # noqa: E501
return (
message("开启成功,将于每日 8 点为您自动签到!" if cmd.query("status") else "关闭成功!").target(sender).send()
) # noqa: E501


@sche.schedule(timers.crontabify("0 7 * * * 0"))
Expand Down
1 change: 1 addition & 0 deletions app/util/control.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Xenon 管理 https://github.com/McZoo/Xenon/blob/master/lib/control.py
"""

from functools import wraps
from typing import Union

Expand Down
1 change: 1 addition & 0 deletions app/util/graia/__init__.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
"""对Ariadne 相关功能进行封装"""

from graia.ariadne import Ariadne as Ariadne
from graia.ariadne.event.message import ActiveFriendMessage as ActiveFriendMessage
from graia.ariadne.event.message import ActiveGroupMessage as ActiveGroupMessage
Expand Down
Loading