Spaces:
Paused
Paused
Download bot/modules/services.py from prad9036temp/leech: direct link, hf CLI and curl.
- Browser
- Download file 1.57 kB
-
https://huggingface.co/spaces/prad9036temp/leech/resolve/main/bot/modules/services.py
- Command line
-
hf download hf://spaces/prad9036temp/leech/bot/modules/services.py
-
curl -L -o services.py https://huggingface.co/spaces/prad9036temp/leech/resolve/main/bot/modules/services.py
1.57 kB
| from time import time | |
| from ..helper.ext_utils.bot_utils import new_task | |
| from ..helper.telegram_helper.button_build import ButtonMaker | |
| from ..helper.telegram_helper.message_utils import send_message, edit_message, send_file | |
| from ..helper.telegram_helper.filters import CustomFilters | |
| from ..helper.telegram_helper.bot_commands import BotCommands | |
| async def start(_, message): | |
| buttons = ButtonMaker() | |
| buttons.url_button( | |
| "Repo", "https://www.github.com/anasty17/mirror-leech-telegram-bot" | |
| ) | |
| buttons.url_button("Code Owner", "https://t.me/anas_tayyar") | |
| reply_markup = buttons.build_menu(2) | |
| if await CustomFilters.authorized(_, message): | |
| start_string = f""" | |
| This bot can mirror from links|tgfiles|torrents|nzb|rclone-cloud to any rclone cloud, Google Drive or to telegram. | |
| Type /{BotCommands.HelpCommand} to get a list of available commands | |
| """ | |
| await send_message(message, start_string, reply_markup) | |
| else: | |
| await send_message( | |
| message, | |
| "This bot can mirror from links|tgfiles|torrents|nzb|rclone-cloud to any rclone cloud, Google Drive or to telegram.\n\n⚠️ You Are not authorized user! Deploy your own mirror-leech bot", | |
| reply_markup, | |
| ) | |
| async def ping(_, message): | |
| start_time = int(round(time() * 1000)) | |
| reply = await send_message(message, "Starting Ping") | |
| end_time = int(round(time() * 1000)) | |
| await edit_message(reply, f"{end_time - start_time} ms") | |
| async def log(_, message): | |
| await send_file(message, "log.txt") | |