pull/405/head
midoks 2 years ago
parent 14940d6734
commit 4601303065
  1. 2
      plugins/tgclient/startup/extend/client_check_member.py
  2. 23
      plugins/tgclient/startup/extend/client_holding.py

@ -21,7 +21,7 @@ from telebot.util import quick_markup
# 指定群ID
chat_id_list = [-1001578009023]
chat_id_list = [-1001578009023, -953760154]
async def run(client):
while True:

@ -15,29 +15,18 @@ import asyncio
sys.path.append(os.getcwd() + "/class/core")
import mw
import telebot
from telebot import types
from telebot.util import quick_markup
from telethon import utils
# 指定群ID
chat_id = -953760154
async def run(client):
while True:
s = await client.send_message(chat_id, '开始自动检测已经注销群成员...')
count = 0
async for user in client.iter_participants(chat_id):
if user.deleted:
count += 1
msg = await client.kick_participant(chat_id, user)
await client.edit_message(chat_id, s.id, '已经检测到有(%d)个账户已失效' % (count))
await asyncio.sleep(3)
await client.edit_message(chat_id, s.id, '自动检测已经注销群成员完毕!!!')
await asyncio.sleep(3)
await client.delete_messages(chat_id, s)
await asyncio.sleep(300)
info = await client.get_dialogs()
for chat in info:
if chat.is_group:
print('name:{0} ids:{1} is_user:{2} is_channel{3} is_group:{4}'.format(
chat.name, chat.id, chat.is_user, chat.is_channel, chat.is_group))
if __name__ == "__main__":

Loading…
Cancel
Save