diff --git a/Stan.txt b/Stan.txt index 890cf7c..daed886 100644 --- a/Stan.txt +++ b/Stan.txt @@ -356,4 +356,4 @@ facepalm.jpg не бережешь ты себя, золотой ты человек 🦔 наш человек че там -хренасси год начинается, в чате питон обсуждают \ No newline at end of file +хренасси год начинается, в чате питон обсуждают diff --git a/app/bot.py b/app/bot.py index 0374c3f..a21f9f3 100644 --- a/app/bot.py +++ b/app/bot.py @@ -268,7 +268,7 @@ 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('\n' + message.reply_to_message.text) + stan_quotes.write(message.reply_to_message.text + '\n') bot.send_message(message.chat.id, f'✅ Добавил\n └ {message.reply_to_message.text}') else: bot.send_message(message.chat.id, @@ -279,9 +279,9 @@ def add_stan_quote(message): def remove_stan_quote(message): if message.reply_to_message and message.reply_to_message.text: if message.reply_to_message.text in (i.rstrip() for i in open('Stan.txt', 'r', encoding='utf8')): - quotes = [i.rstrip() for i in open('Stan.txt', 'r', encoding='utf8')] + quotes = list(open('Stan.txt', 'r', encoding='utf8')) with open('Stan.txt', 'w', encoding='utf8') as stan_quotes: - quotes.remove(message.reply_to_message.text) + quotes.remove(message.reply_to_message.text + '\n') stan_quotes.writelines(quotes) bot.send_message(message.chat.id, f'✅ Удолил\n └ {message.reply_to_message.text}') else: diff --git a/app/stan.py b/app/stan.py index 1cf3f3a..eed6c44 100644 --- a/app/stan.py +++ b/app/stan.py @@ -5,4 +5,4 @@ import random def speak(chance_of): number = random.randint(0, chance_of) if number == 0: - return random.choice(i.rstrip() for i in open('Stan.txt', 'r', encoding='utf8')) + return random.choice(i.rstrip() for i in open('Stan.txt', 'r', encoding='utf8') if i)