mirror of
https://github.com/midoks/mdserver-web.git
synced 2026-10-18 23:45:52 +08:00
Update client_check_member.py
This commit is contained in:
@@ -21,23 +21,24 @@ from telebot.util import quick_markup
|
|||||||
|
|
||||||
|
|
||||||
# 指定群ID
|
# 指定群ID
|
||||||
chat_id = -1001578009023
|
chat_id_list = [-1001578009023]
|
||||||
|
|
||||||
async def run(client):
|
async def run(client):
|
||||||
while True:
|
while True:
|
||||||
s = await client.send_message(chat_id, '开始自动检测已经注销群成员...')
|
for chat_id in chat_id_list:
|
||||||
count = 0
|
s = await client.send_message(chat_id, '开始自动检测已经注销群成员...')
|
||||||
async for user in client.iter_participants(chat_id):
|
count = 0
|
||||||
if user.deleted:
|
async for user in client.iter_participants(chat_id):
|
||||||
count += 1
|
if user.deleted:
|
||||||
msg = await client.kick_participant(chat_id, user)
|
count += 1
|
||||||
|
msg = await client.kick_participant(chat_id, user)
|
||||||
|
|
||||||
await client.edit_message(chat_id, s.id, '已经检测到有(%d)个账户已失效' % (count))
|
await client.edit_message(chat_id, s.id, '已经检测到有(%d)个账户已失效' % (count))
|
||||||
await asyncio.sleep(3)
|
await asyncio.sleep(3)
|
||||||
await client.edit_message(chat_id, s.id, '自动检测已经注销群成员完毕!!!')
|
await client.edit_message(chat_id, s.id, '自动检测已经注销群成员完毕!!!')
|
||||||
await asyncio.sleep(3)
|
await asyncio.sleep(3)
|
||||||
await client.delete_messages(chat_id, s)
|
await client.delete_messages(chat_id, s)
|
||||||
await asyncio.sleep(300)
|
await asyncio.sleep(300)
|
||||||
|
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|||||||
Reference in New Issue
Block a user