From 8f686e6466818c96643df1195aaaaf0cd3904743 Mon Sep 17 00:00:00 2001 From: Ramforth Date: Thu, 30 Oct 2025 19:01:43 +0100 Subject: [PATCH] Fix SyntaxError in emoji_pattern regex in pytchat_listener.py (correct multi-line string) --- pytchat_listener.py | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/pytchat_listener.py b/pytchat_listener.py index a4561cf..771519f 100644 --- a/pytchat_listener.py +++ b/pytchat_listener.py @@ -46,18 +46,18 @@ def main(): # Add coloring for standard emojis emoji_pattern = re.compile( - (" # Start capturing group - "\U0001F600-\U0001F64F" # emoticons - "\U0001F300-\U0001F5FF" # symbols & pictographs - "\U0001F680-\U0001F6FF" # transport & map symbols - "\U0001F1E0-\U0001F1FF" # flags (iOS) - "\U00002702-\U000027B0" # Dingbats - "\U000024C2-\U0001F251" # Enclosed characters - "\U0001F900-\U0001F9FF" # Supplemental Symbols and Pictographs - "\U0000200D" # Zero Width Joiner (for emoji sequences) - "\U0000FE0F" # Variation Selector-16 (for emoji presentation) - ")+ - , re.UNICODE) + r"(" + r" # Start capturing group + r"\U0001F600-\U0001F64F" # emoticons + r"\U0001F300-\U0001F5FF" # symbols & pictographs + r"\U0001F680-\U0001F6FF" # transport & map symbols + r"\U0001F1E0-\U0001F1FF" # flags (iOS) + r"\U00002702-\U000027B0" # Dingbats + r"\U000024C2-\U0001F251" # Enclosed characters + r"\U0001F900-\U0001F9FF" # Supplemental Symbols and Pictographs + r"\U0000200D" # Zero Width Joiner (for emoji sequences) + r"\U0000FE0F" # Variation Selector-16 (for emoji presentation) + r")+", re.UNICODE) message_text = emoji_pattern.sub(r'[magenta]\1[/magenta]', message_text) # Alternate background styles @@ -84,4 +84,4 @@ def main(): console.print(f"[green]Chat log saved to {log_filename}[/green]") if __name__ == '__main__': - main() \ No newline at end of file + main()