We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent b36303b commit e1c7716Copy full SHA for e1c7716
1 file changed
kokkoro/bot/discord/discord_util.py
@@ -12,7 +12,7 @@ def remove_mention_me(raw_message) -> (str, bool):
12
return raw_message.replace(MENTION_BOT, "").strip(), True
13
return raw_message, False
14
15
-dc_at_pattern = r'<@![a-z0-9A-Z]+>'
+dc_at_pattern = r'<@!?[a-z0-9A-Z]+>'
16
def normalize_message(raw_message: str) -> str:
17
"""
18
规范化 at 信息,"<@!123> waht<@!312>a12" => "@123 waht @312 a12"
@@ -26,4 +26,7 @@ def normalize_at(raw_at):
26
27
规范化 at 信息,"<@!123>" => " @123 "
28
29
- return f' @{raw_at[3:-1]} '
+ if '!' in raw_at:
30
+ return f' @{raw_at[3:-1]} '
31
+ else:
32
+ return f' @{raw_at[2:-1]} '
0 commit comments