-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
🐛 分支应该是main而不是master 💄 auto fix by pre-commit hooks 🔥 dependabot.yml的registrys需要token,先删除
- Loading branch information
1 parent
7d4eb77
commit e50eb5d
Showing
66 changed files
with
69,031 additions
and
7,944 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,56 +1,56 @@ | ||
{ | ||
"name": "Default Linux Universal", | ||
"image": "mcr.microsoft.com/devcontainers/universal:2-linux", | ||
"features": { | ||
"ghcr.io/devcontainers-contrib/features/poetry:2": {} | ||
}, | ||
"postCreateCommand": "poetry config virtualenvs.in-project true && poetry install -E all && poetry run pre-commit install && yarn install", | ||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"python.analysis.diagnosticMode": "workspace", | ||
"python.analysis.typeCheckingMode": "basic", | ||
"ruff.organizeImports": false, | ||
"[python]": { | ||
"editor.defaultFormatter": "ms-python.black-formatter", | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.ruff": true, | ||
"source.organizeImports": true | ||
} | ||
}, | ||
"[javascript]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[html]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[typescript]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[javascriptreact]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[typescriptreact]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"files.exclude": { | ||
"**/__pycache__": true | ||
}, | ||
"files.watcherExclude": { | ||
"**/target/**": true, | ||
"**/__pycache__": true | ||
"name": "Default Linux Universal", | ||
"image": "mcr.microsoft.com/devcontainers/universal:2-linux", | ||
"features": { | ||
"ghcr.io/devcontainers-contrib/features/poetry:2": {} | ||
}, | ||
"postCreateCommand": "poetry config virtualenvs.in-project true && poetry install -E all && poetry run pre-commit install && yarn install", | ||
"customizations": { | ||
"vscode": { | ||
"settings": { | ||
"python.analysis.diagnosticMode": "workspace", | ||
"python.analysis.typeCheckingMode": "basic", | ||
"ruff.organizeImports": false, | ||
"[python]": { | ||
"editor.defaultFormatter": "ms-python.black-formatter", | ||
"editor.codeActionsOnSave": { | ||
"source.fixAll.ruff": true, | ||
"source.organizeImports": true | ||
} | ||
}, | ||
"extensions": [ | ||
"ms-python.python", | ||
"ms-python.vscode-pylance", | ||
"ms-python.isort", | ||
"ms-python.black-formatter", | ||
"charliermarsh.ruff", | ||
"EditorConfig.EditorConfig", | ||
"esbenp.prettier-vscode", | ||
"bradlc.vscode-tailwindcss" | ||
] | ||
} | ||
"[javascript]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[html]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[typescript]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[javascriptreact]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"[typescriptreact]": { | ||
"editor.defaultFormatter": "esbenp.prettier-vscode" | ||
}, | ||
"files.exclude": { | ||
"**/__pycache__": true | ||
}, | ||
"files.watcherExclude": { | ||
"**/target/**": true, | ||
"**/__pycache__": true | ||
} | ||
}, | ||
"extensions": [ | ||
"ms-python.python", | ||
"ms-python.vscode-pylance", | ||
"ms-python.isort", | ||
"ms-python.black-formatter", | ||
"charliermarsh.ruff", | ||
"EditorConfig.EditorConfig", | ||
"esbenp.prettier-vscode", | ||
"bradlc.vscode-tailwindcss" | ||
] | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,4 +18,3 @@ runs: | |
uses: Gr1N/setup-poetry@v8 | ||
with: | ||
poetry-version: "1.3.2" | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: Ruff Lint | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
pull_request: | ||
paths: | ||
- "nonebot_bison/**" | ||
- "extra_plugins/**" | ||
- "tests/**" | ||
- "bot.py" | ||
|
||
jobs: | ||
ruff: | ||
name: Ruff Lint | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Run Ruff Lint | ||
uses: chartboost/ruff-action@v1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -20,4 +20,4 @@ flag_management: | |
target: auto | ||
threshold: 5% | ||
- type: patch | ||
target: 80% | ||
target: 80% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,19 @@ | ||
from typing import Union | ||
|
||
from nonebot import on_request | ||
from nonebot.adapters.onebot.v11 import Bot | ||
from nonebot.adapters.onebot.v11.event import FriendRequestEvent, GroupRequestEvent | ||
from nonebot.log import logger | ||
from nonebot.adapters.onebot.v11 import Bot | ||
from nonebot.adapters.onebot.v11.event import GroupRequestEvent, FriendRequestEvent | ||
|
||
friend_req = on_request(priority=5) | ||
|
||
|
||
@friend_req.handle() | ||
async def add_superuser(bot: Bot, event: Union[GroupRequestEvent, FriendRequestEvent]): | ||
async def add_superuser(bot: Bot, event: GroupRequestEvent | FriendRequestEvent): | ||
if str(event.user_id) not in bot.config.superusers: | ||
return | ||
|
||
if isinstance(event, FriendRequestEvent): | ||
await event.approve(bot) | ||
logger.info("add user {}".format(event.user_id)) | ||
logger.info(f"add user {event.user_id}") | ||
else: | ||
await event.approve(bot) | ||
logger.info("add group {}".format(event.group_id)) | ||
logger.info(f"add group {event.group_id}") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.