From de15a932faec80fe647ca27aaad979a24b543241 Mon Sep 17 00:00:00 2001 From: bakatrouble Date: Tue, 2 Apr 2019 09:17:25 +0300 Subject: [PATCH] fool's day rollback --- .idea/misc.xml | 75 -------------------------------------------------- main.py | 10 ++----- 2 files changed, 2 insertions(+), 83 deletions(-) diff --git a/.idea/misc.xml b/.idea/misc.xml index 9a28146..9dfb3cf 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -3,80 +3,5 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/main.py b/main.py index 802bb66..e100f2b 100755 --- a/main.py +++ b/main.py @@ -1,7 +1,6 @@ #!/usr/bin/env python3 import logging -import random import traceback from html import escape from queue import Queue, Empty @@ -144,12 +143,8 @@ def _sign_text(text, m: Message, limit): sign = '' if text.startswith('!sign') or text.startswith('/sign'): text = text[5:] - # sign = f'\n\n____________\n' \ - # f'by {escape(m.from_user.full_name)}' - subs = conn.root.subscribers - random_user = subs[random.choice(list(subs.keys()))] sign = f'\n\n____________\n' \ - f'by {escape(random_user.name)}' + f'by {escape(m.from_user.full_name)}' return text[:limit - len(sign)] + sign @@ -289,8 +284,7 @@ def _process_message(bot: Bot, m: Message): r = bot.send_venue(uid, l.latitude, l.longitude, v.title, v.address, v.foursquare_id, reply_to_message_id=reply_to_message_id) elif hasattr(m, 'text') and m.text: - r = bot.send_message(uid, text, 'html', reply_to_message_id=reply_to_message_id, - disable_web_page_preview=True) + r = bot.send_message(uid, text, 'html', reply_to_message_id=reply_to_message_id) if r: user.update_from_message(r) user.messages_forward[r.message_id] = conn.root.counter