Skip to content
This repository has been archived by the owner on Jul 24, 2024. It is now read-only.

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

Merged
merged 2 commits into from
Jun 25, 2024
Merged
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
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ ci:

repos:
- repo: https://github.com/pycqa/flake8
rev: 7.0.0
rev: 7.1.0
hooks:
- id: flake8
args: [--select=E9]
- repo: https://github.com/psf/black
rev: 24.3.0
rev: 24.4.2
hooks:
- id: black
args: [--skip-magic-trailing-comma]
5 changes: 4 additions & 1 deletion src/plugins/Core/plugins/_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,15 @@ async def handler(bot: Bot, event: MessageEvent) -> None:
return deco


class UnsupportPublicQQBot(Exception): pass
class UnsupportPublicQQBot(Exception):
pass


def check_qqbot(bot_id: str) -> None:
if bot_id in Json("qqbots.json")["bots"]:
raise UnsupportPublicQQBot


def create_command(cmd: str, aliases: set = set(), **kwargs):
matcher = on_command(cmd, aliases=aliases, **kwargs)

Expand Down
3 changes: 3 additions & 0 deletions src/plugins/Core/plugins/setu.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,11 @@ async def delete_msg(bot: Bot, message: int) -> None:
await bot.delete_msg(message_id=message)
except Exception:
await _error.report(traceback.format_exc())


from ._utils import check_qqbot


@setu.handle()
async def setu_handler(
bot: Bot, event: MessageEvent, message: Message = CommandArg()
Expand Down