target.py 273 B

1234567891011
  1. from __future__ import annotations
  2. def trigger_to_target(s: str) -> str:
  3. assert s[0] == "<"
  4. # Strip off the angle brackets
  5. s = s[1:-1]
  6. # If there is a [wildcard] or similar, strip that off too
  7. if s[-1] == "]":
  8. s = s.split("[")[0]
  9. return s