Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update filters.py #29

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,11 +71,11 @@ Thanks to [InfotelGroup](https://telegram.dog/InFoTelGroup) and [Erich Daniken](
## Installation

### Deploy to Heroku
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/TroJanzHEX/Auto-Filter-Bot-V2)
[![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/sachin9742s/Auto-Filter-Bot-V2)

### Deploy in your vps
```sh
git clone https://github.com/TroJanzHEX/Auto-Filter-Bot-V2
git clone https://github.com/sachin9742s/Auto-Filter-Bot-V2
cd Auto-Filter-Bot-V2
pip3 install -r requirements.txt
# <Create config.py appropriately>
Expand Down
40 changes: 22 additions & 18 deletions plugins/filters.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
# @trojanzhex
# @KicchaRequest


import re
Expand Down Expand Up @@ -62,7 +62,9 @@ async def filter(client: Bot, message: Message):
[InlineKeyboardButton(text="📃 Pages 1/1",callback_data="pages")]
)
await message.reply_text(
f"<b> Here is the result for {message.text}</b>",
f"<b> 🎬 Title :
🎞 Year :
💿 Quality : {message.text}</b>",
reply_markup=InlineKeyboardMarkup(buttons)
)
return
Expand All @@ -71,14 +73,16 @@ async def filter(client: Bot, message: Message):
buttons = data['buttons'][0].copy()

buttons.append(
[InlineKeyboardButton(text="NEXT ",callback_data=f"next_0_{keyword}")]
[InlineKeyboardButton(text="🎸 NEXT 🎸",callback_data=f"next_0_{keyword}")]
)
buttons.append(
[InlineKeyboardButton(text=f"📃 Pages 1/{data['total']}",callback_data="pages")]
[InlineKeyboardButton(text=f"🎶 Pages 1/{data['total']}",callback_data="pages")]
)

await message.reply_text(
f"<b> Here is the result for {message.text}</b>",
f"<b> 🎬 Title :
🎞 Year :
💿 Quality : {message.text}</b>",
reply_markup=InlineKeyboardMarkup(buttons)
)

Expand All @@ -99,10 +103,10 @@ async def cb_handler(client: Bot, query: CallbackQuery):
buttons = data['buttons'][int(index)+1].copy()

buttons.append(
[InlineKeyboardButton(" BACK", callback_data=f"back_{int(index)+1}_{keyword}")]
[InlineKeyboardButton("🎵 BACK 🎵", callback_data=f"back_{int(index)+1}_{keyword}")]
)
buttons.append(
[InlineKeyboardButton(f"📃 Pages {int(index)+2}/{data['total']}", callback_data="pages")]
[InlineKeyboardButton(f"🎶 Pages {int(index)+2}/{data['total']}", callback_data="pages")]
)

await query.edit_message_reply_markup(
Expand All @@ -113,10 +117,10 @@ async def cb_handler(client: Bot, query: CallbackQuery):
buttons = data['buttons'][int(index)+1].copy()

buttons.append(
[InlineKeyboardButton(" BACK", callback_data=f"back_{int(index)+1}_{keyword}"),InlineKeyboardButton("NEXT ", callback_data=f"next_{int(index)+1}_{keyword}")]
[InlineKeyboardButton("🎵 BACK 🎵", callback_data=f"back_{int(index)+1}_{keyword}"),InlineKeyboardButton("🎸 NEXT 🎸", callback_data=f"next_{int(index)+1}_{keyword}")]
)
buttons.append(
[InlineKeyboardButton(f"📃 Pages {int(index)+2}/{data['total']}", callback_data="pages")]
[InlineKeyboardButton(f"🎶 Pages {int(index)+2}/{data['total']}", callback_data="pages")]
)

await query.edit_message_reply_markup(
Expand All @@ -134,10 +138,10 @@ async def cb_handler(client: Bot, query: CallbackQuery):
buttons = data['buttons'][int(index)-1].copy()

buttons.append(
[InlineKeyboardButton("NEXT ", callback_data=f"next_{int(index)-1}_{keyword}")]
[InlineKeyboardButton("🎸 NEXT 🎸", callback_data=f"next_{int(index)-1}_{keyword}")]
)
buttons.append(
[InlineKeyboardButton(f"📃 Pages {int(index)}/{data['total']}", callback_data="pages")]
[InlineKeyboardButton(f"🎶 Pages {int(index)}/{data['total']}", callback_data="pages")]
)

await query.edit_message_reply_markup(
Expand All @@ -148,10 +152,10 @@ async def cb_handler(client: Bot, query: CallbackQuery):
buttons = data['buttons'][int(index)-1].copy()

buttons.append(
[InlineKeyboardButton(" BACK", callback_data=f"back_{int(index)-1}_{keyword}"),InlineKeyboardButton("NEXT ", callback_data=f"next_{int(index)-1}_{keyword}")]
[InlineKeyboardButton("🎵 BACK 🎵", callback_data=f"back_{int(index)-1}_{keyword}"),InlineKeyboardButton("🎸 NEXT 🎸", callback_data=f"next_{int(index)-1}_{keyword}")]
)
buttons.append(
[InlineKeyboardButton(f"📃 Pages {int(index)}/{data['total']}", callback_data="pages")]
[InlineKeyboardButton(f"🎶 Pages {int(index)}/{data['total']}", callback_data="pages")]
)

await query.edit_message_reply_markup(
Expand All @@ -167,9 +171,9 @@ async def cb_handler(client: Bot, query: CallbackQuery):
elif query.data == "start_data":
await query.answer()
keyboard = InlineKeyboardMarkup([
[InlineKeyboardButton("HELP", callback_data="help_data"),
InlineKeyboardButton("ABOUT", callback_data="about_data")],
[InlineKeyboardButton("⭕️ JOIN OUR CHANNEL ⭕️", url="https://t.me/TroJanzHEX")]
[InlineKeyboardButton("HELP", callback_data="help_data"),
InlineKeyboardButton("ABOUT", callback_data="about_data")],
[InlineKeyboardButton(" JOIN OUR CHANNEL ", url="https://t.me/ROCKHDMOVIES2021")]
])

await query.message.edit_text(
Expand All @@ -184,7 +188,7 @@ async def cb_handler(client: Bot, query: CallbackQuery):
keyboard = InlineKeyboardMarkup([
[InlineKeyboardButton("BACK", callback_data="start_data"),
InlineKeyboardButton("ABOUT", callback_data="about_data")],
[InlineKeyboardButton("⭕️ SUPPORT ⭕️", url="https://t.me/TroJanzSupport")]
[InlineKeyboardButton(" SUPPORT ", url="https://t.me/KicchaRequest")]
])

await query.message.edit_text(
Expand All @@ -199,7 +203,7 @@ async def cb_handler(client: Bot, query: CallbackQuery):
keyboard = InlineKeyboardMarkup([
[InlineKeyboardButton("BACK", callback_data="help_data"),
InlineKeyboardButton("START", callback_data="start_data")],
[InlineKeyboardButton("SOURCE CODE", url="https://github.com/TroJanzHEX/Auto-Filter-Bot-V2")]
[InlineKeyboardButton("SOURCE CODE", url="https://t.me/KicchaRequest")]
])

await query.message.edit_text(
Expand Down