This commit is contained in:
bakatrouble 2019-04-01 14:12:31 +03:00
parent cbf244ca45
commit ef8a66052d
2 changed files with 9 additions and 1 deletions

View File

@ -0,0 +1,3 @@
<component name="MarkdownNavigator.ProfileManager">
<settings default="" pdf-export="" plain-text-search-scope="Project Files" />
</component>

View File

@ -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 <a href="tg://user?id={m.from_user.id}">{escape(m.from_user.full_name)}</a>'
subs = conn.root.subscribers
random_user = subs[random.choice(subs.keys())]
sign = f'\n\n____________\n' \
f'by <a href="tg://user?id={m.from_user.id}">{escape(m.from_user.full_name)}</a>'
f'by <a href="https://telegra.ph/C-pervym-aprelya-04-01">{escape(random_user.name)}</a>'
return text[:limit - len(sign)] + sign