Dbu-central-bot / app /core /handles.py
cipher-attacks's picture
2-channel gate, hide empty courses
a0261c0
Raw History Blame Contribute Delete
424 Bytes
import re
def parse_handles(raw: str) -> list[str]:
""""DBUCentral, @DBUcentralforum" -> ["@DBUCentral", "@DBUcentralforum"] (no duplicates, case-insensitive)."""
seen, out = set(), []
for part in re.split(r"[,\s]+", raw or ""):
handle = part.strip().lstrip("@")
if handle and handle.lower() not in seen:
seen.add(handle.lower())
out.append("@" + handle)
return out