Spaces:
Paused
Paused
taslim19
commited on
Commit
·
48dd506
1
Parent(s):
5b1240d
fix(afk): correct afk behavior
Browse files
DragMusic/plugins/tools/afk.py
CHANGED
|
@@ -60,6 +60,7 @@ async def active_afk(_, message: Message):
|
|
| 60 |
f"{message.from_user.first_name} ɪs ʙᴀᴄᴋ ᴏɴʟɪɴᴇ",
|
| 61 |
disable_web_page_preview=True,
|
| 62 |
)
|
|
|
|
| 63 |
|
| 64 |
# Handle both command format and plain text format
|
| 65 |
if message.command:
|
|
@@ -173,6 +174,13 @@ chat_watcher_group = 1
|
|
| 173 |
async def chat_watcher_func(_, message):
|
| 174 |
if message.sender_chat:
|
| 175 |
return
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 176 |
userid = message.from_user.id
|
| 177 |
user_name = message.from_user.first_name
|
| 178 |
if message.entities:
|
|
@@ -267,8 +275,8 @@ async def chat_watcher_func(_, message):
|
|
| 267 |
photo=f"/tmp/downloads/{replied_user_id}.jpg",
|
| 268 |
caption=f"{replied_first_name[:25]} ɪs ᴀғᴋ sɪɴᴄᴇ {seenago}\n\nReason: {reasonafk}\n\n",
|
| 269 |
)
|
| 270 |
-
except
|
| 271 |
-
msg += f"{replied_first_name} ɪs
|
| 272 |
except:
|
| 273 |
pass
|
| 274 |
|
|
@@ -376,4 +384,4 @@ async def chat_watcher_func(_, message):
|
|
| 376 |
try:
|
| 377 |
send = await message.reply_text(msg, disable_web_page_preview=True)
|
| 378 |
except:
|
| 379 |
-
|
|
|
|
| 60 |
f"{message.from_user.first_name} ɪs ʙᴀᴄᴋ ᴏɴʟɪɴᴇ",
|
| 61 |
disable_web_page_preview=True,
|
| 62 |
)
|
| 63 |
+
return
|
| 64 |
|
| 65 |
# Handle both command format and plain text format
|
| 66 |
if message.command:
|
|
|
|
| 174 |
async def chat_watcher_func(_, message):
|
| 175 |
if message.sender_chat:
|
| 176 |
return
|
| 177 |
+
|
| 178 |
+
message_text = (message.text or message.caption or "").lower()
|
| 179 |
+
if message.command and message.command[0].lower() in ["afk", "brb"]:
|
| 180 |
+
return
|
| 181 |
+
if re.match(r"^(afk|brb)(?:\s+.*)?$", message_text):
|
| 182 |
+
return
|
| 183 |
+
|
| 184 |
userid = message.from_user.id
|
| 185 |
user_name = message.from_user.first_name
|
| 186 |
if message.entities:
|
|
|
|
| 275 |
photo=f"/tmp/downloads/{replied_user_id}.jpg",
|
| 276 |
caption=f"{replied_first_name[:25]} ɪs ᴀғᴋ sɪɴᴄᴇ {seenago}\n\nReason: {reasonafk}\n\n",
|
| 277 |
)
|
| 278 |
+
except:
|
| 279 |
+
msg += f"{replied_first_name[:25]} ɪs ᴀғᴋ\n\n"
|
| 280 |
except:
|
| 281 |
pass
|
| 282 |
|
|
|
|
| 384 |
try:
|
| 385 |
send = await message.reply_text(msg, disable_web_page_preview=True)
|
| 386 |
except:
|
| 387 |
+
pass
|