From b7f8cd5f7bfb83479505e8623315cc51cdf8aed4 Mon Sep 17 00:00:00 2001 From: Amit Sharma <48654350+buddhhu@users.noreply.github.com> Date: Thu, 15 Apr 2021 19:43:52 +0530 Subject: [PATCH] Fixed afk --- plugins/afk.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/plugins/afk.py b/plugins/afk.py index ef210de..b104793 100644 --- a/plugins/afk.py +++ b/plugins/afk.py @@ -20,7 +20,9 @@ from datetime import datetime from pyUltroid.functions.pmpermit_db import * from telethon import events -from telethon.tl import functions, types +from telethon.tl.functions.account import GetPrivacyRequest +from telethon.tl.types import InputPrivacyKeyStatusTimestamp, PrivacyValueAllowAll + from . import * @@ -182,9 +184,9 @@ async def _(event): pic = None if not USER_AFK: last_seen_status = await ultroid_bot( - functions.account.GetPrivacyRequest(types.InputPrivacyKeyStatusTimestamp()), + GetPrivacyRequest(InputPrivacyKeyStatusTimestamp()), ) - if isinstance(last_seen_status.rules, types.PrivacyValueAllowAll): + if isinstance(last_seen_status.rules, PrivacyValueAllowAll): afk_time = datetime.datetime.now() USER_AFK = f"yes: {reason} {pic}" if reason: