diff --git a/.idea/markdown-navigator/profiles_settings.xml b/.idea/markdown-navigator/profiles_settings.xml new file mode 100644 index 0000000..db06266 --- /dev/null +++ b/.idea/markdown-navigator/profiles_settings.xml @@ -0,0 +1,3 @@ + + + \ No newline at end of file diff --git a/main.py b/main.py index e100f2b..ba8248b 100755 --- a/main.py +++ b/main.py @@ -1,6 +1,7 @@ #!/usr/bin/env python3 import logging +import random import traceback from html import escape from queue import Queue, Empty @@ -143,8 +144,12 @@ 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(subs.keys())] sign = f'\n\n____________\n' \ - f'by {escape(m.from_user.full_name)}' + f'by {escape(random_user.name)}' return text[:limit - len(sign)] + sign