feat: accept !start name without quotes, strip typographic quotes

This commit is contained in:
Oliver Hofmann
2026-05-17 12:35:44 +02:00
parent e1485e72f0
commit 3ff8381e5a
2 changed files with 19 additions and 2 deletions
+15
View File
@@ -21,6 +21,21 @@ def test_start_with_single_word_name():
assert result == ("start", "Bauer")
def test_start_without_quotes():
result = parse_trigger(msg(CURRENT_USER, "!start Stephan Rehfeld"), CURRENT_USER)
assert result == ("start", "Stephan Rehfeld")
def test_start_with_typographic_quotes():
result = parse_trigger(msg(CURRENT_USER, "“start” is not this, but: !start “Anna Bauer”"), CURRENT_USER)
assert result is None # not a trigger — just a regular message
def test_start_with_smart_quotes_around_name():
result = parse_trigger(msg(CURRENT_USER, '!start “Anna Bauer”'), CURRENT_USER)
assert result == ("start", "Anna Bauer")
def test_start_without_name_returns_placeholder():
result = parse_trigger(msg(CURRENT_USER, "!start"), CURRENT_USER)
assert result == ("start", "Unbekannter Vortragender")