diff --git a/.idea/deployment.xml b/.idea/deployment.xml new file mode 100644 index 0000000..d5d0de2 --- /dev/null +++ b/.idea/deployment.xml @@ -0,0 +1,15 @@ + + + + + + + + + + + + + + \ No newline at end of file diff --git a/.idea/encodings.xml b/.idea/encodings.xml new file mode 100644 index 0000000..15a15b2 --- /dev/null +++ b/.idea/encodings.xml @@ -0,0 +1,4 @@ + + + + \ No newline at end of file diff --git a/.idea/lono.iml b/.idea/lono.iml index 6711606..148add1 100644 --- a/.idea/lono.iml +++ b/.idea/lono.iml @@ -2,7 +2,7 @@ - + diff --git a/.idea/misc.xml b/.idea/misc.xml index 9a28146..0347726 100644 --- a/.idea/misc.xml +++ b/.idea/misc.xml @@ -78,5 +78,5 @@ - + \ No newline at end of file diff --git a/get_users_list.py b/get_users_list.py new file mode 100644 index 0000000..80515ba --- /dev/null +++ b/get_users_list.py @@ -0,0 +1,20 @@ +#!/usr/bin/env python3 + +from html import escape + +from models import Subscriber +from telegram import Bot + +from config import BOT_TOKEN + + +bot = Bot(BOT_TOKEN) + +subs = Subscriber.select() +messages = [] +for sub in subs: + chat = bot.send_message(sub.user_id, '.').chat + chat_name = escape(f'{chat.first_name or ""} {chat.last_name or ""} {chat.title or ""}'.rstrip()) + messages.append(f'#{sub.id:>4} {sub.user_id:>20} {chat_name}') + +bot.send_message(98934915, '\n'.join(messages))