Update Command

Signed-off-by: breakdowns <hafitz666@outlook.co.id>
This commit is contained in:
Hafitz Setya 2021-07-07 19:41:01 +07:00 committed by GitHub
parent 5602c113c2
commit 00fb002f82
Signed by untrusted user: GitHub
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 32 additions and 10 deletions

View File

@ -11,7 +11,7 @@
![GitHub repo size](https://img.shields.io/github/repo-size/breakdowns/slam-mirrorbot?color=red)
![GitHub commit activity](https://img.shields.io/github/commit-activity/m/breakdowns/slam-mirrorbot)
![GitHub](https://img.shields.io/github/license/breakdowns/slam-mirrorbot)
[![Slam Mirror Support](https://img.shields.io/badge/slam%20mirror%20bot-support%20group-blue)](https://t.me/SlamMirrorSupport)
[![Slam Mirror Updates](https://img.shields.io/badge/slam%20mirror%20bot-channel-blue)](https://t.me/SlamMirrorUpdates)
**Slam Mirror Bot** is a _multipurpose_ Telegram Bot writen in Python for mirroring files on the Internet to our beloved Google Drive.

View File

@ -18,7 +18,7 @@ from bot.helper.telegram_helper.message_utils import *
from .helper.ext_utils.bot_utils import get_readable_file_size, get_readable_time
from .helper.telegram_helper.filters import CustomFilters
from bot.helper.telegram_helper import button_build
from .modules import authorize, list, cancel_mirror, mirror_status, mirror, clone, watch, shell, eval, search, delete, speedtest, usage, mediainfo, count, config, updates
from .modules import authorize, list, cancel_mirror, mirror_status, mirror, clone, watch, shell, eval, torrent_search, delete, speedtest, usage, mediainfo, count, config, updates
now=datetime.now(pytz.timezone('Asia/Jakarta'))
@ -147,7 +147,9 @@ def bot_help(update, context):
/{BotCommands.ShellCommand}: Run commands in Shell (Terminal)
/tshelp: Get help for Torrent search module
/{BotCommands.ExecHelpCommand}: Get help for Executor module
/{BotCommands.TsHelpCommand}: Get help for Torrent search module
'''
help_string = f'''
@ -181,7 +183,7 @@ def bot_help(update, context):
/{BotCommands.MediaInfoCommand}: Get detailed info about replied media (Only for Telegram file)
/tshelp: Get help for Torrent search module
/{BotCommands.TsHelpCommand}: Get help for Torrent search module
'''
if CustomFilters.sudo_user(update) or CustomFilters.owner_filter(update):
@ -209,7 +211,7 @@ BotCommand(f'{BotCommands.PingCommand}','Ping the Bot'),
BotCommand(f'{BotCommands.RestartCommand}','Restart the bot [owner/sudo only]'),
BotCommand(f'{BotCommands.LogCommand}','Get the Bot Log [owner/sudo only]'),
BotCommand(f'{BotCommands.MediaInfoCommand}','Get detailed info about replied media'),
BotCommand(f'/tshelp','Get help for Torrent search module')]
BotCommand(f'{BotCommands.TsHelpCommand}','Get help for Torrent search module')]
def main():

View File

@ -29,5 +29,7 @@ class _BotCommands:
self.ConfigMenuCommand = 'config'
self.ShellCommand = 'shell'
self.UpdateCommand = 'update'
self.ExecHelpCommand = 'exechelp'
self.TsHelpCommand = 'tshelp'
BotCommands = _BotCommands()

View File

@ -46,6 +46,12 @@ async def del_varr(client, message, app_):
await msg_.edit(f"`Sucessfully Deleted {_var} Var!`", parse_mode="markdown")
del heroku_var[_var]
@app.on_message(filters.command(['reboot']) & filters.user(OWNER_ID))
@check_heroku
async def gib_restart(client, message, hap):
msg_ = await message.reply_text("[HEROKU] - Restarting")
hap.restart()
# CONFIG LIST #
__header__='📕 **Page** **{}**\n\n'

View File

@ -5,7 +5,8 @@ import textwrap
import traceback
from contextlib import redirect_stdout
from bot.helper.telegram_helper.filters import CustomFilters
from bot import LOGGER, dispatcher
from bot.helper.telegram_helper.bot_commands import BotCommands
from bot import LOGGER, dispatcher, IMAGE_URL
from telegram import ParseMode
from telegram.ext import CommandHandler
@ -119,11 +120,21 @@ def clear(update, context):
send("Cleared locals.", bot, update)
EVAL_HANDLER = CommandHandler(('e', 'ev', 'eva', 'eval'), evaluate, filters=CustomFilters.owner_filter, run_async=True)
EXEC_HANDLER = CommandHandler(('x', 'ex', 'exe', 'exec', 'py'), execute, filters=CustomFilters.owner_filter, run_async=True)
def exechelp(update, context):
help_string = '''
• /eval <i>Run Python Code Line | Lines</i>
• /exec <i>Run Commands In Exec</i>
• /clearlocals <i>Cleared locals</i>
'''
update.effective_message.reply_photo(IMAGE_URL, help_string, parse_mode=ParseMode.HTML)
EVAL_HANDLER = CommandHandler(('eval'), evaluate, filters=CustomFilters.owner_filter, run_async=True)
EXEC_HANDLER = CommandHandler(('exec'), execute, filters=CustomFilters.owner_filter, run_async=True)
CLEAR_HANDLER = CommandHandler('clearlocals', clear, filters=CustomFilters.owner_filter, run_async=True)
EXECHELP_HANDLER = CommandHandler(BotCommands.ExecHelpCommand, exechelp, filters=CustomFilters.owner_filter, run_async=True)
dispatcher.add_handler(EVAL_HANDLER)
dispatcher.add_handler(EXEC_HANDLER)
dispatcher.add_handler(CLEAR_HANDLER)
dispatcher.add_handler(EXECHELP_HANDLER)

View File

@ -20,6 +20,7 @@ from pyrogram.handlers import MessageHandler, CallbackQueryHandler
from bot import app, dispatcher, IMAGE_URL
from bot.helper import custom_filters
from bot.helper.telegram_helper.bot_commands import BotCommands
from bot.helper.telegram_helper.filters import CustomFilters
search_lock = asyncio.Lock()
@ -332,5 +333,5 @@ def searchhelp(update, context):
update.effective_message.reply_photo(IMAGE_URL, help_string, parse_mode=ParseMode.HTML)
SEARCHHELP_HANDLER = CommandHandler("tshelp", searchhelp, filters=(CustomFilters.authorized_chat | CustomFilters.authorized_user) & CustomFilters.mirror_owner_filter, run_async=True)
SEARCHHELP_HANDLER = CommandHandler(BotCommands.TsHelpCommand, searchhelp, filters=(CustomFilters.authorized_chat | CustomFilters.authorized_user) & CustomFilters.mirror_owner_filter, run_async=True)
dispatcher.add_handler(SEARCHHELP_HANDLER)