跳至主要內容

liteyuki.message.rule

远野千束小于 1 分钟API

async def empty_rule(event: MessageEvent) -> bool

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

async def is_su_rule(event: MessageEvent) -> bool

源代码
@Rule
async def is_su_rule(event: MessageEvent) -> bool:
    return str(event.user_id) in _superusers

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