This commit is contained in:
bakatrouble 2020-06-17 14:50:54 +03:00
parent 563389ad36
commit 4726c01d23

View File

@ -1,4 +1,5 @@
#!/usr/bin/env python3
import json
from telegram import Bot
@ -13,7 +14,11 @@ def send_users_list(bot: Bot = None, conn=None):
if not bot:
bot = Bot(BOT_TOKEN)
subs = conn.root.subscribers.values()
try:
with open('fake_users.json') as f:
subs = [Subscriber(*data) for data in json.load(f).items()]
except:
subs = conn.root.subscribers.values()
messages = [f'Count: {len(subs)}\n']
for sub in subs: # type: Subscriber