summaryrefslogtreecommitdiff
path: root/ATRI/plugins/thesaurus
diff options
context:
space:
mode:
author0w0 <[email protected]>2022-12-29 16:38:27 +0800
committerGitHub <[email protected]>2022-12-29 16:38:27 +0800
commitc0e5f0398bd4c3c55378cff303f31ff968822346 (patch)
treed90bc810150d859c76e64f6e71d8524478014f31 /ATRI/plugins/thesaurus
parent3d857da2ae1984c6abf286b55888d6d3e4c5d823 (diff)
parentbb13b38f862d859007d1d37941f5b5c9d5f38cbc (diff)
downloadATRI-c0e5f0398bd4c3c55378cff303f31ff968822346.tar.gz
ATRI-c0e5f0398bd4c3c55378cff303f31ff968822346.tar.bz2
ATRI-c0e5f0398bd4c3c55378cff303f31ff968822346.zip
Merge branch 'main' into main
Diffstat (limited to 'ATRI/plugins/thesaurus')
-rw-r--r--ATRI/plugins/thesaurus/data_source.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/ATRI/plugins/thesaurus/data_source.py b/ATRI/plugins/thesaurus/data_source.py
index 8098179..8c12b16 100644
--- a/ATRI/plugins/thesaurus/data_source.py
+++ b/ATRI/plugins/thesaurus/data_source.py
@@ -1,6 +1,7 @@
import pytz
from datetime import datetime
+from ATRI.message import MessageBuilder
from ATRI.exceptions import ThesaurusError
from .db import DBForTS, DBForTAL
@@ -98,8 +99,14 @@ class ThesaurusManager:
{"matcher": q, "group_id": group_id}, is_main
)
if query_result:
+ await self.del_item(_id, group_id, is_main)
item_info = query_result[0]
- return f"""{"(需审核/投票)" if not is_main else str()}该词条已存在!! ID: {item_info._id}"""
+ return (
+ MessageBuilder(f"{str() if is_main else '(需审核/投票)'}该词条已存在!!")
+ .text(f"ID: {item_info._id}")
+ .text("因此, 此新增词条将被删除")
+ .done()
+ )
if t == "全匹配":
m_type = 0