MCPcopy
hub / github.com/nonebot/nonebot2 / add_prefix

Method add_prefix

nonebot/rule.py:81–85  ·  view source on GitHub ↗
(cls, prefix: str, value: TRIE_VALUE)

Source from the content-addressed store, hash-verified

79
80 @classmethod
81 def add_prefix(cls, prefix: str, value: TRIE_VALUE) -> None:
82 if prefix in cls.prefix:
83 logger.warning(f'Duplicated prefix rule "{prefix}"')
84 return
85 cls.prefix[prefix] = value
86
87 @classmethod
88 def get_value(cls, bot: Bot, event: Event, state: T_State) -> CMD_RESULT:

Callers 3

commandFunction · 0.80
shell_commandFunction · 0.80
test_trieFunction · 0.80

Calls

no outgoing calls

Tested by 1

test_trieFunction · 0.64