From 2f2142cb2a2159180419d4edc5ff236da15ae215 Mon Sep 17 00:00:00 2001
From: Cynite <105969534+CyniteOfficial@users.noreply.github.com>
Date: Wed, 31 May 2023 16:08:20 +0530
Subject: [PATCH 01/15] Create runtime.txt
---
runtime.txt | 1 +
1 file changed, 1 insertion(+)
create mode 100644 runtime.txt
diff --git a/runtime.txt b/runtime.txt
new file mode 100644
index 0000000..371cfe3
--- /dev/null
+++ b/runtime.txt
@@ -0,0 +1 @@
+3.11.1
From 43ff53b7beb090b3332f3e1ad56f268deb1cac2b Mon Sep 17 00:00:00 2001
From: Cynite <105969534+CyniteOfficial@users.noreply.github.com>
Date: Wed, 31 May 2023 16:09:35 +0530
Subject: [PATCH 02/15] Update README.md
---
README.md | 3 ---
1 file changed, 3 deletions(-)
diff --git a/README.md b/README.md
index 831c4f3..e2f54f7 100644
--- a/README.md
+++ b/README.md
@@ -13,6 +13,3 @@
* [](https://t.me/Cynitesupport)
-## Deploy
-
-[](https://heroku.com/deploy?template=https://github.com/TechnicalCynite/Channel-Post-Filter)
From 3231b3c2369709ca2c83a0c750924c0236cc5530 Mon Sep 17 00:00:00 2001
From: Cynite <105969534+CyniteOfficial@users.noreply.github.com>
Date: Wed, 31 May 2023 16:11:22 +0530
Subject: [PATCH 03/15] Create run cmd.txt
---
run cmd.txt | 1 +
1 file changed, 1 insertion(+)
create mode 100644 run cmd.txt
diff --git a/run cmd.txt b/run cmd.txt
new file mode 100644
index 0000000..ca82f18
--- /dev/null
+++ b/run cmd.txt
@@ -0,0 +1 @@
+gunicorn app:app & python3 main.py
From 8157a72e6af08ba183441ce14afbfa698dfe43e7 Mon Sep 17 00:00:00 2001
From: Cynite <105969534+CyniteOfficial@users.noreply.github.com>
Date: Wed, 31 May 2023 16:12:03 +0530
Subject: [PATCH 04/15] Create app.py
---
app.py | 13 +++++++++++++
1 file changed, 13 insertions(+)
create mode 100644 app.py
diff --git a/app.py b/app.py
new file mode 100644
index 0000000..d61229f
--- /dev/null
+++ b/app.py
@@ -0,0 +1,13 @@
+from flask import Flask
+
+app = Flask(__name__)
+
+@app.route('/')
+
+def hello_world():
+
+ return 'Bharat'
+
+if __name__ == "__main__":
+
+ app.run()
From f4a33cfb4a8b88930aa546e3328acfd3d6db6e1e Mon Sep 17 00:00:00 2001
From: Cynite <105969534+CyniteOfficial@users.noreply.github.com>
Date: Wed, 31 May 2023 16:13:08 +0530
Subject: [PATCH 05/15] Update requirements.txt
---
requirements.txt | 3 +++
1 file changed, 3 insertions(+)
diff --git a/requirements.txt b/requirements.txt
index dd4406d..77d6b25 100644
--- a/requirements.txt
+++ b/requirements.txt
@@ -5,3 +5,6 @@ cinemagoer
aiohttp
aiofiles
asyncio
+psutil
+Flask==2.2.2
+gunicorn==20.1.0
From e08250c7c742c0462c1c97b36d57b208aab6a5e5 Mon Sep 17 00:00:00 2001
From: Cynite <105969534+CyniteOfficial@users.noreply.github.com>
Date: Wed, 31 May 2023 16:16:36 +0530
Subject: [PATCH 06/15] Delete info.py
---
info.py | 8 --------
1 file changed, 8 deletions(-)
delete mode 100644 info.py
diff --git a/info.py b/info.py
deleted file mode 100644
index 22ed598..0000000
--- a/info.py
+++ /dev/null
@@ -1,8 +0,0 @@
-API_ID = 18156600
-API_HASH = "15862aff26ae5165ce6991382780a458"
-BOT_TOKEN = "5895738935:AAE3CcWv1IQA2eclX9fdHEdJC2298FXRZRg"
-SESSION = "BQEVDDgAqAeqpwh6ISGOHhApFeAW2aOQ1fgvqNm5kH5dR2DFH3AGfjSAG6gtsq4Mz2Ra6uekSou5X1Breuqjs-DTnHtHNfRVDj3RB86iRFlIF1mA7R4kHDvGF-qVFGMbUjePCSFarxFZch-AHNN4SspYH_i3KHN5h_juhSOSlT5O2iVGIq2CNp22_aPxWkifsBrQnUuyJ3tKTy7_HQ734ICQ5RATZtWtMdO0kCUbY6TyhgYJ0L8jm7AnsqnEmBdM2UkF4fuuasDrOmDocrm39vbITKNgjnucAODx2AtY8bSD5qNDx-BH_vIORzuGF72wqzU19kDzlpyb_-Uqx483blPHyKfOQgAAAAFhSwkGAA"
-DATABASE_URI = "mongodb+srv://channelbot:channelbot@cluster0.anurlrs.mongodb.net/?retryWrites=true&w=majority"
-LOG_CHANNEL = -1001884373226
-ADMIN = 1883570185
-CHANNEL = "@CyNiTeBaCkUp"
From 8582ff3974594531b557195c5923131a230a8a64 Mon Sep 17 00:00:00 2001
From: Cynite <105969534+CyniteOfficial@users.noreply.github.com>
Date: Wed, 31 May 2023 16:16:56 +0530
Subject: [PATCH 07/15] Create info.py
---
info.py | 8 ++++++++
1 file changed, 8 insertions(+)
create mode 100644 info.py
diff --git a/info.py b/info.py
new file mode 100644
index 0000000..0159545
--- /dev/null
+++ b/info.py
@@ -0,0 +1,8 @@
+API_ID =
+API_HASH = ""
+BOT_TOKEN = ""
+SESSION = ""
+DATABASE_URI = ""
+LOG_CHANNEL =
+ADMIN =
+CHANNEL = "@CyNiTeBaCkUp"
From e199fc4078994a7733aecc43578502a7f724a194 Mon Sep 17 00:00:00 2001
From: Cynite <105969534+CyniteOfficial@users.noreply.github.com>
Date: Thu, 1 Jun 2023 10:53:50 +0530
Subject: [PATCH 08/15] Delete Plugins directory
---
Plugins/broadcast.py | 97 -------------------------------------
Plugins/connect.py | 113 -------------------------------------------
Plugins/fsub.py | 94 -----------------------------------
Plugins/misc.py | 60 -----------------------
Plugins/search.py | 93 -----------------------------------
Plugins/verify.py | 56 ---------------------
6 files changed, 513 deletions(-)
delete mode 100644 Plugins/broadcast.py
delete mode 100644 Plugins/connect.py
delete mode 100644 Plugins/fsub.py
delete mode 100644 Plugins/misc.py
delete mode 100644 Plugins/search.py
delete mode 100644 Plugins/verify.py
diff --git a/Plugins/broadcast.py b/Plugins/broadcast.py
deleted file mode 100644
index eb864fb..0000000
--- a/Plugins/broadcast.py
+++ /dev/null
@@ -1,97 +0,0 @@
-import datetime
-import time
-from info import *
-from utils import *
-from pyrogram import Client, filters
-from pyrogram.errors import FloodWait
-import asyncio
-
-@Client.on_message(filters.command('broadcast') & filters.user(ADMIN))
-async def broadcast(bot, message):
- if not message.reply_to_message:
- return await message.reply("Use this command as a reply to any message!")
- m=await message.reply("Please wait...")
-
- count, users = await get_users()
- stats = "β‘ Broadcast Processing.."
- br_msg = message.reply_to_message
- total = count
- remaining = total
- success = 0
- failed = 0
-
- for user in users:
- chat_id = user["_id"]
- trying = await copy_msgs(br_msg, chat_id)
- if trying==False:
- failed+=1
- remaining-=1
- else:
- success+=1
- remaining-=1
- try:
- await m.edit(script.BROADCAST.format(stats, total, remaining, success, failed))
- except:
- pass
- stats = "β
Broadcast Completed"
- await m.reply(script.BROADCAST.format(stats, total, remaining, success, failed))
- await m.delete()
-
-
-@Client.on_message(filters.command('broadcast_groups') & filters.user(ADMIN))
-async def grp_broadcast(bot, message):
- if not message.reply_to_message:
- return await message.reply("Use this command as a reply to any message!")
- m=await message.reply("Please wait...")
-
- count, groups = await get_groups()
- stats = "β‘ Broadcast Processing.."
- br_msg = message.reply_to_message
- total = count
- remaining = total
- success = 0
- failed = 0
-
- for group in groups:
- chat_id = group["_id"]
- trying = await grp_copy_msgs(br_msg, chat_id)
- if trying==False:
- failed+=1
- remaining-=1
- else:
- success+=1
- remaining-=1
- try:
- await m.edit(script.BROADCAST.format(stats, total, remaining, success, failed))
- except:
- pass
- stats = "β
Broadcast Completed"
- await m.reply(script.BROADCAST.format(stats, total, remaining, success, failed))
- await m.delete()
-
-
-
-async def grp_copy_msgs(br_msg, chat_id):
- try:
- h = await br_msg.copy(chat_id)
- try:
- await h.pin()
- except:
- pass
- except FloodWait as e:
- await asyncio.sleep(e.value)
- await copy_msgs(br_msg, chat_id)
- except Exception as e:
- await delete_group(chat_id)
- return False
-
-
-async def copy_msgs(br_msg, chat_id):
- try:
- await br_msg.copy(chat_id)
- except FloodWait as e:
- await asyncio.sleep(e.value)
- await copy_msgs(br_msg, chat_id)
- except Exception as e:
- await delete_user(chat_id)
- return False
diff --git a/Plugins/connect.py b/Plugins/connect.py
deleted file mode 100644
index 35ba712..0000000
--- a/Plugins/connect.py
+++ /dev/null
@@ -1,113 +0,0 @@
-from info import *
-from utils import *
-from client import User
-from pyrogram import Client, filters
-
-@Client.on_message(filters.group & filters.command("connect"))
-async def connect(bot, message):
- m=await message.reply("connecting..")
- user = await User.get_me()
- try:
- group = await get_group(message.chat.id)
- user_id = group["user_id"]
- user_name = group["user_name"]
- verified = group["verified"]
- channels = group["channels"].copy()
- except :
- return await bot.leave_chat(message.chat.id)
- if message.from_user.id!=user_id:
- return await m.edit(f"Only {user_name} can use this command π")
- if bool(verified)==False:
- return await m.edit("This chat is not verified!\nuse /verify")
- try:
- channel = int(message.command[-1])
- if channel in channels:
- return await message.reply("This channel is already connected! You Cant Connect Again")
- channels.append(channel)
- except:
- return await m.edit("β Incorrect format!\nUse `/connect ChannelID`")
- try:
- chat = await bot.get_chat(channel)
- group = await bot.get_chat(message.chat.id)
- c_link = chat.invite_link
- g_link = group.invite_link
- await User.join_chat(c_link)
- except Exception as e:
- if "The user is already a participant" in str(e):
- pass
- else:
- text = f"β Error: `{str(e)}`\nMake sure I'm admin in that channel & this group with all permissions and {(user.username or user.mention)} is not banned there"
- return await m.edit(text)
- await update_group(message.chat.id, {"channels":channels})
- await m.edit(f"β
Successfully connected to [{chat.title}]({c_link})!", disable_web_page_preview=True)
- text = f"#NewConnection\n\nUser: {message.from_user.mention}\nGroup: [{group.title}]({g_link})\nChannel: [{chat.title}]({c_link})"
- await bot.send_message(chat_id=LOG_CHANNEL, text=text)
-
-
-@Client.on_message(filters.group & filters.command("disconnect"))
-async def disconnect(bot, message):
- m=await message.reply("Please wait..")
- try:
- group = await get_group(message.chat.id)
- user_id = group["user_id"]
- user_name = group["user_name"]
- verified = group["verified"]
- channels = group["channels"].copy()
- except :
- return await bot.leave_chat(message.chat.id)
- if message.from_user.id!=user_id:
- return await m.edit(f"Only {user_name} can use this command π")
- if bool(verified)==False:
- return await m.edit("This chat is not verified!\nuse /verify")
- try:
- channel = int(message.command[-1])
- if channel not in channels:
- return await m.edit("You didn't added this channel yet Or Check Channel Id")
- channels.remove(channel)
- except:
- return await m.edit("β Incorrect format!\nUse `/disconnect ChannelID`")
- try:
- chat = await bot.get_chat(channel)
- group = await bot.get_chat(message.chat.id)
- c_link = chat.invite_link
- g_link = group.invite_link
- await User.leave_chat(channel)
- except Exception as e:
- text = f"β Error: `{str(e)}`\nMake sure I'm admin in that channel & this group with all permissions and {(user.username or user.mention)} is not banned there"
- return await m.edit(text)
- await update_group(message.chat.id, {"channels":channels})
- await m.edit(f"β
Successfully disconnected from [{chat.title}]({c_link})!", disable_web_page_preview=True)
- text = f"#DisConnection\n\nUser: {message.from_user.mention}\nGroup: [{group.title}]({g_link})\nChannel: [{chat.title}]({c_link})"
- await bot.send_message(chat_id=LOG_CHANNEL, text=text)
-
-
-@Client.on_message(filters.group & filters.command("connections"))
-async def connections(bot, message):
- group = await get_group(message.chat.id)
- user_id = group["user_id"]
- user_name = group["user_name"]
- channels = group["channels"]
- f_sub = group["f_sub"]
- if message.from_user.id!=user_id:
- return await message.reply(f"Only {user_name} can use this command π")
- if bool(channels)==False:
- return await message.reply("This group is currently not connected to any channels!\nConnect one using /connect")
- text = "This Group is currently connected to:\n\n"
- for channel in channels:
- try:
- chat = await bot.get_chat(channel)
- name = chat.title
- link = chat.invite_link
- text += f"πConnected Channel - [{name}]({link})\n"
- except Exception as e:
- await message.reply(f"β Error in `{channel}:`\n`{e}`")
- if bool(f_sub):
- try:
- f_chat = await bot.get_chat(channel)
- f_title = f_chat.title
- f_link = f_chat.invite_link
- text += f"\nFSub: [{f_title}]({f_link})"
- except Exception as e:
- await message.reply(f"β Error in FSub (`{f_sub}`)\n`{e}`")
-
- await message.reply(text=text, disable_web_page_preview=True)
diff --git a/Plugins/fsub.py b/Plugins/fsub.py
deleted file mode 100644
index 4585a5a..0000000
--- a/Plugins/fsub.py
+++ /dev/null
@@ -1,94 +0,0 @@
-from info import *
-from utils import *
-from pyrogram import Client, filters
-from pyrogram.types import ChatPermissions
-
-@Client.on_message(filters.group & filters.command("fsub"))
-async def f_sub_cmd(bot, message):
- m=await message.reply("Please wait..")
- try:
- group = await get_group(message.chat.id)
- user_id = group["user_id"]
- user_name = group["user_name"]
- verified = group["verified"]
- except :
- return await bot.leave_chat(message.chat.id)
- if message.from_user.id!=user_id:
- return await m.edit(f"Only {user_name} can use this command π")
- if bool(verified)==False:
- return await m.edit("This chat is not verified!\nuse /verify")
- try:
- f_sub = int(message.command[-1])
- except:
- return await m.edit("β Incorrect format!\nUse `/fsub ChannelID`")
- try:
- chat = await bot.get_chat(f_sub)
- group = await bot.get_chat(message.chat.id)
- c_link = chat.invite_link
- g_link = group.invite_link
- except Exception as e:
- text = f"β Error: `{str(e)}`\n\nMake sure I'm admin in that channel & this group with all permissions"
- return await m.edit(text)
- await update_group(message.chat.id, {"f_sub":f_sub})
- await m.edit(f"β
Successfully Attached ForceSub to [{chat.title}]({c_link})!", disable_web_page_preview=True)
- text = f"#NewFsub\n\nUser: {message.from_user.mention}\nGroup: [{group.title}]({g_link})\nChannel: [{chat.title}]({c_link})"
- await bot.send_message(chat_id=LOG_CHANNEL, text=text)
-
-@Client.on_message(filters.group & filters.command("nofsub"))
-async def nf_sub_cmd(bot, message):
- m=await message.reply("Disattaching..")
- try:
- group = await get_group(message.chat.id)
- user_id = group["user_id"]
- user_name = group["user_name"]
- verified = group["verified"]
- f_sub = group["f_sub"]
- except :
- return await bot.leave_chat(message.chat.id)
- if message.from_user.id!=user_id:
- return await m.edit(f"Only {user_name} can use this command π")
- if bool(verified)==False:
- return await m.edit("This chat is not verified!\nuse /verify")
- if bool(f_sub)==False:
- return await m.edit("This chat is currently don't have any FSub\nuse /fsub")
- try:
- chat = await bot.get_chat(f_sub)
- group = await bot.get_chat(message.chat.id)
- c_link = chat.invite_link
- g_link = group.invite_link
- except Exception as e:
- text = f"β Error: `{str(e)}`\n\nMake sure I'm admin in that channel & this group with all permissions"
- return await m.edit(text)
- await update_group(message.chat.id, {"f_sub":False})
- await m.edit(f"β
Successfully removed FSub from [{chat.title}]({c_link})!", disable_web_page_preview=True)
- text = f"#RemoveFsub\n\nUser: {message.from_user.mention}\nGroup: [{group.title}]({g_link})\nChannel: [{chat.title}]({c_link})"
- await bot.send_message(chat_id=LOG_CHANNEL, text=text)
-
-
-@Client.on_callback_query(filters.regex(r"^checksub"))
-async def f_sub_callback(bot, update):
- user_id = int(update.data.split("_")[-1])
- group = await get_group(update.message.chat.id)
- f_sub = group["f_sub"]
- admin = group["user_id"]
-
- if update.from_user.id!=user_id:
- return await update.answer("That's not for you π", show_alert=True)
- try:
- await bot.get_chat_member(f_sub, user_id)
- except UserNotParticipant:
- await update.answer("I like your smartness..\nBut don't be over smart π€", show_alert=True) # @subinps π
- except:
- await bot.restrict_chat_member(chat_id=update.message.chat.id,
- user_id=user_id,
- permissions=ChatPermissions(can_send_messages=True,
- can_send_media_messages=True,
- can_send_other_messages=True))
- await update.message.delete()
- else:
- await bot.restrict_chat_member(chat_id=update.message.chat.id,
- user_id=user_id,
- permissions=ChatPermissions(can_send_messages=True,
- can_send_media_messages=True,
- can_send_other_messages=True))
- await update.message.delete()
diff --git a/Plugins/misc.py b/Plugins/misc.py
deleted file mode 100644
index a4ca54d..0000000
--- a/Plugins/misc.py
+++ /dev/null
@@ -1,60 +0,0 @@
-from utils import *
-from pyrogram import Client, filters
-from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
-
-@Client.on_message(filters.command("start") & ~filters.channel)
-async def start(bot, message):
- await add_user(message.from_user.id, message.from_user.first_name)
- await message.reply(text=script.START.format(message.from_user.mention),
- disable_web_page_preview=True,
- reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton('β α΄α΄
α΄
α΄α΄ α΄α΄ Κα΄α΄Κ Ι’Κα΄α΄α΄ β', url=f'http://t.me/yourfindbot?startgroup=true')
- ],[InlineKeyboardButton("Κα΄Κα΄", callback_data="misc_help"),
- InlineKeyboardButton("α΄Κα΄α΄α΄", callback_data="misc_about")]]))
-@Client.on_message(filters.command("help"))
-async def help(bot, message):
- await message.reply(text=script.HELP,
- disable_web_page_preview=True)
-
-@Client.on_message(filters.command("about"))
-async def about(bot, message):
- await message.reply(text=script.ABOUT.format((await bot.get_me()).mention),
- disable_web_page_preview=True)
-
-@Client.on_message(filters.command("stats"))
-async def stats(bot, message):
- g_count, g_list = await get_groups()
- u_count, u_list = await get_users()
- await message.reply(script.STATS.format(u_count, g_count))
-
-@Client.on_message(filters.command("id"))
-async def id(bot, message):
- text = f"Current Chat ID: `{message.chat.id}`\n"
- if message.from_user:
- text += f"Your ID: `{message.from_user.id}`\n"
- if message.reply_to_message:
- if message.reply_to_message.from_user:
- text += f"Replied User ID: `{message.reply_to_message.from_user.id}`\n"
- if message.reply_to_message.forward_from:
- text += f"Replied Message Forward from User ID: `{message.reply_to_message.forward_from.id}`\n"
- if message.reply_to_message.forward_from_chat:
- text += f"Replied Message Forward from Chat ID: `{message.reply_to_message.forward_from_chat.id}\n`"
- await message.reply(text)
-
-@Client.on_callback_query(filters.regex(r"^misc"))
-async def misc(bot, update):
- data = update.data.split("_")[-1]
- if data=="home":
- await update.message.edit(text=script.START.format(update.from_user.mention),
- disable_web_page_preview=True,
- reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("Κα΄Κα΄", callback_data="misc_help"),
- InlineKeyboardButton("α΄Κα΄α΄α΄", callback_data="misc_about")]]))
- elif data=="help":
- await update.message.edit(text=script.HELP,
- disable_web_page_preview=True,
- reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("β¬
οΈ Back", callback_data="misc_home")]]))
-
- elif data=="about":
- await update.message.edit(text=script.ABOUT.format((await bot.get_me()).mention),
- disable_web_page_preview=True,
- reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("β¬
οΈ Back", callback_data="misc_home")]]))
-
diff --git a/Plugins/search.py b/Plugins/search.py
deleted file mode 100644
index f053a9e..0000000
--- a/Plugins/search.py
+++ /dev/null
@@ -1,93 +0,0 @@
-import asyncio
-from info import *
-from utils import *
-from time import time
-from client import User
-from pyrogram import Client, filters
-from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
-
-@Client.on_message(filters.text & filters.group & filters.incoming & ~filters.command(["verify", "connect", "id"]))
-async def search(bot, message):
- f_sub = await force_sub(bot, message)
- if f_sub==False:
- return
- channels = (await get_group(message.chat.id))["channels"]
- if bool(channels)==False:
- return
- if message.text.startswith("/"):
- return
- query = message.text
- head = "Here is the results π\n\nPowered By @CyniteBackup\n\n"
- results = ""
- try:
- for channel in channels:
- async for msg in User.search_messages(chat_id=channel, query=query):
- name = (msg.text or msg.caption).split("\n")[0]
- if name in results:
- continue
- results += f"β»οΈ {name}\nπ {msg.link}\n\n"
- if bool(results)==False:
- movies = await search_imdb(query)
- buttons = []
- for movie in movies:
- buttons.append([InlineKeyboardButton(movie['title'], callback_data=f"recheck_{movie['id']}")])
- msg = await message.reply_photo(photo="https://telegra.ph/file/cf6706158b0bfaf436f54.jpg",
- caption="I Couldn't find anything related to Your Queryπ.\nDid you mean any of these?",
- reply_markup=InlineKeyboardMarkup(buttons))
- else:
- msg = await message.reply_text(text=head+results, disable_web_page_preview=True)
- _time = (int(time()) + (15*60))
- await save_dlt_message(msg, _time)
- except:
- pass
-
-
-
-@Client.on_callback_query(filters.regex(r"^recheck"))
-async def recheck(bot, update):
- clicked = update.from_user.id
- try:
- typed = update.message.reply_to_message.from_user.id
- except:
- return await update.message.delete(2)
- if clicked != typed:
- return await update.answer("That's not for you! π", show_alert=True)
-
- m=await update.message.edit("Searching..π₯")
- id = update.data.split("_")[-1]
- query = await search_imdb(id)
- channels = (await get_group(update.message.chat.id))["channels"]
- head = "I Have Searched Movie With Wrong Spelling But Take care next time π\n\nPowered By @CyniteBackup\n\n"
- results = ""
- try:
- for channel in channels:
- async for msg in User.search_messages(chat_id=channel, query=query):
- name = (msg.text or msg.caption).split("\n")[0]
- if name in results:
- continue
- results += f"β»οΈπΏ {name}\n\nπ {msg.link}\n\n"
- if bool(results)==False:
- return await update.message.edit("Still no results found! Please Request To Group Admin", reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("π― Request To Admin π―", callback_data=f"request_{id}")]]))
- await update.message.edit(text=head+results, disable_web_page_preview=True)
- except Exception as e:
- await update.message.edit(f"β Error: `{e}`")
-
-
-@Client.on_callback_query(filters.regex(r"^request"))
-async def request(bot, update):
- clicked = update.from_user.id
- try:
- typed = update.message.reply_to_message.from_user.id
- except:
- return await update.message.delete()
- if clicked != typed:
- return await update.answer("That's not for you! π", show_alert=True)
-
- admin = (await get_group(update.message.chat.id))["user_id"]
- id = update.data.split("_")[1]
- name = await search_imdb(id)
- url = "https://www.imdb.com/title/tt"+id
- text = f"#RequestFromYourGroup\n\nName: {name}\nIMDb: {url}"
- await bot.send_message(chat_id=admin, text=text, disable_web_page_preview=True)
- await update.answer("β
Request Sent To Admin", show_alert=True)
- await update.message.delete(60)
diff --git a/Plugins/verify.py b/Plugins/verify.py
deleted file mode 100644
index aca5a21..0000000
--- a/Plugins/verify.py
+++ /dev/null
@@ -1,56 +0,0 @@
-from info import *
-from utils import *
-from pyrogram import Client, filters
-from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
-
-@Client.on_message(filters.group & filters.command("verify"))
-async def _verify(bot, message):
- try:
- group = await get_group(message.chat.id)
- user_id = group["user_id"]
- user_name = group["user_name"]
- verified = group["verified"]
- except:
- return await bot.leave_chat(message.chat.id)
- try:
- user = await bot.get_users(user_id)
- except:
- return await message.reply(f"β {user_name} Need to start me in PM!")
- if message.from_user.id != user_id:
- return await message.reply(f"Only {user.mention} can use this command π")
- if verified==True:
- return await message.reply("This Group is already verified!")
- try:
- link = (await bot.get_chat(message.chat.id)).invite_link
- except:
- return message.reply("β Make me admin here with all permissions!")
-
- text = f"#NewRequest\n\n"
- text += f"User: {message.from_user.mention}\n"
- text += f"User ID: `{message.from_user.id}`\n"
- text += f"Group: [{message.chat.title}]({link})\n"
- text += f"Group ID: `{message.chat.id}`\n"
-
- await bot.send_message(chat_id=LOG_CHANNEL,
- text=text,
- disable_web_page_preview=True,
- reply_markup=InlineKeyboardMarkup(
- [[InlineKeyboardButton("β
Approve", callback_data=f"verify_approve_{message.chat.id}"),
- InlineKeyboardButton("β Decline", callback_data=f"verify_decline_{message.chat.id}")]]))
- await message.reply("Verification Request sent β
\nWe will notify You Personally when it is approved")
-
-
-@Client.on_callback_query(filters.regex(r"^verify"))
-async def verify_(bot, update):
- id = int(update.data.split("_")[-1])
- group = await get_group(id)
- name = group["name"]
- user = group["user_id"]
- if update.data.split("_")[1]=="approve":
- await update_group(id, {"verified":True})
- await bot.send_message(chat_id=user, text=f"Your verification request for {name} has been approved β
")
- await update.message.edit(update.message.text.html.replace("#NewRequest", "#Approved"))
- else:
- await delete_group(id)
- await bot.send_message(chat_id=user, text=f"Your verification request for {name} has been declined π Please Contact Admin")
- await update.message.edit(update.message.text.html.replace("#NewRequest", "#Declined"))
From 80763edf7fa785793b963194d892c39df0edd291 Mon Sep 17 00:00:00 2001
From: Cynite <105969534+CyniteOfficial@users.noreply.github.com>
Date: Thu, 1 Jun 2023 10:54:06 +0530
Subject: [PATCH 09/15] Create Test
---
0/plugins/Test | 1 +
1 file changed, 1 insertion(+)
create mode 100644 0/plugins/Test
diff --git a/0/plugins/Test b/0/plugins/Test
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/0/plugins/Test
@@ -0,0 +1 @@
+
From b8bbcfeddc191e0708b2a510ff48a53f2e2e529f Mon Sep 17 00:00:00 2001
From: Cynite <105969534+CyniteOfficial@users.noreply.github.com>
Date: Thu, 1 Jun 2023 10:54:52 +0530
Subject: [PATCH 10/15] Add files via upload
---
0/plugins/broadcast.py | 97 +++++++++++++++++++++++++++++++++++
0/plugins/connect.py | 113 +++++++++++++++++++++++++++++++++++++++++
0/plugins/fsub.py | 94 ++++++++++++++++++++++++++++++++++
0/plugins/misc.py | 60 ++++++++++++++++++++++
0/plugins/newgroup.py | 22 ++++++++
0/plugins/search.py | 93 +++++++++++++++++++++++++++++++++
0/plugins/verify.py | 56 ++++++++++++++++++++
7 files changed, 535 insertions(+)
create mode 100644 0/plugins/broadcast.py
create mode 100644 0/plugins/connect.py
create mode 100644 0/plugins/fsub.py
create mode 100644 0/plugins/misc.py
create mode 100644 0/plugins/newgroup.py
create mode 100644 0/plugins/search.py
create mode 100644 0/plugins/verify.py
diff --git a/0/plugins/broadcast.py b/0/plugins/broadcast.py
new file mode 100644
index 0000000..eb864fb
--- /dev/null
+++ b/0/plugins/broadcast.py
@@ -0,0 +1,97 @@
+import datetime
+import time
+from info import *
+from utils import *
+from pyrogram import Client, filters
+from pyrogram.errors import FloodWait
+import asyncio
+
+@Client.on_message(filters.command('broadcast') & filters.user(ADMIN))
+async def broadcast(bot, message):
+ if not message.reply_to_message:
+ return await message.reply("Use this command as a reply to any message!")
+ m=await message.reply("Please wait...")
+
+ count, users = await get_users()
+ stats = "β‘ Broadcast Processing.."
+ br_msg = message.reply_to_message
+ total = count
+ remaining = total
+ success = 0
+ failed = 0
+
+ for user in users:
+ chat_id = user["_id"]
+ trying = await copy_msgs(br_msg, chat_id)
+ if trying==False:
+ failed+=1
+ remaining-=1
+ else:
+ success+=1
+ remaining-=1
+ try:
+ await m.edit(script.BROADCAST.format(stats, total, remaining, success, failed))
+ except:
+ pass
+ stats = "β
Broadcast Completed"
+ await m.reply(script.BROADCAST.format(stats, total, remaining, success, failed))
+ await m.delete()
+
+
+@Client.on_message(filters.command('broadcast_groups') & filters.user(ADMIN))
+async def grp_broadcast(bot, message):
+ if not message.reply_to_message:
+ return await message.reply("Use this command as a reply to any message!")
+ m=await message.reply("Please wait...")
+
+ count, groups = await get_groups()
+ stats = "β‘ Broadcast Processing.."
+ br_msg = message.reply_to_message
+ total = count
+ remaining = total
+ success = 0
+ failed = 0
+
+ for group in groups:
+ chat_id = group["_id"]
+ trying = await grp_copy_msgs(br_msg, chat_id)
+ if trying==False:
+ failed+=1
+ remaining-=1
+ else:
+ success+=1
+ remaining-=1
+ try:
+ await m.edit(script.BROADCAST.format(stats, total, remaining, success, failed))
+ except:
+ pass
+ stats = "β
Broadcast Completed"
+ await m.reply(script.BROADCAST.format(stats, total, remaining, success, failed))
+ await m.delete()
+
+
+
+async def grp_copy_msgs(br_msg, chat_id):
+ try:
+ h = await br_msg.copy(chat_id)
+ try:
+ await h.pin()
+ except:
+ pass
+ except FloodWait as e:
+ await asyncio.sleep(e.value)
+ await copy_msgs(br_msg, chat_id)
+ except Exception as e:
+ await delete_group(chat_id)
+ return False
+
+
+async def copy_msgs(br_msg, chat_id):
+ try:
+ await br_msg.copy(chat_id)
+ except FloodWait as e:
+ await asyncio.sleep(e.value)
+ await copy_msgs(br_msg, chat_id)
+ except Exception as e:
+ await delete_user(chat_id)
+ return False
diff --git a/0/plugins/connect.py b/0/plugins/connect.py
new file mode 100644
index 0000000..35ba712
--- /dev/null
+++ b/0/plugins/connect.py
@@ -0,0 +1,113 @@
+from info import *
+from utils import *
+from client import User
+from pyrogram import Client, filters
+
+@Client.on_message(filters.group & filters.command("connect"))
+async def connect(bot, message):
+ m=await message.reply("connecting..")
+ user = await User.get_me()
+ try:
+ group = await get_group(message.chat.id)
+ user_id = group["user_id"]
+ user_name = group["user_name"]
+ verified = group["verified"]
+ channels = group["channels"].copy()
+ except :
+ return await bot.leave_chat(message.chat.id)
+ if message.from_user.id!=user_id:
+ return await m.edit(f"Only {user_name} can use this command π")
+ if bool(verified)==False:
+ return await m.edit("This chat is not verified!\nuse /verify")
+ try:
+ channel = int(message.command[-1])
+ if channel in channels:
+ return await message.reply("This channel is already connected! You Cant Connect Again")
+ channels.append(channel)
+ except:
+ return await m.edit("β Incorrect format!\nUse `/connect ChannelID`")
+ try:
+ chat = await bot.get_chat(channel)
+ group = await bot.get_chat(message.chat.id)
+ c_link = chat.invite_link
+ g_link = group.invite_link
+ await User.join_chat(c_link)
+ except Exception as e:
+ if "The user is already a participant" in str(e):
+ pass
+ else:
+ text = f"β Error: `{str(e)}`\nMake sure I'm admin in that channel & this group with all permissions and {(user.username or user.mention)} is not banned there"
+ return await m.edit(text)
+ await update_group(message.chat.id, {"channels":channels})
+ await m.edit(f"β
Successfully connected to [{chat.title}]({c_link})!", disable_web_page_preview=True)
+ text = f"#NewConnection\n\nUser: {message.from_user.mention}\nGroup: [{group.title}]({g_link})\nChannel: [{chat.title}]({c_link})"
+ await bot.send_message(chat_id=LOG_CHANNEL, text=text)
+
+
+@Client.on_message(filters.group & filters.command("disconnect"))
+async def disconnect(bot, message):
+ m=await message.reply("Please wait..")
+ try:
+ group = await get_group(message.chat.id)
+ user_id = group["user_id"]
+ user_name = group["user_name"]
+ verified = group["verified"]
+ channels = group["channels"].copy()
+ except :
+ return await bot.leave_chat(message.chat.id)
+ if message.from_user.id!=user_id:
+ return await m.edit(f"Only {user_name} can use this command π")
+ if bool(verified)==False:
+ return await m.edit("This chat is not verified!\nuse /verify")
+ try:
+ channel = int(message.command[-1])
+ if channel not in channels:
+ return await m.edit("You didn't added this channel yet Or Check Channel Id")
+ channels.remove(channel)
+ except:
+ return await m.edit("β Incorrect format!\nUse `/disconnect ChannelID`")
+ try:
+ chat = await bot.get_chat(channel)
+ group = await bot.get_chat(message.chat.id)
+ c_link = chat.invite_link
+ g_link = group.invite_link
+ await User.leave_chat(channel)
+ except Exception as e:
+ text = f"β Error: `{str(e)}`\nMake sure I'm admin in that channel & this group with all permissions and {(user.username or user.mention)} is not banned there"
+ return await m.edit(text)
+ await update_group(message.chat.id, {"channels":channels})
+ await m.edit(f"β
Successfully disconnected from [{chat.title}]({c_link})!", disable_web_page_preview=True)
+ text = f"#DisConnection\n\nUser: {message.from_user.mention}\nGroup: [{group.title}]({g_link})\nChannel: [{chat.title}]({c_link})"
+ await bot.send_message(chat_id=LOG_CHANNEL, text=text)
+
+
+@Client.on_message(filters.group & filters.command("connections"))
+async def connections(bot, message):
+ group = await get_group(message.chat.id)
+ user_id = group["user_id"]
+ user_name = group["user_name"]
+ channels = group["channels"]
+ f_sub = group["f_sub"]
+ if message.from_user.id!=user_id:
+ return await message.reply(f"Only {user_name} can use this command π")
+ if bool(channels)==False:
+ return await message.reply("This group is currently not connected to any channels!\nConnect one using /connect")
+ text = "This Group is currently connected to:\n\n"
+ for channel in channels:
+ try:
+ chat = await bot.get_chat(channel)
+ name = chat.title
+ link = chat.invite_link
+ text += f"πConnected Channel - [{name}]({link})\n"
+ except Exception as e:
+ await message.reply(f"β Error in `{channel}:`\n`{e}`")
+ if bool(f_sub):
+ try:
+ f_chat = await bot.get_chat(channel)
+ f_title = f_chat.title
+ f_link = f_chat.invite_link
+ text += f"\nFSub: [{f_title}]({f_link})"
+ except Exception as e:
+ await message.reply(f"β Error in FSub (`{f_sub}`)\n`{e}`")
+
+ await message.reply(text=text, disable_web_page_preview=True)
diff --git a/0/plugins/fsub.py b/0/plugins/fsub.py
new file mode 100644
index 0000000..4585a5a
--- /dev/null
+++ b/0/plugins/fsub.py
@@ -0,0 +1,94 @@
+from info import *
+from utils import *
+from pyrogram import Client, filters
+from pyrogram.types import ChatPermissions
+
+@Client.on_message(filters.group & filters.command("fsub"))
+async def f_sub_cmd(bot, message):
+ m=await message.reply("Please wait..")
+ try:
+ group = await get_group(message.chat.id)
+ user_id = group["user_id"]
+ user_name = group["user_name"]
+ verified = group["verified"]
+ except :
+ return await bot.leave_chat(message.chat.id)
+ if message.from_user.id!=user_id:
+ return await m.edit(f"Only {user_name} can use this command π")
+ if bool(verified)==False:
+ return await m.edit("This chat is not verified!\nuse /verify")
+ try:
+ f_sub = int(message.command[-1])
+ except:
+ return await m.edit("β Incorrect format!\nUse `/fsub ChannelID`")
+ try:
+ chat = await bot.get_chat(f_sub)
+ group = await bot.get_chat(message.chat.id)
+ c_link = chat.invite_link
+ g_link = group.invite_link
+ except Exception as e:
+ text = f"β Error: `{str(e)}`\n\nMake sure I'm admin in that channel & this group with all permissions"
+ return await m.edit(text)
+ await update_group(message.chat.id, {"f_sub":f_sub})
+ await m.edit(f"β
Successfully Attached ForceSub to [{chat.title}]({c_link})!", disable_web_page_preview=True)
+ text = f"#NewFsub\n\nUser: {message.from_user.mention}\nGroup: [{group.title}]({g_link})\nChannel: [{chat.title}]({c_link})"
+ await bot.send_message(chat_id=LOG_CHANNEL, text=text)
+
+@Client.on_message(filters.group & filters.command("nofsub"))
+async def nf_sub_cmd(bot, message):
+ m=await message.reply("Disattaching..")
+ try:
+ group = await get_group(message.chat.id)
+ user_id = group["user_id"]
+ user_name = group["user_name"]
+ verified = group["verified"]
+ f_sub = group["f_sub"]
+ except :
+ return await bot.leave_chat(message.chat.id)
+ if message.from_user.id!=user_id:
+ return await m.edit(f"Only {user_name} can use this command π")
+ if bool(verified)==False:
+ return await m.edit("This chat is not verified!\nuse /verify")
+ if bool(f_sub)==False:
+ return await m.edit("This chat is currently don't have any FSub\nuse /fsub")
+ try:
+ chat = await bot.get_chat(f_sub)
+ group = await bot.get_chat(message.chat.id)
+ c_link = chat.invite_link
+ g_link = group.invite_link
+ except Exception as e:
+ text = f"β Error: `{str(e)}`\n\nMake sure I'm admin in that channel & this group with all permissions"
+ return await m.edit(text)
+ await update_group(message.chat.id, {"f_sub":False})
+ await m.edit(f"β
Successfully removed FSub from [{chat.title}]({c_link})!", disable_web_page_preview=True)
+ text = f"#RemoveFsub\n\nUser: {message.from_user.mention}\nGroup: [{group.title}]({g_link})\nChannel: [{chat.title}]({c_link})"
+ await bot.send_message(chat_id=LOG_CHANNEL, text=text)
+
+
+@Client.on_callback_query(filters.regex(r"^checksub"))
+async def f_sub_callback(bot, update):
+ user_id = int(update.data.split("_")[-1])
+ group = await get_group(update.message.chat.id)
+ f_sub = group["f_sub"]
+ admin = group["user_id"]
+
+ if update.from_user.id!=user_id:
+ return await update.answer("That's not for you π", show_alert=True)
+ try:
+ await bot.get_chat_member(f_sub, user_id)
+ except UserNotParticipant:
+ await update.answer("I like your smartness..\nBut don't be over smart π€", show_alert=True) # @subinps π
+ except:
+ await bot.restrict_chat_member(chat_id=update.message.chat.id,
+ user_id=user_id,
+ permissions=ChatPermissions(can_send_messages=True,
+ can_send_media_messages=True,
+ can_send_other_messages=True))
+ await update.message.delete()
+ else:
+ await bot.restrict_chat_member(chat_id=update.message.chat.id,
+ user_id=user_id,
+ permissions=ChatPermissions(can_send_messages=True,
+ can_send_media_messages=True,
+ can_send_other_messages=True))
+ await update.message.delete()
diff --git a/0/plugins/misc.py b/0/plugins/misc.py
new file mode 100644
index 0000000..a4ca54d
--- /dev/null
+++ b/0/plugins/misc.py
@@ -0,0 +1,60 @@
+from utils import *
+from pyrogram import Client, filters
+from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
+
+@Client.on_message(filters.command("start") & ~filters.channel)
+async def start(bot, message):
+ await add_user(message.from_user.id, message.from_user.first_name)
+ await message.reply(text=script.START.format(message.from_user.mention),
+ disable_web_page_preview=True,
+ reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton('β α΄α΄
α΄
α΄α΄ α΄α΄ Κα΄α΄Κ Ι’Κα΄α΄α΄ β', url=f'http://t.me/yourfindbot?startgroup=true')
+ ],[InlineKeyboardButton("Κα΄Κα΄", callback_data="misc_help"),
+ InlineKeyboardButton("α΄Κα΄α΄α΄", callback_data="misc_about")]]))
+@Client.on_message(filters.command("help"))
+async def help(bot, message):
+ await message.reply(text=script.HELP,
+ disable_web_page_preview=True)
+
+@Client.on_message(filters.command("about"))
+async def about(bot, message):
+ await message.reply(text=script.ABOUT.format((await bot.get_me()).mention),
+ disable_web_page_preview=True)
+
+@Client.on_message(filters.command("stats"))
+async def stats(bot, message):
+ g_count, g_list = await get_groups()
+ u_count, u_list = await get_users()
+ await message.reply(script.STATS.format(u_count, g_count))
+
+@Client.on_message(filters.command("id"))
+async def id(bot, message):
+ text = f"Current Chat ID: `{message.chat.id}`\n"
+ if message.from_user:
+ text += f"Your ID: `{message.from_user.id}`\n"
+ if message.reply_to_message:
+ if message.reply_to_message.from_user:
+ text += f"Replied User ID: `{message.reply_to_message.from_user.id}`\n"
+ if message.reply_to_message.forward_from:
+ text += f"Replied Message Forward from User ID: `{message.reply_to_message.forward_from.id}`\n"
+ if message.reply_to_message.forward_from_chat:
+ text += f"Replied Message Forward from Chat ID: `{message.reply_to_message.forward_from_chat.id}\n`"
+ await message.reply(text)
+
+@Client.on_callback_query(filters.regex(r"^misc"))
+async def misc(bot, update):
+ data = update.data.split("_")[-1]
+ if data=="home":
+ await update.message.edit(text=script.START.format(update.from_user.mention),
+ disable_web_page_preview=True,
+ reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("Κα΄Κα΄", callback_data="misc_help"),
+ InlineKeyboardButton("α΄Κα΄α΄α΄", callback_data="misc_about")]]))
+ elif data=="help":
+ await update.message.edit(text=script.HELP,
+ disable_web_page_preview=True,
+ reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("β¬
οΈ Back", callback_data="misc_home")]]))
+
+ elif data=="about":
+ await update.message.edit(text=script.ABOUT.format((await bot.get_me()).mention),
+ disable_web_page_preview=True,
+ reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("β¬
οΈ Back", callback_data="misc_home")]]))
+
diff --git a/0/plugins/newgroup.py b/0/plugins/newgroup.py
new file mode 100644
index 0000000..9a72ea6
--- /dev/null
+++ b/0/plugins/newgroup.py
@@ -0,0 +1,22 @@
+from info import *
+from utils import *
+from asyncio import sleep
+from pyrogram import Client, filters
+
+@Client.on_message(filters.group & filters.new_chat_members)
+async def new_group(bot, message):
+ bot_id = (await bot.get_me()).id
+ member = [u.id for u in message.new_chat_members]
+ if bot_id in member:
+ await add_group(group_id=message.chat.id,
+ group_name=message.chat.title,
+ user_name=message.from_user.first_name,
+ user_id=message.from_user.id,
+ channels=[],
+ f_sub=False,
+ verified=False)
+ m=await message.reply(f"Thanks for adding me in {message.chat.title} β¨\n\nPlease Get Access By /verify\n\n")
+ text=f"#NewGroup\n\nGroup: {message.chat.title}\nGroupID: `{message.chat.id}`\nAddedBy: {message.from_user.mention}\nUserID: `{message.from_user.id}`"
+ await bot.send_message(chat_id=LOG_CHANNEL, text=text)
+ await sleep(60)
+ await m.delete()
diff --git a/0/plugins/search.py b/0/plugins/search.py
new file mode 100644
index 0000000..f053a9e
--- /dev/null
+++ b/0/plugins/search.py
@@ -0,0 +1,93 @@
+import asyncio
+from info import *
+from utils import *
+from time import time
+from client import User
+from pyrogram import Client, filters
+from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
+
+@Client.on_message(filters.text & filters.group & filters.incoming & ~filters.command(["verify", "connect", "id"]))
+async def search(bot, message):
+ f_sub = await force_sub(bot, message)
+ if f_sub==False:
+ return
+ channels = (await get_group(message.chat.id))["channels"]
+ if bool(channels)==False:
+ return
+ if message.text.startswith("/"):
+ return
+ query = message.text
+ head = "Here is the results π\n\nPowered By @CyniteBackup\n\n"
+ results = ""
+ try:
+ for channel in channels:
+ async for msg in User.search_messages(chat_id=channel, query=query):
+ name = (msg.text or msg.caption).split("\n")[0]
+ if name in results:
+ continue
+ results += f"β»οΈ {name}\nπ {msg.link}\n\n"
+ if bool(results)==False:
+ movies = await search_imdb(query)
+ buttons = []
+ for movie in movies:
+ buttons.append([InlineKeyboardButton(movie['title'], callback_data=f"recheck_{movie['id']}")])
+ msg = await message.reply_photo(photo="https://telegra.ph/file/cf6706158b0bfaf436f54.jpg",
+ caption="I Couldn't find anything related to Your Queryπ.\nDid you mean any of these?",
+ reply_markup=InlineKeyboardMarkup(buttons))
+ else:
+ msg = await message.reply_text(text=head+results, disable_web_page_preview=True)
+ _time = (int(time()) + (15*60))
+ await save_dlt_message(msg, _time)
+ except:
+ pass
+
+
+
+@Client.on_callback_query(filters.regex(r"^recheck"))
+async def recheck(bot, update):
+ clicked = update.from_user.id
+ try:
+ typed = update.message.reply_to_message.from_user.id
+ except:
+ return await update.message.delete(2)
+ if clicked != typed:
+ return await update.answer("That's not for you! π", show_alert=True)
+
+ m=await update.message.edit("Searching..π₯")
+ id = update.data.split("_")[-1]
+ query = await search_imdb(id)
+ channels = (await get_group(update.message.chat.id))["channels"]
+ head = "I Have Searched Movie With Wrong Spelling But Take care next time π\n\nPowered By @CyniteBackup\n\n"
+ results = ""
+ try:
+ for channel in channels:
+ async for msg in User.search_messages(chat_id=channel, query=query):
+ name = (msg.text or msg.caption).split("\n")[0]
+ if name in results:
+ continue
+ results += f"β»οΈπΏ {name}\n\nπ {msg.link}\n\n"
+ if bool(results)==False:
+ return await update.message.edit("Still no results found! Please Request To Group Admin", reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("π― Request To Admin π―", callback_data=f"request_{id}")]]))
+ await update.message.edit(text=head+results, disable_web_page_preview=True)
+ except Exception as e:
+ await update.message.edit(f"β Error: `{e}`")
+
+
+@Client.on_callback_query(filters.regex(r"^request"))
+async def request(bot, update):
+ clicked = update.from_user.id
+ try:
+ typed = update.message.reply_to_message.from_user.id
+ except:
+ return await update.message.delete()
+ if clicked != typed:
+ return await update.answer("That's not for you! π", show_alert=True)
+
+ admin = (await get_group(update.message.chat.id))["user_id"]
+ id = update.data.split("_")[1]
+ name = await search_imdb(id)
+ url = "https://www.imdb.com/title/tt"+id
+ text = f"#RequestFromYourGroup\n\nName: {name}\nIMDb: {url}"
+ await bot.send_message(chat_id=admin, text=text, disable_web_page_preview=True)
+ await update.answer("β
Request Sent To Admin", show_alert=True)
+ await update.message.delete(60)
diff --git a/0/plugins/verify.py b/0/plugins/verify.py
new file mode 100644
index 0000000..aca5a21
--- /dev/null
+++ b/0/plugins/verify.py
@@ -0,0 +1,56 @@
+from info import *
+from utils import *
+from pyrogram import Client, filters
+from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
+
+@Client.on_message(filters.group & filters.command("verify"))
+async def _verify(bot, message):
+ try:
+ group = await get_group(message.chat.id)
+ user_id = group["user_id"]
+ user_name = group["user_name"]
+ verified = group["verified"]
+ except:
+ return await bot.leave_chat(message.chat.id)
+ try:
+ user = await bot.get_users(user_id)
+ except:
+ return await message.reply(f"β {user_name} Need to start me in PM!")
+ if message.from_user.id != user_id:
+ return await message.reply(f"Only {user.mention} can use this command π")
+ if verified==True:
+ return await message.reply("This Group is already verified!")
+ try:
+ link = (await bot.get_chat(message.chat.id)).invite_link
+ except:
+ return message.reply("β Make me admin here with all permissions!")
+
+ text = f"#NewRequest\n\n"
+ text += f"User: {message.from_user.mention}\n"
+ text += f"User ID: `{message.from_user.id}`\n"
+ text += f"Group: [{message.chat.title}]({link})\n"
+ text += f"Group ID: `{message.chat.id}`\n"
+
+ await bot.send_message(chat_id=LOG_CHANNEL,
+ text=text,
+ disable_web_page_preview=True,
+ reply_markup=InlineKeyboardMarkup(
+ [[InlineKeyboardButton("β
Approve", callback_data=f"verify_approve_{message.chat.id}"),
+ InlineKeyboardButton("β Decline", callback_data=f"verify_decline_{message.chat.id}")]]))
+ await message.reply("Verification Request sent β
\nWe will notify You Personally when it is approved")
+
+
+@Client.on_callback_query(filters.regex(r"^verify"))
+async def verify_(bot, update):
+ id = int(update.data.split("_")[-1])
+ group = await get_group(id)
+ name = group["name"]
+ user = group["user_id"]
+ if update.data.split("_")[1]=="approve":
+ await update_group(id, {"verified":True})
+ await bot.send_message(chat_id=user, text=f"Your verification request for {name} has been approved β
")
+ await update.message.edit(update.message.text.html.replace("#NewRequest", "#Approved"))
+ else:
+ await delete_group(id)
+ await bot.send_message(chat_id=user, text=f"Your verification request for {name} has been declined π Please Contact Admin")
+ await update.message.edit(update.message.text.html.replace("#NewRequest", "#Declined"))
From a830a8cbef60b1f13f6c72433d366866332435e1 Mon Sep 17 00:00:00 2001
From: Cynite <105969534+CyniteOfficial@users.noreply.github.com>
Date: Thu, 1 Jun 2023 10:55:17 +0530
Subject: [PATCH 11/15] Delete 0 directory
---
0/plugins/Test | 1 -
0/plugins/broadcast.py | 97 -----------------------------------
0/plugins/connect.py | 113 -----------------------------------------
0/plugins/fsub.py | 94 ----------------------------------
0/plugins/misc.py | 60 ----------------------
0/plugins/newgroup.py | 22 --------
0/plugins/search.py | 93 ---------------------------------
0/plugins/verify.py | 56 --------------------
8 files changed, 536 deletions(-)
delete mode 100644 0/plugins/Test
delete mode 100644 0/plugins/broadcast.py
delete mode 100644 0/plugins/connect.py
delete mode 100644 0/plugins/fsub.py
delete mode 100644 0/plugins/misc.py
delete mode 100644 0/plugins/newgroup.py
delete mode 100644 0/plugins/search.py
delete mode 100644 0/plugins/verify.py
diff --git a/0/plugins/Test b/0/plugins/Test
deleted file mode 100644
index 8b13789..0000000
--- a/0/plugins/Test
+++ /dev/null
@@ -1 +0,0 @@
-
diff --git a/0/plugins/broadcast.py b/0/plugins/broadcast.py
deleted file mode 100644
index eb864fb..0000000
--- a/0/plugins/broadcast.py
+++ /dev/null
@@ -1,97 +0,0 @@
-import datetime
-import time
-from info import *
-from utils import *
-from pyrogram import Client, filters
-from pyrogram.errors import FloodWait
-import asyncio
-
-@Client.on_message(filters.command('broadcast') & filters.user(ADMIN))
-async def broadcast(bot, message):
- if not message.reply_to_message:
- return await message.reply("Use this command as a reply to any message!")
- m=await message.reply("Please wait...")
-
- count, users = await get_users()
- stats = "β‘ Broadcast Processing.."
- br_msg = message.reply_to_message
- total = count
- remaining = total
- success = 0
- failed = 0
-
- for user in users:
- chat_id = user["_id"]
- trying = await copy_msgs(br_msg, chat_id)
- if trying==False:
- failed+=1
- remaining-=1
- else:
- success+=1
- remaining-=1
- try:
- await m.edit(script.BROADCAST.format(stats, total, remaining, success, failed))
- except:
- pass
- stats = "β
Broadcast Completed"
- await m.reply(script.BROADCAST.format(stats, total, remaining, success, failed))
- await m.delete()
-
-
-@Client.on_message(filters.command('broadcast_groups') & filters.user(ADMIN))
-async def grp_broadcast(bot, message):
- if not message.reply_to_message:
- return await message.reply("Use this command as a reply to any message!")
- m=await message.reply("Please wait...")
-
- count, groups = await get_groups()
- stats = "β‘ Broadcast Processing.."
- br_msg = message.reply_to_message
- total = count
- remaining = total
- success = 0
- failed = 0
-
- for group in groups:
- chat_id = group["_id"]
- trying = await grp_copy_msgs(br_msg, chat_id)
- if trying==False:
- failed+=1
- remaining-=1
- else:
- success+=1
- remaining-=1
- try:
- await m.edit(script.BROADCAST.format(stats, total, remaining, success, failed))
- except:
- pass
- stats = "β
Broadcast Completed"
- await m.reply(script.BROADCAST.format(stats, total, remaining, success, failed))
- await m.delete()
-
-
-
-async def grp_copy_msgs(br_msg, chat_id):
- try:
- h = await br_msg.copy(chat_id)
- try:
- await h.pin()
- except:
- pass
- except FloodWait as e:
- await asyncio.sleep(e.value)
- await copy_msgs(br_msg, chat_id)
- except Exception as e:
- await delete_group(chat_id)
- return False
-
-
-async def copy_msgs(br_msg, chat_id):
- try:
- await br_msg.copy(chat_id)
- except FloodWait as e:
- await asyncio.sleep(e.value)
- await copy_msgs(br_msg, chat_id)
- except Exception as e:
- await delete_user(chat_id)
- return False
diff --git a/0/plugins/connect.py b/0/plugins/connect.py
deleted file mode 100644
index 35ba712..0000000
--- a/0/plugins/connect.py
+++ /dev/null
@@ -1,113 +0,0 @@
-from info import *
-from utils import *
-from client import User
-from pyrogram import Client, filters
-
-@Client.on_message(filters.group & filters.command("connect"))
-async def connect(bot, message):
- m=await message.reply("connecting..")
- user = await User.get_me()
- try:
- group = await get_group(message.chat.id)
- user_id = group["user_id"]
- user_name = group["user_name"]
- verified = group["verified"]
- channels = group["channels"].copy()
- except :
- return await bot.leave_chat(message.chat.id)
- if message.from_user.id!=user_id:
- return await m.edit(f"Only {user_name} can use this command π")
- if bool(verified)==False:
- return await m.edit("This chat is not verified!\nuse /verify")
- try:
- channel = int(message.command[-1])
- if channel in channels:
- return await message.reply("This channel is already connected! You Cant Connect Again")
- channels.append(channel)
- except:
- return await m.edit("β Incorrect format!\nUse `/connect ChannelID`")
- try:
- chat = await bot.get_chat(channel)
- group = await bot.get_chat(message.chat.id)
- c_link = chat.invite_link
- g_link = group.invite_link
- await User.join_chat(c_link)
- except Exception as e:
- if "The user is already a participant" in str(e):
- pass
- else:
- text = f"β Error: `{str(e)}`\nMake sure I'm admin in that channel & this group with all permissions and {(user.username or user.mention)} is not banned there"
- return await m.edit(text)
- await update_group(message.chat.id, {"channels":channels})
- await m.edit(f"β
Successfully connected to [{chat.title}]({c_link})!", disable_web_page_preview=True)
- text = f"#NewConnection\n\nUser: {message.from_user.mention}\nGroup: [{group.title}]({g_link})\nChannel: [{chat.title}]({c_link})"
- await bot.send_message(chat_id=LOG_CHANNEL, text=text)
-
-
-@Client.on_message(filters.group & filters.command("disconnect"))
-async def disconnect(bot, message):
- m=await message.reply("Please wait..")
- try:
- group = await get_group(message.chat.id)
- user_id = group["user_id"]
- user_name = group["user_name"]
- verified = group["verified"]
- channels = group["channels"].copy()
- except :
- return await bot.leave_chat(message.chat.id)
- if message.from_user.id!=user_id:
- return await m.edit(f"Only {user_name} can use this command π")
- if bool(verified)==False:
- return await m.edit("This chat is not verified!\nuse /verify")
- try:
- channel = int(message.command[-1])
- if channel not in channels:
- return await m.edit("You didn't added this channel yet Or Check Channel Id")
- channels.remove(channel)
- except:
- return await m.edit("β Incorrect format!\nUse `/disconnect ChannelID`")
- try:
- chat = await bot.get_chat(channel)
- group = await bot.get_chat(message.chat.id)
- c_link = chat.invite_link
- g_link = group.invite_link
- await User.leave_chat(channel)
- except Exception as e:
- text = f"β Error: `{str(e)}`\nMake sure I'm admin in that channel & this group with all permissions and {(user.username or user.mention)} is not banned there"
- return await m.edit(text)
- await update_group(message.chat.id, {"channels":channels})
- await m.edit(f"β
Successfully disconnected from [{chat.title}]({c_link})!", disable_web_page_preview=True)
- text = f"#DisConnection\n\nUser: {message.from_user.mention}\nGroup: [{group.title}]({g_link})\nChannel: [{chat.title}]({c_link})"
- await bot.send_message(chat_id=LOG_CHANNEL, text=text)
-
-
-@Client.on_message(filters.group & filters.command("connections"))
-async def connections(bot, message):
- group = await get_group(message.chat.id)
- user_id = group["user_id"]
- user_name = group["user_name"]
- channels = group["channels"]
- f_sub = group["f_sub"]
- if message.from_user.id!=user_id:
- return await message.reply(f"Only {user_name} can use this command π")
- if bool(channels)==False:
- return await message.reply("This group is currently not connected to any channels!\nConnect one using /connect")
- text = "This Group is currently connected to:\n\n"
- for channel in channels:
- try:
- chat = await bot.get_chat(channel)
- name = chat.title
- link = chat.invite_link
- text += f"πConnected Channel - [{name}]({link})\n"
- except Exception as e:
- await message.reply(f"β Error in `{channel}:`\n`{e}`")
- if bool(f_sub):
- try:
- f_chat = await bot.get_chat(channel)
- f_title = f_chat.title
- f_link = f_chat.invite_link
- text += f"\nFSub: [{f_title}]({f_link})"
- except Exception as e:
- await message.reply(f"β Error in FSub (`{f_sub}`)\n`{e}`")
-
- await message.reply(text=text, disable_web_page_preview=True)
diff --git a/0/plugins/fsub.py b/0/plugins/fsub.py
deleted file mode 100644
index 4585a5a..0000000
--- a/0/plugins/fsub.py
+++ /dev/null
@@ -1,94 +0,0 @@
-from info import *
-from utils import *
-from pyrogram import Client, filters
-from pyrogram.types import ChatPermissions
-
-@Client.on_message(filters.group & filters.command("fsub"))
-async def f_sub_cmd(bot, message):
- m=await message.reply("Please wait..")
- try:
- group = await get_group(message.chat.id)
- user_id = group["user_id"]
- user_name = group["user_name"]
- verified = group["verified"]
- except :
- return await bot.leave_chat(message.chat.id)
- if message.from_user.id!=user_id:
- return await m.edit(f"Only {user_name} can use this command π")
- if bool(verified)==False:
- return await m.edit("This chat is not verified!\nuse /verify")
- try:
- f_sub = int(message.command[-1])
- except:
- return await m.edit("β Incorrect format!\nUse `/fsub ChannelID`")
- try:
- chat = await bot.get_chat(f_sub)
- group = await bot.get_chat(message.chat.id)
- c_link = chat.invite_link
- g_link = group.invite_link
- except Exception as e:
- text = f"β Error: `{str(e)}`\n\nMake sure I'm admin in that channel & this group with all permissions"
- return await m.edit(text)
- await update_group(message.chat.id, {"f_sub":f_sub})
- await m.edit(f"β
Successfully Attached ForceSub to [{chat.title}]({c_link})!", disable_web_page_preview=True)
- text = f"#NewFsub\n\nUser: {message.from_user.mention}\nGroup: [{group.title}]({g_link})\nChannel: [{chat.title}]({c_link})"
- await bot.send_message(chat_id=LOG_CHANNEL, text=text)
-
-@Client.on_message(filters.group & filters.command("nofsub"))
-async def nf_sub_cmd(bot, message):
- m=await message.reply("Disattaching..")
- try:
- group = await get_group(message.chat.id)
- user_id = group["user_id"]
- user_name = group["user_name"]
- verified = group["verified"]
- f_sub = group["f_sub"]
- except :
- return await bot.leave_chat(message.chat.id)
- if message.from_user.id!=user_id:
- return await m.edit(f"Only {user_name} can use this command π")
- if bool(verified)==False:
- return await m.edit("This chat is not verified!\nuse /verify")
- if bool(f_sub)==False:
- return await m.edit("This chat is currently don't have any FSub\nuse /fsub")
- try:
- chat = await bot.get_chat(f_sub)
- group = await bot.get_chat(message.chat.id)
- c_link = chat.invite_link
- g_link = group.invite_link
- except Exception as e:
- text = f"β Error: `{str(e)}`\n\nMake sure I'm admin in that channel & this group with all permissions"
- return await m.edit(text)
- await update_group(message.chat.id, {"f_sub":False})
- await m.edit(f"β
Successfully removed FSub from [{chat.title}]({c_link})!", disable_web_page_preview=True)
- text = f"#RemoveFsub\n\nUser: {message.from_user.mention}\nGroup: [{group.title}]({g_link})\nChannel: [{chat.title}]({c_link})"
- await bot.send_message(chat_id=LOG_CHANNEL, text=text)
-
-
-@Client.on_callback_query(filters.regex(r"^checksub"))
-async def f_sub_callback(bot, update):
- user_id = int(update.data.split("_")[-1])
- group = await get_group(update.message.chat.id)
- f_sub = group["f_sub"]
- admin = group["user_id"]
-
- if update.from_user.id!=user_id:
- return await update.answer("That's not for you π", show_alert=True)
- try:
- await bot.get_chat_member(f_sub, user_id)
- except UserNotParticipant:
- await update.answer("I like your smartness..\nBut don't be over smart π€", show_alert=True) # @subinps π
- except:
- await bot.restrict_chat_member(chat_id=update.message.chat.id,
- user_id=user_id,
- permissions=ChatPermissions(can_send_messages=True,
- can_send_media_messages=True,
- can_send_other_messages=True))
- await update.message.delete()
- else:
- await bot.restrict_chat_member(chat_id=update.message.chat.id,
- user_id=user_id,
- permissions=ChatPermissions(can_send_messages=True,
- can_send_media_messages=True,
- can_send_other_messages=True))
- await update.message.delete()
diff --git a/0/plugins/misc.py b/0/plugins/misc.py
deleted file mode 100644
index a4ca54d..0000000
--- a/0/plugins/misc.py
+++ /dev/null
@@ -1,60 +0,0 @@
-from utils import *
-from pyrogram import Client, filters
-from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
-
-@Client.on_message(filters.command("start") & ~filters.channel)
-async def start(bot, message):
- await add_user(message.from_user.id, message.from_user.first_name)
- await message.reply(text=script.START.format(message.from_user.mention),
- disable_web_page_preview=True,
- reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton('β α΄α΄
α΄
α΄α΄ α΄α΄ Κα΄α΄Κ Ι’Κα΄α΄α΄ β', url=f'http://t.me/yourfindbot?startgroup=true')
- ],[InlineKeyboardButton("Κα΄Κα΄", callback_data="misc_help"),
- InlineKeyboardButton("α΄Κα΄α΄α΄", callback_data="misc_about")]]))
-@Client.on_message(filters.command("help"))
-async def help(bot, message):
- await message.reply(text=script.HELP,
- disable_web_page_preview=True)
-
-@Client.on_message(filters.command("about"))
-async def about(bot, message):
- await message.reply(text=script.ABOUT.format((await bot.get_me()).mention),
- disable_web_page_preview=True)
-
-@Client.on_message(filters.command("stats"))
-async def stats(bot, message):
- g_count, g_list = await get_groups()
- u_count, u_list = await get_users()
- await message.reply(script.STATS.format(u_count, g_count))
-
-@Client.on_message(filters.command("id"))
-async def id(bot, message):
- text = f"Current Chat ID: `{message.chat.id}`\n"
- if message.from_user:
- text += f"Your ID: `{message.from_user.id}`\n"
- if message.reply_to_message:
- if message.reply_to_message.from_user:
- text += f"Replied User ID: `{message.reply_to_message.from_user.id}`\n"
- if message.reply_to_message.forward_from:
- text += f"Replied Message Forward from User ID: `{message.reply_to_message.forward_from.id}`\n"
- if message.reply_to_message.forward_from_chat:
- text += f"Replied Message Forward from Chat ID: `{message.reply_to_message.forward_from_chat.id}\n`"
- await message.reply(text)
-
-@Client.on_callback_query(filters.regex(r"^misc"))
-async def misc(bot, update):
- data = update.data.split("_")[-1]
- if data=="home":
- await update.message.edit(text=script.START.format(update.from_user.mention),
- disable_web_page_preview=True,
- reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("Κα΄Κα΄", callback_data="misc_help"),
- InlineKeyboardButton("α΄Κα΄α΄α΄", callback_data="misc_about")]]))
- elif data=="help":
- await update.message.edit(text=script.HELP,
- disable_web_page_preview=True,
- reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("β¬
οΈ Back", callback_data="misc_home")]]))
-
- elif data=="about":
- await update.message.edit(text=script.ABOUT.format((await bot.get_me()).mention),
- disable_web_page_preview=True,
- reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("β¬
οΈ Back", callback_data="misc_home")]]))
-
diff --git a/0/plugins/newgroup.py b/0/plugins/newgroup.py
deleted file mode 100644
index 9a72ea6..0000000
--- a/0/plugins/newgroup.py
+++ /dev/null
@@ -1,22 +0,0 @@
-from info import *
-from utils import *
-from asyncio import sleep
-from pyrogram import Client, filters
-
-@Client.on_message(filters.group & filters.new_chat_members)
-async def new_group(bot, message):
- bot_id = (await bot.get_me()).id
- member = [u.id for u in message.new_chat_members]
- if bot_id in member:
- await add_group(group_id=message.chat.id,
- group_name=message.chat.title,
- user_name=message.from_user.first_name,
- user_id=message.from_user.id,
- channels=[],
- f_sub=False,
- verified=False)
- m=await message.reply(f"Thanks for adding me in {message.chat.title} β¨\n\nPlease Get Access By /verify\n\n")
- text=f"#NewGroup\n\nGroup: {message.chat.title}\nGroupID: `{message.chat.id}`\nAddedBy: {message.from_user.mention}\nUserID: `{message.from_user.id}`"
- await bot.send_message(chat_id=LOG_CHANNEL, text=text)
- await sleep(60)
- await m.delete()
diff --git a/0/plugins/search.py b/0/plugins/search.py
deleted file mode 100644
index f053a9e..0000000
--- a/0/plugins/search.py
+++ /dev/null
@@ -1,93 +0,0 @@
-import asyncio
-from info import *
-from utils import *
-from time import time
-from client import User
-from pyrogram import Client, filters
-from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
-
-@Client.on_message(filters.text & filters.group & filters.incoming & ~filters.command(["verify", "connect", "id"]))
-async def search(bot, message):
- f_sub = await force_sub(bot, message)
- if f_sub==False:
- return
- channels = (await get_group(message.chat.id))["channels"]
- if bool(channels)==False:
- return
- if message.text.startswith("/"):
- return
- query = message.text
- head = "Here is the results π\n\nPowered By @CyniteBackup\n\n"
- results = ""
- try:
- for channel in channels:
- async for msg in User.search_messages(chat_id=channel, query=query):
- name = (msg.text or msg.caption).split("\n")[0]
- if name in results:
- continue
- results += f"β»οΈ {name}\nπ {msg.link}\n\n"
- if bool(results)==False:
- movies = await search_imdb(query)
- buttons = []
- for movie in movies:
- buttons.append([InlineKeyboardButton(movie['title'], callback_data=f"recheck_{movie['id']}")])
- msg = await message.reply_photo(photo="https://telegra.ph/file/cf6706158b0bfaf436f54.jpg",
- caption="I Couldn't find anything related to Your Queryπ.\nDid you mean any of these?",
- reply_markup=InlineKeyboardMarkup(buttons))
- else:
- msg = await message.reply_text(text=head+results, disable_web_page_preview=True)
- _time = (int(time()) + (15*60))
- await save_dlt_message(msg, _time)
- except:
- pass
-
-
-
-@Client.on_callback_query(filters.regex(r"^recheck"))
-async def recheck(bot, update):
- clicked = update.from_user.id
- try:
- typed = update.message.reply_to_message.from_user.id
- except:
- return await update.message.delete(2)
- if clicked != typed:
- return await update.answer("That's not for you! π", show_alert=True)
-
- m=await update.message.edit("Searching..π₯")
- id = update.data.split("_")[-1]
- query = await search_imdb(id)
- channels = (await get_group(update.message.chat.id))["channels"]
- head = "I Have Searched Movie With Wrong Spelling But Take care next time π\n\nPowered By @CyniteBackup\n\n"
- results = ""
- try:
- for channel in channels:
- async for msg in User.search_messages(chat_id=channel, query=query):
- name = (msg.text or msg.caption).split("\n")[0]
- if name in results:
- continue
- results += f"β»οΈπΏ {name}\n\nπ {msg.link}\n\n"
- if bool(results)==False:
- return await update.message.edit("Still no results found! Please Request To Group Admin", reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("π― Request To Admin π―", callback_data=f"request_{id}")]]))
- await update.message.edit(text=head+results, disable_web_page_preview=True)
- except Exception as e:
- await update.message.edit(f"β Error: `{e}`")
-
-
-@Client.on_callback_query(filters.regex(r"^request"))
-async def request(bot, update):
- clicked = update.from_user.id
- try:
- typed = update.message.reply_to_message.from_user.id
- except:
- return await update.message.delete()
- if clicked != typed:
- return await update.answer("That's not for you! π", show_alert=True)
-
- admin = (await get_group(update.message.chat.id))["user_id"]
- id = update.data.split("_")[1]
- name = await search_imdb(id)
- url = "https://www.imdb.com/title/tt"+id
- text = f"#RequestFromYourGroup\n\nName: {name}\nIMDb: {url}"
- await bot.send_message(chat_id=admin, text=text, disable_web_page_preview=True)
- await update.answer("β
Request Sent To Admin", show_alert=True)
- await update.message.delete(60)
diff --git a/0/plugins/verify.py b/0/plugins/verify.py
deleted file mode 100644
index aca5a21..0000000
--- a/0/plugins/verify.py
+++ /dev/null
@@ -1,56 +0,0 @@
-from info import *
-from utils import *
-from pyrogram import Client, filters
-from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
-
-@Client.on_message(filters.group & filters.command("verify"))
-async def _verify(bot, message):
- try:
- group = await get_group(message.chat.id)
- user_id = group["user_id"]
- user_name = group["user_name"]
- verified = group["verified"]
- except:
- return await bot.leave_chat(message.chat.id)
- try:
- user = await bot.get_users(user_id)
- except:
- return await message.reply(f"β {user_name} Need to start me in PM!")
- if message.from_user.id != user_id:
- return await message.reply(f"Only {user.mention} can use this command π")
- if verified==True:
- return await message.reply("This Group is already verified!")
- try:
- link = (await bot.get_chat(message.chat.id)).invite_link
- except:
- return message.reply("β Make me admin here with all permissions!")
-
- text = f"#NewRequest\n\n"
- text += f"User: {message.from_user.mention}\n"
- text += f"User ID: `{message.from_user.id}`\n"
- text += f"Group: [{message.chat.title}]({link})\n"
- text += f"Group ID: `{message.chat.id}`\n"
-
- await bot.send_message(chat_id=LOG_CHANNEL,
- text=text,
- disable_web_page_preview=True,
- reply_markup=InlineKeyboardMarkup(
- [[InlineKeyboardButton("β
Approve", callback_data=f"verify_approve_{message.chat.id}"),
- InlineKeyboardButton("β Decline", callback_data=f"verify_decline_{message.chat.id}")]]))
- await message.reply("Verification Request sent β
\nWe will notify You Personally when it is approved")
-
-
-@Client.on_callback_query(filters.regex(r"^verify"))
-async def verify_(bot, update):
- id = int(update.data.split("_")[-1])
- group = await get_group(id)
- name = group["name"]
- user = group["user_id"]
- if update.data.split("_")[1]=="approve":
- await update_group(id, {"verified":True})
- await bot.send_message(chat_id=user, text=f"Your verification request for {name} has been approved β
")
- await update.message.edit(update.message.text.html.replace("#NewRequest", "#Approved"))
- else:
- await delete_group(id)
- await bot.send_message(chat_id=user, text=f"Your verification request for {name} has been declined π Please Contact Admin")
- await update.message.edit(update.message.text.html.replace("#NewRequest", "#Declined"))
From bcc2e25aa779a4be5995cc065246e0a5ed6de807 Mon Sep 17 00:00:00 2001
From: Cynite <105969534+CyniteOfficial@users.noreply.github.com>
Date: Thu, 1 Jun 2023 10:55:35 +0530
Subject: [PATCH 12/15] Create test
---
plugins/test | 1 +
1 file changed, 1 insertion(+)
create mode 100644 plugins/test
diff --git a/plugins/test b/plugins/test
new file mode 100644
index 0000000..8b13789
--- /dev/null
+++ b/plugins/test
@@ -0,0 +1 @@
+
From 687b6a7a5a6daff90dba4ad563104f4ae91fbd5b Mon Sep 17 00:00:00 2001
From: Cynite <105969534+CyniteOfficial@users.noreply.github.com>
Date: Thu, 1 Jun 2023 10:56:13 +0530
Subject: [PATCH 13/15] Add files via upload
---
plugins/broadcast.py | 97 +++++++++++++++++++++++++++++++++++++
plugins/connect.py | 113 +++++++++++++++++++++++++++++++++++++++++++
plugins/fsub.py | 94 +++++++++++++++++++++++++++++++++++
plugins/misc.py | 60 +++++++++++++++++++++++
plugins/newgroup.py | 22 +++++++++
plugins/search.py | 93 +++++++++++++++++++++++++++++++++++
plugins/verify.py | 56 +++++++++++++++++++++
7 files changed, 535 insertions(+)
create mode 100644 plugins/broadcast.py
create mode 100644 plugins/connect.py
create mode 100644 plugins/fsub.py
create mode 100644 plugins/misc.py
create mode 100644 plugins/newgroup.py
create mode 100644 plugins/search.py
create mode 100644 plugins/verify.py
diff --git a/plugins/broadcast.py b/plugins/broadcast.py
new file mode 100644
index 0000000..eb864fb
--- /dev/null
+++ b/plugins/broadcast.py
@@ -0,0 +1,97 @@
+import datetime
+import time
+from info import *
+from utils import *
+from pyrogram import Client, filters
+from pyrogram.errors import FloodWait
+import asyncio
+
+@Client.on_message(filters.command('broadcast') & filters.user(ADMIN))
+async def broadcast(bot, message):
+ if not message.reply_to_message:
+ return await message.reply("Use this command as a reply to any message!")
+ m=await message.reply("Please wait...")
+
+ count, users = await get_users()
+ stats = "β‘ Broadcast Processing.."
+ br_msg = message.reply_to_message
+ total = count
+ remaining = total
+ success = 0
+ failed = 0
+
+ for user in users:
+ chat_id = user["_id"]
+ trying = await copy_msgs(br_msg, chat_id)
+ if trying==False:
+ failed+=1
+ remaining-=1
+ else:
+ success+=1
+ remaining-=1
+ try:
+ await m.edit(script.BROADCAST.format(stats, total, remaining, success, failed))
+ except:
+ pass
+ stats = "β
Broadcast Completed"
+ await m.reply(script.BROADCAST.format(stats, total, remaining, success, failed))
+ await m.delete()
+
+
+@Client.on_message(filters.command('broadcast_groups') & filters.user(ADMIN))
+async def grp_broadcast(bot, message):
+ if not message.reply_to_message:
+ return await message.reply("Use this command as a reply to any message!")
+ m=await message.reply("Please wait...")
+
+ count, groups = await get_groups()
+ stats = "β‘ Broadcast Processing.."
+ br_msg = message.reply_to_message
+ total = count
+ remaining = total
+ success = 0
+ failed = 0
+
+ for group in groups:
+ chat_id = group["_id"]
+ trying = await grp_copy_msgs(br_msg, chat_id)
+ if trying==False:
+ failed+=1
+ remaining-=1
+ else:
+ success+=1
+ remaining-=1
+ try:
+ await m.edit(script.BROADCAST.format(stats, total, remaining, success, failed))
+ except:
+ pass
+ stats = "β
Broadcast Completed"
+ await m.reply(script.BROADCAST.format(stats, total, remaining, success, failed))
+ await m.delete()
+
+
+
+async def grp_copy_msgs(br_msg, chat_id):
+ try:
+ h = await br_msg.copy(chat_id)
+ try:
+ await h.pin()
+ except:
+ pass
+ except FloodWait as e:
+ await asyncio.sleep(e.value)
+ await copy_msgs(br_msg, chat_id)
+ except Exception as e:
+ await delete_group(chat_id)
+ return False
+
+
+async def copy_msgs(br_msg, chat_id):
+ try:
+ await br_msg.copy(chat_id)
+ except FloodWait as e:
+ await asyncio.sleep(e.value)
+ await copy_msgs(br_msg, chat_id)
+ except Exception as e:
+ await delete_user(chat_id)
+ return False
diff --git a/plugins/connect.py b/plugins/connect.py
new file mode 100644
index 0000000..35ba712
--- /dev/null
+++ b/plugins/connect.py
@@ -0,0 +1,113 @@
+from info import *
+from utils import *
+from client import User
+from pyrogram import Client, filters
+
+@Client.on_message(filters.group & filters.command("connect"))
+async def connect(bot, message):
+ m=await message.reply("connecting..")
+ user = await User.get_me()
+ try:
+ group = await get_group(message.chat.id)
+ user_id = group["user_id"]
+ user_name = group["user_name"]
+ verified = group["verified"]
+ channels = group["channels"].copy()
+ except :
+ return await bot.leave_chat(message.chat.id)
+ if message.from_user.id!=user_id:
+ return await m.edit(f"Only {user_name} can use this command π")
+ if bool(verified)==False:
+ return await m.edit("This chat is not verified!\nuse /verify")
+ try:
+ channel = int(message.command[-1])
+ if channel in channels:
+ return await message.reply("This channel is already connected! You Cant Connect Again")
+ channels.append(channel)
+ except:
+ return await m.edit("β Incorrect format!\nUse `/connect ChannelID`")
+ try:
+ chat = await bot.get_chat(channel)
+ group = await bot.get_chat(message.chat.id)
+ c_link = chat.invite_link
+ g_link = group.invite_link
+ await User.join_chat(c_link)
+ except Exception as e:
+ if "The user is already a participant" in str(e):
+ pass
+ else:
+ text = f"β Error: `{str(e)}`\nMake sure I'm admin in that channel & this group with all permissions and {(user.username or user.mention)} is not banned there"
+ return await m.edit(text)
+ await update_group(message.chat.id, {"channels":channels})
+ await m.edit(f"β
Successfully connected to [{chat.title}]({c_link})!", disable_web_page_preview=True)
+ text = f"#NewConnection\n\nUser: {message.from_user.mention}\nGroup: [{group.title}]({g_link})\nChannel: [{chat.title}]({c_link})"
+ await bot.send_message(chat_id=LOG_CHANNEL, text=text)
+
+
+@Client.on_message(filters.group & filters.command("disconnect"))
+async def disconnect(bot, message):
+ m=await message.reply("Please wait..")
+ try:
+ group = await get_group(message.chat.id)
+ user_id = group["user_id"]
+ user_name = group["user_name"]
+ verified = group["verified"]
+ channels = group["channels"].copy()
+ except :
+ return await bot.leave_chat(message.chat.id)
+ if message.from_user.id!=user_id:
+ return await m.edit(f"Only {user_name} can use this command π")
+ if bool(verified)==False:
+ return await m.edit("This chat is not verified!\nuse /verify")
+ try:
+ channel = int(message.command[-1])
+ if channel not in channels:
+ return await m.edit("You didn't added this channel yet Or Check Channel Id")
+ channels.remove(channel)
+ except:
+ return await m.edit("β Incorrect format!\nUse `/disconnect ChannelID`")
+ try:
+ chat = await bot.get_chat(channel)
+ group = await bot.get_chat(message.chat.id)
+ c_link = chat.invite_link
+ g_link = group.invite_link
+ await User.leave_chat(channel)
+ except Exception as e:
+ text = f"β Error: `{str(e)}`\nMake sure I'm admin in that channel & this group with all permissions and {(user.username or user.mention)} is not banned there"
+ return await m.edit(text)
+ await update_group(message.chat.id, {"channels":channels})
+ await m.edit(f"β
Successfully disconnected from [{chat.title}]({c_link})!", disable_web_page_preview=True)
+ text = f"#DisConnection\n\nUser: {message.from_user.mention}\nGroup: [{group.title}]({g_link})\nChannel: [{chat.title}]({c_link})"
+ await bot.send_message(chat_id=LOG_CHANNEL, text=text)
+
+
+@Client.on_message(filters.group & filters.command("connections"))
+async def connections(bot, message):
+ group = await get_group(message.chat.id)
+ user_id = group["user_id"]
+ user_name = group["user_name"]
+ channels = group["channels"]
+ f_sub = group["f_sub"]
+ if message.from_user.id!=user_id:
+ return await message.reply(f"Only {user_name} can use this command π")
+ if bool(channels)==False:
+ return await message.reply("This group is currently not connected to any channels!\nConnect one using /connect")
+ text = "This Group is currently connected to:\n\n"
+ for channel in channels:
+ try:
+ chat = await bot.get_chat(channel)
+ name = chat.title
+ link = chat.invite_link
+ text += f"πConnected Channel - [{name}]({link})\n"
+ except Exception as e:
+ await message.reply(f"β Error in `{channel}:`\n`{e}`")
+ if bool(f_sub):
+ try:
+ f_chat = await bot.get_chat(channel)
+ f_title = f_chat.title
+ f_link = f_chat.invite_link
+ text += f"\nFSub: [{f_title}]({f_link})"
+ except Exception as e:
+ await message.reply(f"β Error in FSub (`{f_sub}`)\n`{e}`")
+
+ await message.reply(text=text, disable_web_page_preview=True)
diff --git a/plugins/fsub.py b/plugins/fsub.py
new file mode 100644
index 0000000..4585a5a
--- /dev/null
+++ b/plugins/fsub.py
@@ -0,0 +1,94 @@
+from info import *
+from utils import *
+from pyrogram import Client, filters
+from pyrogram.types import ChatPermissions
+
+@Client.on_message(filters.group & filters.command("fsub"))
+async def f_sub_cmd(bot, message):
+ m=await message.reply("Please wait..")
+ try:
+ group = await get_group(message.chat.id)
+ user_id = group["user_id"]
+ user_name = group["user_name"]
+ verified = group["verified"]
+ except :
+ return await bot.leave_chat(message.chat.id)
+ if message.from_user.id!=user_id:
+ return await m.edit(f"Only {user_name} can use this command π")
+ if bool(verified)==False:
+ return await m.edit("This chat is not verified!\nuse /verify")
+ try:
+ f_sub = int(message.command[-1])
+ except:
+ return await m.edit("β Incorrect format!\nUse `/fsub ChannelID`")
+ try:
+ chat = await bot.get_chat(f_sub)
+ group = await bot.get_chat(message.chat.id)
+ c_link = chat.invite_link
+ g_link = group.invite_link
+ except Exception as e:
+ text = f"β Error: `{str(e)}`\n\nMake sure I'm admin in that channel & this group with all permissions"
+ return await m.edit(text)
+ await update_group(message.chat.id, {"f_sub":f_sub})
+ await m.edit(f"β
Successfully Attached ForceSub to [{chat.title}]({c_link})!", disable_web_page_preview=True)
+ text = f"#NewFsub\n\nUser: {message.from_user.mention}\nGroup: [{group.title}]({g_link})\nChannel: [{chat.title}]({c_link})"
+ await bot.send_message(chat_id=LOG_CHANNEL, text=text)
+
+@Client.on_message(filters.group & filters.command("nofsub"))
+async def nf_sub_cmd(bot, message):
+ m=await message.reply("Disattaching..")
+ try:
+ group = await get_group(message.chat.id)
+ user_id = group["user_id"]
+ user_name = group["user_name"]
+ verified = group["verified"]
+ f_sub = group["f_sub"]
+ except :
+ return await bot.leave_chat(message.chat.id)
+ if message.from_user.id!=user_id:
+ return await m.edit(f"Only {user_name} can use this command π")
+ if bool(verified)==False:
+ return await m.edit("This chat is not verified!\nuse /verify")
+ if bool(f_sub)==False:
+ return await m.edit("This chat is currently don't have any FSub\nuse /fsub")
+ try:
+ chat = await bot.get_chat(f_sub)
+ group = await bot.get_chat(message.chat.id)
+ c_link = chat.invite_link
+ g_link = group.invite_link
+ except Exception as e:
+ text = f"β Error: `{str(e)}`\n\nMake sure I'm admin in that channel & this group with all permissions"
+ return await m.edit(text)
+ await update_group(message.chat.id, {"f_sub":False})
+ await m.edit(f"β
Successfully removed FSub from [{chat.title}]({c_link})!", disable_web_page_preview=True)
+ text = f"#RemoveFsub\n\nUser: {message.from_user.mention}\nGroup: [{group.title}]({g_link})\nChannel: [{chat.title}]({c_link})"
+ await bot.send_message(chat_id=LOG_CHANNEL, text=text)
+
+
+@Client.on_callback_query(filters.regex(r"^checksub"))
+async def f_sub_callback(bot, update):
+ user_id = int(update.data.split("_")[-1])
+ group = await get_group(update.message.chat.id)
+ f_sub = group["f_sub"]
+ admin = group["user_id"]
+
+ if update.from_user.id!=user_id:
+ return await update.answer("That's not for you π", show_alert=True)
+ try:
+ await bot.get_chat_member(f_sub, user_id)
+ except UserNotParticipant:
+ await update.answer("I like your smartness..\nBut don't be over smart π€", show_alert=True) # @subinps π
+ except:
+ await bot.restrict_chat_member(chat_id=update.message.chat.id,
+ user_id=user_id,
+ permissions=ChatPermissions(can_send_messages=True,
+ can_send_media_messages=True,
+ can_send_other_messages=True))
+ await update.message.delete()
+ else:
+ await bot.restrict_chat_member(chat_id=update.message.chat.id,
+ user_id=user_id,
+ permissions=ChatPermissions(can_send_messages=True,
+ can_send_media_messages=True,
+ can_send_other_messages=True))
+ await update.message.delete()
diff --git a/plugins/misc.py b/plugins/misc.py
new file mode 100644
index 0000000..a4ca54d
--- /dev/null
+++ b/plugins/misc.py
@@ -0,0 +1,60 @@
+from utils import *
+from pyrogram import Client, filters
+from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
+
+@Client.on_message(filters.command("start") & ~filters.channel)
+async def start(bot, message):
+ await add_user(message.from_user.id, message.from_user.first_name)
+ await message.reply(text=script.START.format(message.from_user.mention),
+ disable_web_page_preview=True,
+ reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton('β α΄α΄
α΄
α΄α΄ α΄α΄ Κα΄α΄Κ Ι’Κα΄α΄α΄ β', url=f'http://t.me/yourfindbot?startgroup=true')
+ ],[InlineKeyboardButton("Κα΄Κα΄", callback_data="misc_help"),
+ InlineKeyboardButton("α΄Κα΄α΄α΄", callback_data="misc_about")]]))
+@Client.on_message(filters.command("help"))
+async def help(bot, message):
+ await message.reply(text=script.HELP,
+ disable_web_page_preview=True)
+
+@Client.on_message(filters.command("about"))
+async def about(bot, message):
+ await message.reply(text=script.ABOUT.format((await bot.get_me()).mention),
+ disable_web_page_preview=True)
+
+@Client.on_message(filters.command("stats"))
+async def stats(bot, message):
+ g_count, g_list = await get_groups()
+ u_count, u_list = await get_users()
+ await message.reply(script.STATS.format(u_count, g_count))
+
+@Client.on_message(filters.command("id"))
+async def id(bot, message):
+ text = f"Current Chat ID: `{message.chat.id}`\n"
+ if message.from_user:
+ text += f"Your ID: `{message.from_user.id}`\n"
+ if message.reply_to_message:
+ if message.reply_to_message.from_user:
+ text += f"Replied User ID: `{message.reply_to_message.from_user.id}`\n"
+ if message.reply_to_message.forward_from:
+ text += f"Replied Message Forward from User ID: `{message.reply_to_message.forward_from.id}`\n"
+ if message.reply_to_message.forward_from_chat:
+ text += f"Replied Message Forward from Chat ID: `{message.reply_to_message.forward_from_chat.id}\n`"
+ await message.reply(text)
+
+@Client.on_callback_query(filters.regex(r"^misc"))
+async def misc(bot, update):
+ data = update.data.split("_")[-1]
+ if data=="home":
+ await update.message.edit(text=script.START.format(update.from_user.mention),
+ disable_web_page_preview=True,
+ reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("Κα΄Κα΄", callback_data="misc_help"),
+ InlineKeyboardButton("α΄Κα΄α΄α΄", callback_data="misc_about")]]))
+ elif data=="help":
+ await update.message.edit(text=script.HELP,
+ disable_web_page_preview=True,
+ reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("β¬
οΈ Back", callback_data="misc_home")]]))
+
+ elif data=="about":
+ await update.message.edit(text=script.ABOUT.format((await bot.get_me()).mention),
+ disable_web_page_preview=True,
+ reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("β¬
οΈ Back", callback_data="misc_home")]]))
+
diff --git a/plugins/newgroup.py b/plugins/newgroup.py
new file mode 100644
index 0000000..9a72ea6
--- /dev/null
+++ b/plugins/newgroup.py
@@ -0,0 +1,22 @@
+from info import *
+from utils import *
+from asyncio import sleep
+from pyrogram import Client, filters
+
+@Client.on_message(filters.group & filters.new_chat_members)
+async def new_group(bot, message):
+ bot_id = (await bot.get_me()).id
+ member = [u.id for u in message.new_chat_members]
+ if bot_id in member:
+ await add_group(group_id=message.chat.id,
+ group_name=message.chat.title,
+ user_name=message.from_user.first_name,
+ user_id=message.from_user.id,
+ channels=[],
+ f_sub=False,
+ verified=False)
+ m=await message.reply(f"Thanks for adding me in {message.chat.title} β¨\n\nPlease Get Access By /verify\n\n")
+ text=f"#NewGroup\n\nGroup: {message.chat.title}\nGroupID: `{message.chat.id}`\nAddedBy: {message.from_user.mention}\nUserID: `{message.from_user.id}`"
+ await bot.send_message(chat_id=LOG_CHANNEL, text=text)
+ await sleep(60)
+ await m.delete()
diff --git a/plugins/search.py b/plugins/search.py
new file mode 100644
index 0000000..f053a9e
--- /dev/null
+++ b/plugins/search.py
@@ -0,0 +1,93 @@
+import asyncio
+from info import *
+from utils import *
+from time import time
+from client import User
+from pyrogram import Client, filters
+from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
+
+@Client.on_message(filters.text & filters.group & filters.incoming & ~filters.command(["verify", "connect", "id"]))
+async def search(bot, message):
+ f_sub = await force_sub(bot, message)
+ if f_sub==False:
+ return
+ channels = (await get_group(message.chat.id))["channels"]
+ if bool(channels)==False:
+ return
+ if message.text.startswith("/"):
+ return
+ query = message.text
+ head = "Here is the results π\n\nPowered By @CyniteBackup\n\n"
+ results = ""
+ try:
+ for channel in channels:
+ async for msg in User.search_messages(chat_id=channel, query=query):
+ name = (msg.text or msg.caption).split("\n")[0]
+ if name in results:
+ continue
+ results += f"β»οΈ {name}\nπ {msg.link}\n\n"
+ if bool(results)==False:
+ movies = await search_imdb(query)
+ buttons = []
+ for movie in movies:
+ buttons.append([InlineKeyboardButton(movie['title'], callback_data=f"recheck_{movie['id']}")])
+ msg = await message.reply_photo(photo="https://telegra.ph/file/cf6706158b0bfaf436f54.jpg",
+ caption="I Couldn't find anything related to Your Queryπ.\nDid you mean any of these?",
+ reply_markup=InlineKeyboardMarkup(buttons))
+ else:
+ msg = await message.reply_text(text=head+results, disable_web_page_preview=True)
+ _time = (int(time()) + (15*60))
+ await save_dlt_message(msg, _time)
+ except:
+ pass
+
+
+
+@Client.on_callback_query(filters.regex(r"^recheck"))
+async def recheck(bot, update):
+ clicked = update.from_user.id
+ try:
+ typed = update.message.reply_to_message.from_user.id
+ except:
+ return await update.message.delete(2)
+ if clicked != typed:
+ return await update.answer("That's not for you! π", show_alert=True)
+
+ m=await update.message.edit("Searching..π₯")
+ id = update.data.split("_")[-1]
+ query = await search_imdb(id)
+ channels = (await get_group(update.message.chat.id))["channels"]
+ head = "I Have Searched Movie With Wrong Spelling But Take care next time π\n\nPowered By @CyniteBackup\n\n"
+ results = ""
+ try:
+ for channel in channels:
+ async for msg in User.search_messages(chat_id=channel, query=query):
+ name = (msg.text or msg.caption).split("\n")[0]
+ if name in results:
+ continue
+ results += f"β»οΈπΏ {name}\n\nπ {msg.link}\n\n"
+ if bool(results)==False:
+ return await update.message.edit("Still no results found! Please Request To Group Admin", reply_markup=InlineKeyboardMarkup([[InlineKeyboardButton("π― Request To Admin π―", callback_data=f"request_{id}")]]))
+ await update.message.edit(text=head+results, disable_web_page_preview=True)
+ except Exception as e:
+ await update.message.edit(f"β Error: `{e}`")
+
+
+@Client.on_callback_query(filters.regex(r"^request"))
+async def request(bot, update):
+ clicked = update.from_user.id
+ try:
+ typed = update.message.reply_to_message.from_user.id
+ except:
+ return await update.message.delete()
+ if clicked != typed:
+ return await update.answer("That's not for you! π", show_alert=True)
+
+ admin = (await get_group(update.message.chat.id))["user_id"]
+ id = update.data.split("_")[1]
+ name = await search_imdb(id)
+ url = "https://www.imdb.com/title/tt"+id
+ text = f"#RequestFromYourGroup\n\nName: {name}\nIMDb: {url}"
+ await bot.send_message(chat_id=admin, text=text, disable_web_page_preview=True)
+ await update.answer("β
Request Sent To Admin", show_alert=True)
+ await update.message.delete(60)
diff --git a/plugins/verify.py b/plugins/verify.py
new file mode 100644
index 0000000..aca5a21
--- /dev/null
+++ b/plugins/verify.py
@@ -0,0 +1,56 @@
+from info import *
+from utils import *
+from pyrogram import Client, filters
+from pyrogram.types import InlineKeyboardMarkup, InlineKeyboardButton
+
+@Client.on_message(filters.group & filters.command("verify"))
+async def _verify(bot, message):
+ try:
+ group = await get_group(message.chat.id)
+ user_id = group["user_id"]
+ user_name = group["user_name"]
+ verified = group["verified"]
+ except:
+ return await bot.leave_chat(message.chat.id)
+ try:
+ user = await bot.get_users(user_id)
+ except:
+ return await message.reply(f"β {user_name} Need to start me in PM!")
+ if message.from_user.id != user_id:
+ return await message.reply(f"Only {user.mention} can use this command π")
+ if verified==True:
+ return await message.reply("This Group is already verified!")
+ try:
+ link = (await bot.get_chat(message.chat.id)).invite_link
+ except:
+ return message.reply("β Make me admin here with all permissions!")
+
+ text = f"#NewRequest\n\n"
+ text += f"User: {message.from_user.mention}\n"
+ text += f"User ID: `{message.from_user.id}`\n"
+ text += f"Group: [{message.chat.title}]({link})\n"
+ text += f"Group ID: `{message.chat.id}`\n"
+
+ await bot.send_message(chat_id=LOG_CHANNEL,
+ text=text,
+ disable_web_page_preview=True,
+ reply_markup=InlineKeyboardMarkup(
+ [[InlineKeyboardButton("β
Approve", callback_data=f"verify_approve_{message.chat.id}"),
+ InlineKeyboardButton("β Decline", callback_data=f"verify_decline_{message.chat.id}")]]))
+ await message.reply("Verification Request sent β
\nWe will notify You Personally when it is approved")
+
+
+@Client.on_callback_query(filters.regex(r"^verify"))
+async def verify_(bot, update):
+ id = int(update.data.split("_")[-1])
+ group = await get_group(id)
+ name = group["name"]
+ user = group["user_id"]
+ if update.data.split("_")[1]=="approve":
+ await update_group(id, {"verified":True})
+ await bot.send_message(chat_id=user, text=f"Your verification request for {name} has been approved β
")
+ await update.message.edit(update.message.text.html.replace("#NewRequest", "#Approved"))
+ else:
+ await delete_group(id)
+ await bot.send_message(chat_id=user, text=f"Your verification request for {name} has been declined π Please Contact Admin")
+ await update.message.edit(update.message.text.html.replace("#NewRequest", "#Declined"))
From e533a9c3c6cbd9c684183e38c92e150d816c63fe Mon Sep 17 00:00:00 2001
From: Cynite <105969534+CyniteOfficial@users.noreply.github.com>
Date: Thu, 1 Jun 2023 10:56:35 +0530
Subject: [PATCH 14/15] Delete test
---
plugins/test | 1 -
1 file changed, 1 deletion(-)
delete mode 100644 plugins/test
diff --git a/plugins/test b/plugins/test
deleted file mode 100644
index 8b13789..0000000
--- a/plugins/test
+++ /dev/null
@@ -1 +0,0 @@
-
From 978137848b30607a6d73d54b13b5ef29f363fbd1 Mon Sep 17 00:00:00 2001
From: Cynite <105969534+CyniteOfficial@users.noreply.github.com>
Date: Thu, 1 Jun 2023 11:31:59 +0530
Subject: [PATCH 15/15] Update app.py
---
app.py | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)
diff --git a/app.py b/app.py
index d61229f..9a44aa8 100644
--- a/app.py
+++ b/app.py
@@ -1,13 +1,10 @@
from flask import Flask
-
app = Flask(__name__)
@app.route('/')
-
def hello_world():
-
return 'Bharat'
-if __name__ == "__main__":
+if __name__ == "__main__":
app.run()