mirror of
https://github.com/yasirarism/MissKatyPyro.git
synced 2026-01-07 04:14:51 +00:00
One task per user
This commit is contained in:
parent
764b624536
commit
f8bcfe898d
1 changed files with 5 additions and 6 deletions
|
|
@ -8,7 +8,7 @@
|
||||||
import os
|
import os
|
||||||
import time
|
import time
|
||||||
import traceback
|
import traceback
|
||||||
from asyncio import gather, sleep, Lock
|
from asyncio import gather, sleep
|
||||||
from logging import getLogger
|
from logging import getLogger
|
||||||
from shutil import rmtree
|
from shutil import rmtree
|
||||||
|
|
||||||
|
|
@ -41,12 +41,11 @@ async def genss(client, message):
|
||||||
if media is None:
|
if media is None:
|
||||||
return await message.reply("Reply to a Telegram Video or document as video to generate screenshoot!")
|
return await message.reply("Reply to a Telegram Video or document as video to generate screenshoot!")
|
||||||
process = await message.reply_text("`Processing, please wait..`")
|
process = await message.reply_text("`Processing, please wait..`")
|
||||||
async with Lock():
|
if not DL_TASK.get(message.from_user.id):
|
||||||
if not DL_TASK.get(message.from_user.id):
|
DL_TASK[message.from_user.id] = True
|
||||||
DL_TASK[message.from_user.id] = Lock()
|
|
||||||
|
|
||||||
if DL_TASK.get(message.from_user.id).unlocked:
|
if DL_TASK.get(message.from_user.id):
|
||||||
return await process.edit("Sorry to avoid flood and error, bot only process one task at a time.")
|
return await process.edit("Sorry to avoid flood and error, bot only process one task at a time.")
|
||||||
c_time = time.time()
|
c_time = time.time()
|
||||||
the_real_download_location = await replied.download(
|
the_real_download_location = await replied.download(
|
||||||
progress=progress_for_pyrogram,
|
progress=progress_for_pyrogram,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue