Skip to main content

- Resource Pack
- Liteyuki Function
- Liteyuki Plugin
- Communication
- - 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.on

SnowyKami
Less than 1 minute
API

On This Page

- def on_message(rule: Rule, priority: int, block: bool) -> Matcher
- var current_priority = -1
- var matcher = Matcher(rule, priority, block)
- var current_priority = matcher.priority

### def `on_message(rule: Rule, priority: int, block: bool) -> Matcher`

源代码

    def on_message(rule: Rule=Rule(), priority: int=0, block: bool=True) -> Matcher:
        matcher = Matcher(rule, priority, block)
        for (i, m) in enumerate(_matcher_list):
            if m.priority < matcher.priority:
                _matcher_list.insert(i, matcher)
                break
        else:
            _matcher_list.append(matcher)
        return matcher

### var `current_priority = -1`

### var `matcher = Matcher(rule, priority, block)`

### var `current_priority = matcher.priority`