mirror of
https://github.com/zhenxun-org/zhenxun_bot.git
synced 2026-10-01 17:49:58 +08:00
merge
This commit is contained in:
@@ -36,7 +36,7 @@ __plugin_configs__ = {
|
||||
},
|
||||
}
|
||||
|
||||
coser = on_regex(r"^(\d?)连?(cos|COS|coser|括丝)$", priority=5, block=True)
|
||||
coser = on_regex(r"^(\d)?连?(cos|COS|coser|括丝)$", priority=5, block=True)
|
||||
|
||||
# 纯cos,较慢:https://picture.yinux.workers.dev
|
||||
# 比较杂,有福利姬,较快:https://api.jrsgslb.cn/cos/url.php?return=img
|
||||
@@ -44,7 +44,7 @@ url = "https://picture.yinux.workers.dev/"
|
||||
|
||||
|
||||
@coser.handle()
|
||||
async def _(bot: Bot, event: MessageEvent, reg_group: Tuple[Any, ...] = RegexGroup()):
|
||||
async def _(event: MessageEvent, reg_group: Tuple[Any, ...] = RegexGroup()):
|
||||
num = reg_group[0] or 1
|
||||
for _ in range(int(num)):
|
||||
try:
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
from nonebot import on_command
|
||||
from nonebot import on_regex
|
||||
from services.log import logger
|
||||
from nonebot.adapters.onebot.v11 import Bot, MessageEvent, GroupMessageEvent
|
||||
from nonebot.typing import T_State
|
||||
@@ -24,7 +24,7 @@ __plugin_settings__ = {
|
||||
}
|
||||
|
||||
|
||||
quotations = on_command("语录", aliases={"二次元", "二次元语录"}, priority=5, block=True)
|
||||
quotations = on_regex("^[语录|二次元]$", priority=5, block=True)
|
||||
|
||||
url = "https://international.v1.hitokoto.cn/?c=a"
|
||||
|
||||
|
||||
@@ -234,10 +234,10 @@ class WordBank(db.Model):
|
||||
query = query.where(cls.word_scope == word_type)
|
||||
sql_text += f" and word_scope = {word_scope}"
|
||||
# 完全匹配
|
||||
if await query.where(((cls.word_type == 0) | (cls.word_type == 3)) & (cls.problem == problem)).gino.first():
|
||||
if await query.where(cls.problem == problem).gino.first():
|
||||
return query.where(cls.problem == problem)
|
||||
# 模糊匹配
|
||||
if await query.where((cls.word_type == 1) & (cls.problem.contains(problem))).gino.first():
|
||||
if await query.where(cls.problem.contains(problem)).gino.first():
|
||||
return query.where(cls.problem.contains(problem))
|
||||
# 正则匹配
|
||||
if await db.first(
|
||||
|
||||
Reference in New Issue
Block a user