update get users list script
This commit is contained in:
parent
d59d17a6d9
commit
d43140cc77
@ -11,10 +11,11 @@ from config import BOT_TOKEN
|
|||||||
bot = Bot(BOT_TOKEN)
|
bot = Bot(BOT_TOKEN)
|
||||||
|
|
||||||
subs = Subscriber.select()
|
subs = Subscriber.select()
|
||||||
|
|
||||||
messages = []
|
messages = []
|
||||||
for sub in subs:
|
for sub in subs:
|
||||||
chat = bot.send_message(sub.user_id, '.').chat
|
chat = bot.send_message(sub.user_id, '.').chat
|
||||||
chat_name = escape(f'{chat.first_name or ""} {chat.last_name or ""} {chat.title or ""}'.rstrip())
|
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}')
|
messages.append(f'<pre>#{sub.id:>4} {sub.user_id:>20} </pre><a href="tg://user?id={sub.user_id}">{chat_name}</a>')
|
||||||
|
|
||||||
bot.send_message(98934915, '\n'.join(messages))
|
bot.send_message(98934915, '\n'.join(messages), parse_mode='html')
|
||||||
|
Loading…
Reference in New Issue
Block a user