动态auth完成。
This commit is contained in:
@@ -62,15 +62,9 @@ class GroupMemberChangePlugin(MessagePluginInterface):
|
|||||||
|
|
||||||
def can_process(self, message: Dict[str, Any]) -> bool:
|
def can_process(self, message: Dict[str, Any]) -> bool:
|
||||||
"""检查是否可以处理该消息"""
|
"""检查是否可以处理该消息"""
|
||||||
if not self.enable:
|
content = message.get("content")
|
||||||
|
if not content or "<sysmsg" not in content:
|
||||||
return False
|
return False
|
||||||
|
|
||||||
content = str(message.get("content", "")).strip()
|
|
||||||
roomid = message.get("roomid", "")
|
|
||||||
|
|
||||||
if GroupBotManager.get_group_permission(roomid, self.feature) == PermissionStatus.DISABLED:
|
|
||||||
return False
|
|
||||||
|
|
||||||
return True
|
return True
|
||||||
|
|
||||||
async def process_message(self, message: Dict[str, Any]) -> Tuple[bool, Optional[str]]:
|
async def process_message(self, message: Dict[str, Any]) -> Tuple[bool, Optional[str]]:
|
||||||
|
|||||||
@@ -1,5 +1,4 @@
|
|||||||
import json
|
import json
|
||||||
import os
|
|
||||||
import re
|
import re
|
||||||
import time
|
import time
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
@@ -7,17 +6,17 @@ from typing import Dict, Any, Tuple, Optional, List
|
|||||||
|
|
||||||
import requests
|
import requests
|
||||||
|
|
||||||
|
from base.plugin_common.message_plugin_interface import MessagePluginInterface
|
||||||
|
from base.plugin_common.plugin_interface import PluginStatus
|
||||||
|
from utils.compress_chat_data import compress_chat_data
|
||||||
|
from utils.decorator.plugin_decorators import plugin_stats_decorator
|
||||||
|
from utils.decorator.points_decorator import plugin_points_cost
|
||||||
|
from utils.markdown_to_image import convert_md_str_to_image
|
||||||
from utils.revoke.message_auto_revoke import MessageAutoRevoke
|
from utils.revoke.message_auto_revoke import MessageAutoRevoke
|
||||||
|
from utils.robot_cmd.robot_command import GroupBotManager, PermissionStatus
|
||||||
from utils.string_utils import remove_trailing_content
|
from utils.string_utils import remove_trailing_content
|
||||||
from utils.wechat.contact_manager import ContactManager
|
from utils.wechat.contact_manager import ContactManager
|
||||||
from utils.wechat.message_to_db import MessageStorage
|
from utils.wechat.message_to_db import MessageStorage
|
||||||
from utils.compress_chat_data import compress_chat_data
|
|
||||||
from base.plugin_common.message_plugin_interface import MessagePluginInterface
|
|
||||||
from base.plugin_common.plugin_interface import PluginStatus
|
|
||||||
from utils.decorator.points_decorator import plugin_points_cost
|
|
||||||
from utils.markdown_to_image import convert_md_str_to_image
|
|
||||||
from utils.decorator.plugin_decorators import plugin_stats_decorator
|
|
||||||
from utils.robot_cmd.robot_command import GroupBotManager, Feature, PermissionStatus
|
|
||||||
from wechat_ipad import WechatAPIClient
|
from wechat_ipad import WechatAPIClient
|
||||||
|
|
||||||
|
|
||||||
@@ -261,8 +260,6 @@ class MessageSummaryPlugin(MessagePluginInterface):
|
|||||||
|
|
||||||
def can_process(self, message: Dict[str, Any]) -> bool:
|
def can_process(self, message: Dict[str, Any]) -> bool:
|
||||||
"""检查是否可以处理该消息"""
|
"""检查是否可以处理该消息"""
|
||||||
if not self.enable:
|
|
||||||
return False
|
|
||||||
|
|
||||||
content = str(message.get("content", "")).strip()
|
content = str(message.get("content", "")).strip()
|
||||||
roomid = message.get("roomid", "")
|
roomid = message.get("roomid", "")
|
||||||
|
|||||||
@@ -1,10 +1,11 @@
|
|||||||
import base64
|
|
||||||
from loguru import logger
|
|
||||||
from typing import Dict, Any, List, Optional, Tuple
|
from typing import Dict, Any, List, Optional, Tuple
|
||||||
|
|
||||||
|
from loguru import logger
|
||||||
|
|
||||||
from base.plugin_common.message_plugin_interface import MessagePluginInterface
|
from base.plugin_common.message_plugin_interface import MessagePluginInterface
|
||||||
from base.plugin_common.plugin_interface import PluginStatus
|
from base.plugin_common.plugin_interface import PluginStatus
|
||||||
from utils.decorator.plugin_decorators import plugin_stats_decorator, plugin_points_cost
|
from utils.decorator.plugin_decorators import plugin_stats_decorator
|
||||||
|
from utils.decorator.points_decorator import plugin_points_cost
|
||||||
from utils.revoke.message_auto_revoke import MessageAutoRevoke
|
from utils.revoke.message_auto_revoke import MessageAutoRevoke
|
||||||
from utils.robot_cmd.robot_command import Feature, PermissionStatus, GroupBotManager
|
from utils.robot_cmd.robot_command import Feature, PermissionStatus, GroupBotManager
|
||||||
from wechat_ipad import WechatAPIClient
|
from wechat_ipad import WechatAPIClient
|
||||||
|
|||||||
Reference in New Issue
Block a user