|
23 | 23 | from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup |
24 | 24 | from tgbot_ping import get_runtime |
25 | 25 | from token_bucket import Limiter, MemoryStorage |
26 | | -from youtubesearchpython import VideosSearch |
27 | 26 |
|
28 | 27 | from client_init import create_app |
29 | 28 | from config import (AUTHORIZED_USER, BURST, ENABLE_CELERY, ENABLE_FFMPEG, |
|
32 | 31 | from db import InfluxDB, MySQL, Redis |
33 | 32 | from limit import VIP, verify_payment |
34 | 33 | from tasks import app as celery_app |
35 | | -from tasks import (audio_entrance, direct_download_entrance, hot_patch, |
| 34 | +from tasks import (audio_entrance, direct_download_entrance, hot_patch, purge_tasks, |
36 | 35 | ytdl_download_entrance) |
37 | 36 | from utils import (auto_restart, customize_logger, get_revision, |
38 | 37 | get_user_settings, set_user_settings) |
@@ -159,6 +158,13 @@ def uncache_handler(client: "Client", message: "types.Message"): |
159 | 158 | message.reply_text(f"{count} cache(s) deleted.", quote=True) |
160 | 159 |
|
161 | 160 |
|
| 161 | +@app.on_message(filters.command(["purge"])) |
| 162 | +def purge_handler(client: "Client", message: "types.Message"): |
| 163 | + username = message.from_user.username |
| 164 | + if username == OWNER: |
| 165 | + message.reply_text(purge_tasks, quote=True) |
| 166 | + |
| 167 | + |
162 | 168 | @app.on_message(filters.command(["ping"])) |
163 | 169 | def ping_handler(client: "Client", message: "types.Message"): |
164 | 170 | chat_id = message.chat.id |
|
0 commit comments