1
Fork 0
mirror of https://github.com/RYGhub/royalnet.git synced 2024-11-23 03:24:20 +00:00

🐛 Fix bot not accepting multiple spaces

This commit is contained in:
Steffo 2021-04-26 00:42:27 +02:00
parent b4665a407b
commit 850c19bdef
Signed by: steffo
GPG key ID: 6965406171929D01

View file

@ -32,7 +32,7 @@ def register_telegram(conv, names, syntax=None):
name_regex = rf"(?:{'|'.join(names)})" name_regex = rf"(?:{'|'.join(names)})"
bot_regex = rf"(?:@{config['telegram.bot.username']})?" bot_regex = rf"(?:@{config['telegram.bot.username']})?"
if syntax: if syntax:
syntax_regex = f" {syntax}" syntax_regex = rf"\s+{syntax}"
else: else:
syntax_regex = "" syntax_regex = ""
regex = rf"^/{name_regex}{bot_regex}{syntax_regex}$" regex = rf"^/{name_regex}{bot_regex}{syntax_regex}$"