Update Command
Signed-off-by: breakdowns <hafitz666@outlook.co.id>
This commit is contained in:
parent
5602c113c2
commit
00fb002f82
|
|
@ -11,7 +11,7 @@
|
||||||

|

|
||||||

|

|
||||||

|

|
||||||
[](https://t.me/SlamMirrorSupport)
|
[](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.
|
**Slam Mirror Bot** is a _multipurpose_ Telegram Bot writen in Python for mirroring files on the Internet to our beloved Google Drive.
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -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.ext_utils.bot_utils import get_readable_file_size, get_readable_time
|
||||||
from .helper.telegram_helper.filters import CustomFilters
|
from .helper.telegram_helper.filters import CustomFilters
|
||||||
from bot.helper.telegram_helper import button_build
|
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'))
|
now=datetime.now(pytz.timezone('Asia/Jakarta'))
|
||||||
|
|
||||||
|
|
@ -147,7 +147,9 @@ def bot_help(update, context):
|
||||||
|
|
||||||
/{BotCommands.ShellCommand}: Run commands in Shell (Terminal)
|
/{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'''
|
help_string = f'''
|
||||||
|
|
@ -181,7 +183,7 @@ def bot_help(update, context):
|
||||||
|
|
||||||
/{BotCommands.MediaInfoCommand}: Get detailed info about replied media (Only for Telegram file)
|
/{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):
|
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.RestartCommand}','Restart the bot [owner/sudo only]'),
|
||||||
BotCommand(f'{BotCommands.LogCommand}','Get the Bot Log [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'{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():
|
def main():
|
||||||
|
|
|
||||||
|
|
@ -29,5 +29,7 @@ class _BotCommands:
|
||||||
self.ConfigMenuCommand = 'config'
|
self.ConfigMenuCommand = 'config'
|
||||||
self.ShellCommand = 'shell'
|
self.ShellCommand = 'shell'
|
||||||
self.UpdateCommand = 'update'
|
self.UpdateCommand = 'update'
|
||||||
|
self.ExecHelpCommand = 'exechelp'
|
||||||
|
self.TsHelpCommand = 'tshelp'
|
||||||
|
|
||||||
BotCommands = _BotCommands()
|
BotCommands = _BotCommands()
|
||||||
|
|
|
||||||
|
|
@ -46,6 +46,12 @@ async def del_varr(client, message, app_):
|
||||||
await msg_.edit(f"`Sucessfully Deleted {_var} Var!`", parse_mode="markdown")
|
await msg_.edit(f"`Sucessfully Deleted {_var} Var!`", parse_mode="markdown")
|
||||||
del heroku_var[_var]
|
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 #
|
# CONFIG LIST #
|
||||||
|
|
||||||
__header__='📕 **Page** **{}**\n\n'
|
__header__='📕 **Page** **{}**\n\n'
|
||||||
|
|
|
||||||
|
|
@ -5,7 +5,8 @@ import textwrap
|
||||||
import traceback
|
import traceback
|
||||||
from contextlib import redirect_stdout
|
from contextlib import redirect_stdout
|
||||||
from bot.helper.telegram_helper.filters import CustomFilters
|
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 import ParseMode
|
||||||
from telegram.ext import CommandHandler
|
from telegram.ext import CommandHandler
|
||||||
|
|
||||||
|
|
@ -119,11 +120,21 @@ def clear(update, context):
|
||||||
send("Cleared locals.", bot, update)
|
send("Cleared locals.", bot, update)
|
||||||
|
|
||||||
|
|
||||||
EVAL_HANDLER = CommandHandler(('e', 'ev', 'eva', 'eval'), evaluate, filters=CustomFilters.owner_filter, run_async=True)
|
def exechelp(update, context):
|
||||||
EXEC_HANDLER = CommandHandler(('x', 'ex', 'exe', 'exec', 'py'), execute, filters=CustomFilters.owner_filter, run_async=True)
|
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)
|
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(EVAL_HANDLER)
|
||||||
dispatcher.add_handler(EXEC_HANDLER)
|
dispatcher.add_handler(EXEC_HANDLER)
|
||||||
dispatcher.add_handler(CLEAR_HANDLER)
|
dispatcher.add_handler(CLEAR_HANDLER)
|
||||||
|
dispatcher.add_handler(EXECHELP_HANDLER)
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ from pyrogram.handlers import MessageHandler, CallbackQueryHandler
|
||||||
|
|
||||||
from bot import app, dispatcher, IMAGE_URL
|
from bot import app, dispatcher, IMAGE_URL
|
||||||
from bot.helper import custom_filters
|
from bot.helper import custom_filters
|
||||||
|
from bot.helper.telegram_helper.bot_commands import BotCommands
|
||||||
from bot.helper.telegram_helper.filters import CustomFilters
|
from bot.helper.telegram_helper.filters import CustomFilters
|
||||||
|
|
||||||
search_lock = asyncio.Lock()
|
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)
|
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)
|
dispatcher.add_handler(SEARCHHELP_HANDLER)
|
||||||
Loading…
Reference in New Issue