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

Method __init__

nonebot/plugin/on.py:479–486  ·  view source on GitHub ↗

命令前缀

(
        self, cmd: str | tuple[str, ...], prefix_aliases: bool = False, **kwargs
    )

Source from the content-addressed store, hash-verified

477 """
478
479 def __init__(
480 self, cmd: str | tuple[str, ...], prefix_aliases: bool = False, **kwargs
481 ):
482 """命令前缀"""
483 super().__init__(**kwargs)
484 self.basecmd: tuple[str, ...] = (cmd,) if isinstance(cmd, str) else cmd
485 self.base_kwargs.pop("aliases", None)
486 self.prefix_aliases = prefix_aliases
487
488 def __repr__(self) -> str:
489 return f"CommandGroup(cmd={self.basecmd}, matchers={len(self.matchers)})"

Callers

nothing calls this directly

Calls 2

popMethod · 0.80
__init__Method · 0.45

Tested by

no test coverage detected