Implemented find_group and find_user
This commit is contained in:
@@ -1,14 +1,13 @@
|
||||
from pyrogram.types import Message
|
||||
|
||||
from classes.pyroclient import PyroClient
|
||||
from classes.pyrogroup import PyroGroup
|
||||
|
||||
|
||||
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)
|
||||
group = await PyroGroup.create_if_not_exists(group_id)
|
||||
group = await app.find_group(group_id)
|
||||
|
||||
if user.score == 0 and user.failed == 0:
|
||||
if group.ban_failed:
|
||||
@@ -25,7 +24,7 @@ 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)
|
||||
group = await PyroGroup.create_if_not_exists(group_id)
|
||||
group = await app.find_group(group_id)
|
||||
|
||||
if user.score < 6 or user.failed:
|
||||
if group.ban_failed:
|
||||
|
Reference in New Issue
Block a user