Skip to content

Commit 4c3e138

Browse files
authored
fixed '\' being added to long messages
1 parent e2c5d2e commit 4c3e138

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

script.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ def save_conversation_history(user_id, history):
8787
def split_message(text, max_lines=3, max_chars_per_line=100):
8888
"""Split a long message into smaller chunks for better WhatsApp readability."""
8989
# First split by existing newlines
90-
paragraphs = text.split('\n')
90+
paragraphs = text.split('\\n')
9191
chunks = []
9292
current_chunk = []
9393
current_line_count = 0
@@ -319,4 +319,4 @@ def webhook():
319319

320320
if __name__ == '__main__':
321321
# For development with webhook testing via ngrok
322-
app.run(debug=True, port=5001, host='0.0.0.0')
322+
app.run(debug=True, port=5001, host='0.0.0.0')

0 commit comments

Comments
 (0)