From 60b86a73cc6fe905f6e1644cbf67580887473eea Mon Sep 17 00:00:00 2001 From: Rykov7 Date: Sun, 15 Jan 2023 23:03:44 +0300 Subject: [PATCH] replace new strings with spaces in /add --- app/bot.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/bot.py b/app/bot.py index 3bfa254..0dd0bd5 100644 --- a/app/bot.py +++ b/app/bot.py @@ -269,8 +269,8 @@ def add_stan_quote(message): if message.reply_to_message and message.reply_to_message.text: with open('Stan.txt', 'a', encoding='utf8') as stan_quotes: if message.reply_to_message.text not in (i.rstrip() for i in open('Stan.txt', 'r', encoding='utf8')): - stan_quotes.write(message.reply_to_message.text + '\n') - bot.send_message(message.chat.id, f'✅ Добавил\n └ {message.reply_to_message.text}') + stan_quotes.write(message.reply_to_message.text.replace('\n', ' ') + '\n') + bot.send_message(message.chat.id, '✅ Добавил\n └ ' + message.reply_to_message.text.replace("\n", " ") + '') else: bot.send_message(message.chat.id, f'⛔️ Не добавил, есть токое\n └ {message.reply_to_message.text}')