first commit
This commit is contained in:
@@ -0,0 +1,16 @@
|
||||
"""独立处理清空,避免排在耗时的模型请求后面。"""
|
||||
class Plugin:
|
||||
def on_load(self, ctx):
|
||||
self.members = ctx.members
|
||||
|
||||
def on_message(self, message, ctx):
|
||||
if message.type != 1 or not message.is_group or message.chat_id not in self.members.groups:
|
||||
return
|
||||
words = message.text.strip().split(maxsplit=1)
|
||||
if not words or words[0] != "/清空":
|
||||
return
|
||||
if len(words) != 1:
|
||||
ctx.reply(message, "用法:/清空")
|
||||
return
|
||||
self.members.clear(message.chat_id)
|
||||
ctx.reply(message, "已清空本群聊天记录。")
|
||||
@@ -0,0 +1,7 @@
|
||||
{
|
||||
"name": "chat_records",
|
||||
"api": "v1",
|
||||
"description": "手动清空当前群聊天记录",
|
||||
"entry": "__init__.py",
|
||||
"requires": ["group.text.receive", "group.text.send"]
|
||||
}
|
||||
Reference in New Issue
Block a user