Merge branch 'SengokuCola:debug' into debug
This commit is contained in:
6
.gitignore
vendored
6
.gitignore
vendored
@@ -190,7 +190,6 @@ cython_debug/
|
|||||||
|
|
||||||
# PyPI configuration file
|
# PyPI configuration file
|
||||||
.pypirc
|
.pypirc
|
||||||
.env
|
|
||||||
|
|
||||||
# jieba
|
# jieba
|
||||||
jieba.cache
|
jieba.cache
|
||||||
@@ -200,3 +199,8 @@ jieba.cache
|
|||||||
|
|
||||||
# direnv
|
# direnv
|
||||||
/.direnv
|
/.direnv
|
||||||
|
|
||||||
|
# JetBrains
|
||||||
|
.idea
|
||||||
|
*.iml
|
||||||
|
*.ipr
|
||||||
|
|||||||
10
.pre-commit-config.yaml
Normal file
10
.pre-commit-config.yaml
Normal file
@@ -0,0 +1,10 @@
|
|||||||
|
repos:
|
||||||
|
- repo: https://github.com/astral-sh/ruff-pre-commit
|
||||||
|
# Ruff version.
|
||||||
|
rev: v0.9.10
|
||||||
|
hooks:
|
||||||
|
# Run the linter.
|
||||||
|
- id: ruff
|
||||||
|
args: [ --fix ]
|
||||||
|
# Run the formatter.
|
||||||
|
- id: ruff-format
|
||||||
@@ -7,7 +7,7 @@ from datetime import datetime
|
|||||||
from typing import Dict, List
|
from typing import Dict, List
|
||||||
from loguru import logger
|
from loguru import logger
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
from ..common.database import db
|
|
||||||
|
|
||||||
import customtkinter as ctk
|
import customtkinter as ctk
|
||||||
from dotenv import load_dotenv
|
from dotenv import load_dotenv
|
||||||
@@ -16,6 +16,8 @@ from dotenv import load_dotenv
|
|||||||
current_dir = os.path.dirname(os.path.abspath(__file__))
|
current_dir = os.path.dirname(os.path.abspath(__file__))
|
||||||
# 获取项目根目录
|
# 获取项目根目录
|
||||||
root_dir = os.path.abspath(os.path.join(current_dir, '..', '..'))
|
root_dir = os.path.abspath(os.path.join(current_dir, '..', '..'))
|
||||||
|
sys.path.insert(0, root_dir)
|
||||||
|
from src.common.database import db
|
||||||
|
|
||||||
# 加载环境变量
|
# 加载环境变量
|
||||||
if os.path.exists(os.path.join(root_dir, '.env.dev')):
|
if os.path.exists(os.path.join(root_dir, '.env.dev')):
|
||||||
|
|||||||
@@ -86,9 +86,12 @@ class CQCode:
|
|||||||
else:
|
else:
|
||||||
self.translated_segments = Seg(type="text", data="[图片]")
|
self.translated_segments = Seg(type="text", data="[图片]")
|
||||||
elif self.type == "at":
|
elif self.type == "at":
|
||||||
user_nickname = get_user_nickname(self.params.get("qq", ""))
|
if self.params.get("qq") == "all":
|
||||||
self.translated_segments = Seg(
|
self.translated_segments = Seg(type="text", data="@[全体成员]")
|
||||||
type="text", data=f"[@{user_nickname or '某人'}]"
|
else:
|
||||||
|
user_nickname = get_user_nickname(self.params.get("qq", ""))
|
||||||
|
self.translated_segments = Seg(
|
||||||
|
type="text", data=f"[@{user_nickname or '某人'}]"
|
||||||
)
|
)
|
||||||
elif self.type == "reply":
|
elif self.type == "reply":
|
||||||
reply_segments = self.translate_reply()
|
reply_segments = self.translate_reply()
|
||||||
|
|||||||
Reference in New Issue
Block a user