summaryrefslogtreecommitdiff
path: root/ATRI/utils/cqcode.py
diff options
context:
space:
mode:
authorKyomotoi <[email protected]>2021-07-08 22:09:00 +0800
committerKyomotoi <[email protected]>2021-07-08 22:09:00 +0800
commitbe2747e4d4b820ca0f1f988d3b77a628da26fe7b (patch)
treee1a59dd79ecd973a7d704568dcdc018f1f1b651a /ATRI/utils/cqcode.py
parenta4e1b9d1581d756ef79ad063d1c0bd6b2fd13c1d (diff)
downloadATRI-be2747e4d4b820ca0f1f988d3b77a628da26fe7b.tar.gz
ATRI-be2747e4d4b820ca0f1f988d3b77a628da26fe7b.tar.bz2
ATRI-be2747e4d4b820ca0f1f988d3b77a628da26fe7b.zip
🔖♻️🐛🔧🔥📝 更新版本:YHN-001-A03
🔖 更新版本至:YHN-001-A03 ✨ 新增插件: - 涩图 - 闲聊(文爱 ♻️ 重构: - Service - 所有插件 🐛 修复部分小bug 🔧 暂时移除部分设置 🔥 删除: - 插件:nsfw、wife。日后加回 - 插件 essential 中部分内容 📝 更新README
Diffstat (limited to 'ATRI/utils/cqcode.py')
-rw-r--r--ATRI/utils/cqcode.py27
1 files changed, 0 insertions, 27 deletions
diff --git a/ATRI/utils/cqcode.py b/ATRI/utils/cqcode.py
deleted file mode 100644
index e4c6b5e..0000000
--- a/ATRI/utils/cqcode.py
+++ /dev/null
@@ -1,27 +0,0 @@
-import re
-from typing import Optional
-
-from ATRI.service import Service as sv
-
-
-tencent_gchat_url = "gchat.qpic.cn"
-noob_code = ["record", "video", "music", "xml", "json"]
-
-
-async def coolq_code_check(
- cq_code: str, user: Optional[int] = None, group: Optional[int] = None
-):
- _type = re.findall(r"CQ:(.*?),", cq_code)
- for i in _type:
- if i == "image":
- result = re.findall(r"url=(.*?)]", cq_code)
- url = "" if not result else result[0]
- if tencent_gchat_url not in url:
- msg = "你注你🐎呢"
- await sv.NetworkPost.send_msg(user_id=user, group_id=group, message=msg)
- else:
- return True
- elif i in noob_code:
- return False
- else:
- return True