mirror of
https://github.com/RockChinQ/QChatGPT.git
synced 2024-11-16 19:57:04 +08:00
32 lines
618 B
Python
32 lines
618 B
Python
from __future__ import annotations
|
|
import abc
|
|
|
|
import mirai
|
|
|
|
from ...core import app
|
|
from . import entities
|
|
|
|
|
|
class GroupRespondRule(metaclass=abc.ABCMeta):
|
|
"""群组响应规则的抽象类
|
|
"""
|
|
|
|
ap: app.Application
|
|
|
|
def __init__(self, ap: app.Application):
|
|
self.ap = ap
|
|
|
|
async def initialize(self):
|
|
pass
|
|
|
|
@abc.abstractmethod
|
|
async def match(
|
|
self,
|
|
message_text: str,
|
|
message_chain: mirai.MessageChain,
|
|
rule_dict: dict
|
|
) -> entities.RuleJudgeResult:
|
|
"""判断消息是否匹配规则
|
|
"""
|
|
raise NotImplementedError
|