32 lines
862 B
Python
32 lines
862 B
Python
from pyrogram.types import Message
|
|
|
|
from classes.pyroclient import PyroClient
|
|
|
|
|
|
async def kick_unstarted(
|
|
app: PyroClient, user_id: int, group_id: int, message_id: int
|
|
) -> None:
|
|
user = await app.find_user(user_id, group_id)
|
|
|
|
if user.score == 0 and user.failed == 0:
|
|
banned = await app.ban_chat_member(group_id, user_id)
|
|
|
|
if isinstance(banned, Message):
|
|
await banned.delete()
|
|
|
|
await app.delete_messages(group_id, message_id)
|
|
|
|
|
|
async def kick_unverified(
|
|
app: PyroClient, user_id: int, group_id: int, message_id: int
|
|
) -> None:
|
|
user = await app.find_user(user_id, group_id)
|
|
|
|
if user.score < 6 or user.failed:
|
|
banned = await app.ban_chat_member(group_id, user_id)
|
|
|
|
if isinstance(banned, Message):
|
|
await banned.delete()
|
|
|
|
await app.delete_messages(group_id, message_id)
|