Add member name conflict warning. Closes #10.

This commit is contained in:
Ske
2018-11-30 21:51:57 +01:00
parent c36a054519
commit 728c8ee8d0
6 changed files with 25 additions and 6 deletions

View File

@@ -147,6 +147,11 @@ class System(namedtuple("System", ["id", "hid", "name", "description", "tag", "a
proxy_prefix = member.prefix or ""
proxy_suffix = member.suffix or ""
if not proxy_prefix and not proxy_suffix:
# If the member has neither a prefix or a suffix, cancel early
# Otherwise it'd match any message no matter what
continue
# Check if the message matches these tags
if message.startswith(proxy_prefix) and message.endswith(proxy_suffix):
# If the message starts with a mention, "separate" that and match the bit after