跳至主要內容

- 资源包开发
- 轻雪函数
- 轻雪插件开发
- 进程通信
- - liteyuki
  - liteyuki.config
  - liteyuki.exception
  - liteyuki.log
  - liteyuki.mkdoc
  - liteyuki.utils
  - - liteyuki.message
    - liteyuki.message.event
    - liteyuki.message.matcher
    - liteyuki.message.on
    - liteyuki.message.rule
    - liteyuki.message.session

# liteyuki.message.rule

远野千束
小于 1 分钟
API

此页内容

- async def empty_rule(event: MessageEvent) -> bool
- async def combined_handler(event: MessageEvent) -> bool
- async def combined_handler(event: MessageEvent) -> bool
- class Rule
- def __init__(self, handler: RuleHandlerFunc) -> None

### async def `empty_rule(event: MessageEvent) -> bool`

源代码

    @Rule
    async def empty_rule(event: MessageEvent) -> bool:
        return True

### async def `combined_handler(event: MessageEvent) -> bool`

源代码

    async def combined_handler(event: MessageEvent) -> bool:
        return await self.handler(event) or await other.handler(event)

### async def `combined_handler(event: MessageEvent) -> bool`

源代码

    async def combined_handler(event: MessageEvent) -> bool:
        return await self.handler(event) and await other.handler(event)

### class `Rule`

### def `__init__(self, handler: RuleHandlerFunc) -> None`

源代码

    def __init__(self, handler: RuleHandlerFunc):
        self.handler = handler