This commit is contained in:
Juan 2021-07-22 13:34:43 +07:00 committed by GitHub
parent 08d149ef18
commit 979a17c902
Signed by untrusted user: GitHub
GPG Key ID: 4AEE18F83AFDEB23
6 changed files with 18 additions and 16 deletions

View File

@ -56,7 +56,7 @@ Type /{BotCommands.HelpCommand} to get a list of available commands
if update.message.chat.type == "private" :
sendMessage(f"Hey I'm Alive 🙂\nSince: <code>{uptime}</code>", context.bot, update)
else :
update.effective_message.reply_text(start_string, reply_markup=reply_markup)
sendMarkup(start_string, context.bot, update, reply_markup)
else :
sendMessage(f"Oops! not a Authorized user.", context.bot, update)

View File

@ -3,13 +3,13 @@
from pyrogram import filters, types, emoji
from bot.helper.telegram_helper.bot_commands import BotCommands
from bot import app, OWNER_ID
from bot import app, OWNER_ID, bot
from bot.helper import get_text, check_heroku
from bot import *
# Add Variable
@app.on_message(filters.command('setvar') & filters.user(OWNER_ID))
@app.on_message(filters.command(['setvar', f'setvar@{bot.username}']) & filters.user(OWNER_ID))
@check_heroku
async def set_varr(client, message, app_):
msg_ = await message.reply_text("`Please Wait!`")
@ -34,7 +34,7 @@ async def set_varr(client, message, app_):
# Delete Variable
@app.on_message(filters.command('delvar') & filters.user(OWNER_ID))
@app.on_message(filters.command(['delvar', f'delvar@{bot.username}']) & filters.user(OWNER_ID))
@check_heroku
async def del_varr(client, message, app_):
msg_ = await message.reply_text("`Please Wait!`", parse_mode="markdown")
@ -52,7 +52,7 @@ async def del_varr(client, message, app_):
parse_mode="markdown")
del heroku_var[_var]
@app.on_message(filters.command(['reboot']) & filters.user(OWNER_ID))
@app.on_message(filters.command(['reboot', f'reboot@{bot.username}']) & filters.user(OWNER_ID))
@check_heroku
async def gib_restart(client, message, hap):
msg_ = await message.reply_text("[HEROKU] - Restarting")
@ -62,7 +62,7 @@ async def gib_restart(client, message, hap):
__header__='📕 **Page** **{}**\n\n'
@app.on_message(filters.command(BotCommands.ConfigMenuCommand) & filters.user(OWNER_ID))
@app.on_message(filters.command([BotCommands.ConfigMenuCommand, f'{BotCommands.ConfigMenuCommand}@{bot.username}']) & filters.user(OWNER_ID))
async def config_menu(_, message):
await message.reply(
f"**Hello {message.from_user.mention}**,\n\n**If you want to add or set Variable in Heroku use** `/setvar`\n\n**If you want to delete Variable in Heroku use `/delvar`**\n\n**WARNING! Very Recommended to do this command in private since it's contain Bot info.**\n\n**Here's This is Slam-MirrorBot Current Configs**",

View File

@ -6,6 +6,7 @@ import traceback
from contextlib import redirect_stdout
from bot.helper.telegram_helper.filters import CustomFilters
from bot.helper.telegram_helper.bot_commands import BotCommands
from bot.helper.telegram_helper.message_utils import sendMessage
from bot import LOGGER, dispatcher
from telegram import ParseMode
from telegram.ext import CommandHandler
@ -126,7 +127,7 @@ def exechelp(update, context):
<code>/exec</code> <i>Run Commands In Exec</i>
<code>/clearlocals</code> <i>Cleared locals</i>
'''
update.effective_message.reply_text(help_string, parse_mode=ParseMode.HTML)
sendMessage(help_string, context.bot, update)
EVAL_HANDLER = CommandHandler(('eval'), evaluate, filters=CustomFilters.owner_filter, run_async=True)

View File

@ -5,11 +5,11 @@
import os
from pyrogram import filters
from pyrogram.types import InlineKeyboardButton, InlineKeyboardMarkup
from bot import app
from bot import app, bot
from bot.helper.telegram_helper.bot_commands import BotCommands
from bot.helper import post_to_telegraph, runcmd, safe_filename
@app.on_message(filters.command(BotCommands.MediaInfoCommand))
@app.on_message(filters.command([BotCommands.MediaInfoCommand, f'{BotCommands.MediaInfoCommand}@{bot.username}']))
async def mediainfo(client, message):
reply = message.reply_to_message
if not reply:

View File

@ -18,10 +18,11 @@ from pyrogram.parser import html as pyrogram_html
from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
from pyrogram.handlers import MessageHandler, CallbackQueryHandler
from bot import app, dispatcher
from bot import app, dispatcher, bot
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.message_utils import sendMessage
search_lock = asyncio.Lock()
search_info = {False: dict(), True: dict()}
@ -72,14 +73,14 @@ async def return_search(query, page=1, sukebei=False):
message_info = dict()
ignore = set()
@app.on_message(filters.command(['nyaasi']))
@app.on_message(filters.command(['nyaasi', f'nyaasi@{bot.username}']))
async def nyaa_search(client, message):
text = message.text.split(' ')
text.pop(0)
query = ' '.join(text)
await init_search(client, message, query, False)
@app.on_message(filters.command(['sukebei']))
@app.on_message(filters.command(['sukebei', f'sukebei@{bot.username}']))
async def nyaa_search_sukebei(client, message):
text = message.text.split(' ')
text.pop(0)
@ -166,7 +167,7 @@ class TorrentSearch:
self.source = source.rstrip('/')
self.RESULT_STR = result_str
app.add_handler(MessageHandler(self.find, filters.command([command])))
app.add_handler(MessageHandler(self.find, filters.command([command, f'{self.command}@{bot.username}'])))
app.add_handler(CallbackQueryHandler(self.previous, filters.regex(f"{self.command}_previous")))
app.add_handler(CallbackQueryHandler(self.delete, filters.regex(f"{self.command}_delete")))
app.add_handler(CallbackQueryHandler(self.next, filters.regex(f"{self.command}_next")))
@ -330,7 +331,7 @@ def searchhelp(update, context):
<code>/rarbg</code> <i>[search query]</i>
<code>/ts</code> <i>[search query]</i>
'''
update.effective_message.reply_text(help_string, parse_mode=ParseMode.HTML)
sendMessage(help_string, context.bot, update)
SEARCHHELP_HANDLER = CommandHandler(BotCommands.TsHelpCommand, searchhelp, filters=(CustomFilters.authorized_chat | CustomFilters.authorized_user) & CustomFilters.mirror_owner_filter, run_async=True)

View File

@ -13,7 +13,7 @@ from git.exc import GitCommandError, InvalidGitRepositoryError, NoSuchPathError
from pyrogram import filters
from bot import app, OWNER_ID, UPSTREAM_REPO, UPSTREAM_BRANCH
from bot import app, OWNER_ID, UPSTREAM_REPO, UPSTREAM_BRANCH, bot
from bot.helper import runcmd, get_text, HEROKU_URL
from bot.helper.telegram_helper.bot_commands import BotCommands
@ -22,7 +22,7 @@ BRANCH_ = UPSTREAM_BRANCH
# Update Command
@app.on_message(filters.command(BotCommands.UpdateCommand) & filters.user(OWNER_ID))
@app.on_message(filters.command([BotCommands.UpdateCommand, f'{BotCommands.UpdateCommand}@{bot.username}']) & filters.user(OWNER_ID))
async def update_it(client, message):
msg_ = await message.reply_text("`Updating Please Wait!`")
try: