Path: blob/master/bot/modules/services.py
1619 views
from time import time12from ..helper.ext_utils.bot_utils import new_task3from ..helper.telegram_helper.button_build import ButtonMaker4from ..helper.telegram_helper.message_utils import send_message, edit_message, send_file5from ..helper.telegram_helper.filters import CustomFilters6from ..helper.telegram_helper.bot_commands import BotCommands789@new_task10async def start(_, message):11buttons = ButtonMaker()12buttons.url_button(13"Repo", "https://www.github.com/anasty17/mirror-leech-telegram-bot"14)15buttons.url_button("Code Owner", "https://t.me/anas_tayyar")16reply_markup = buttons.build_menu(2)17if await CustomFilters.authorized(_, message):18start_string = f"""19This bot can mirror from links|tgfiles|torrents|nzb|rclone-cloud to any rclone cloud, Google Drive or to telegram.20Type /{BotCommands.HelpCommand} to get a list of available commands21"""22await send_message(message, start_string, reply_markup)23else:24await send_message(25message,26"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",27reply_markup,28)293031@new_task32async def ping(_, message):33start_time = int(round(time() * 1000))34reply = await send_message(message, "Starting Ping")35end_time = int(round(time() * 1000))36await edit_message(reply, f"{end_time - start_time} ms")373839@new_task40async def log(_, message):41await send_file(message, "log.txt")424344