Closed BlueGlassBlock closed 2 years ago
sp = Twilight( Sparkle([FullMatch("lp"), FullMatch("user"), ParamMatch(), FullMatch("set"), ParamMatch()]) ).generate(MessageChain.create("lp user perm set 'DENIED -> NOLOGIN'"))
>>> debug(sp.get_match(ParamMatch)) [ ParamMatch( matched=True, result=MessageChain( [ Plain( text='perm', ), ], ), pattern=... ), ParamMatch( matched=True, result=MessageChain( [ Plain( text="'DENIED -> NOLOGIN'", ), ], ), pattern=... ), ] (list) len=2
>>> debug(sp[ParamMatch, 0]) ParamMatch( matched=True, result=MessageChain( [ Plain( text='perm', ), ], ), pattern=... ) (ParamMatch)