replace new strings with spaces in /add

This commit is contained in:
Rykov7
2023-01-15 23:03:44 +03:00
parent d099ba7d2b
commit 60b86a73cc
+2 -2
View File
@@ -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'✅ <b>Добавил</b>\n └ <i>{message.reply_to_message.text}</i>')
stan_quotes.write(message.reply_to_message.text.replace('\n', ' ') + '\n')
bot.send_message(message.chat.id, '✅ <b>Добавил</b>\n └ <i>' + message.reply_to_message.text.replace("\n", " ") + '</i>')
else:
bot.send_message(message.chat.id,
f'⛔️ <b>Не добавил</b>, есть токое\n └ <i>{message.reply_to_message.text}</i>')