From 7b35887bc33b019d7495a489b33ffcd25c8a9875 Mon Sep 17 00:00:00 2001 From: Avi Patil Date: Sat, 6 Jan 2024 15:16:14 +0530 Subject: [PATCH] Minor Changes --- FileStream/__init__.py | 2 +- FileStream/__main__.py | 7 +- FileStream/bot/plugins/start.py | 61 ++++++---- FileStream/bot/plugins/stream.py | 11 +- FileStream/config.py | 13 ++- FileStream/template/dl.html | 18 +-- FileStream/template/play.html | 171 ++++++++++++++++++++++++++++ FileStream/template/stream.html | 154 ------------------------- FileStream/utils/__init__.py | 1 - FileStream/utils/bot_utils.py | 36 ++++-- FileStream/utils/database.py | 22 ++-- FileStream/utils/file_properties.py | 10 +- FileStream/utils/keepalive.py | 20 ---- FileStream/utils/render_template.py | 29 +++-- FileStream/utils/translation.py | 2 +- README.md | 27 +++-- app.json | 2 +- requirements.txt | 5 +- 18 files changed, 306 insertions(+), 285 deletions(-) create mode 100644 FileStream/template/play.html delete mode 100644 FileStream/template/stream.html delete mode 100644 FileStream/utils/keepalive.py diff --git a/FileStream/__init__.py b/FileStream/__init__.py index 853f71e..66d212f 100644 --- a/FileStream/__init__.py +++ b/FileStream/__init__.py @@ -1,5 +1,5 @@ import time -__version__ = "1.0.1" +__version__ = "1.1.0" StartTime = time.time() diff --git a/FileStream/__main__.py b/FileStream/__main__.py index 65fb810..b010a88 100644 --- a/FileStream/__main__.py +++ b/FileStream/__main__.py @@ -3,13 +3,12 @@ import asyncio import logging import traceback import logging.handlers as handlers -from .config import Telegram, Server +from FileStream.config import Telegram, Server from aiohttp import web from pyrogram import idle from FileStream.bot import FileStream from FileStream.server import web_server -from FileStream.utils import ping_server from FileStream.bot.clients import initialize_clients logging.basicConfig( @@ -47,10 +46,6 @@ async def start_services(): print("---------------------- Initializing Clients ----------------------") await initialize_clients() print("------------------------------ DONE ------------------------------") - if Server.KEEP_ALIVE: - print("------------------ Starting Keep Alive Service ------------------") - print() - asyncio.create_task(ping_server()) print() print("--------------------- Initializing Web Server ---------------------") await server.setup() diff --git a/FileStream/bot/plugins/start.py b/FileStream/bot/plugins/start.py index 1bce6ce..b2fe645 100644 --- a/FileStream/bot/plugins/start.py +++ b/FileStream/bot/plugins/start.py @@ -20,12 +20,20 @@ async def start(bot: Client, message: Message): usr_cmd = message.text.split("_")[-1] if usr_cmd == "/start": - await message.reply_text( - text=LANG.START_TEXT.format(message.from_user.mention, FileStream.username), - parse_mode=ParseMode.HTML, - disable_web_page_preview=True, - reply_markup=BUTTON.START_BUTTONS - ) + if Telegram.START_PIC: + await message.reply_photo( + photo=Telegram.START_PIC, + caption=LANG.START_TEXT.format(message.from_user.mention, FileStream.username), + parse_mode=ParseMode.HTML, + reply_markup=BUTTON.START_BUTTONS + ) + else: + await message.reply_text( + text=LANG.START_TEXT.format(message.from_user.mention, FileStream.username), + parse_mode=ParseMode.HTML, + disable_web_page_preview=True, + reply_markup=BUTTON.START_BUTTONS + ) else: if "stream_" in message.text: try: @@ -70,23 +78,38 @@ async def start(bot: Client, message: Message): async def start(bot, message): if not await verify_user(bot, message): return - await message.reply_text( - text=LANG.ABOUT_TEXT.format(FileStream.fname, __version__), - disable_web_page_preview=True, - reply_markup=BUTTON.ABOUT_BUTTONS - ) - + if Telegram.START_PIC: + await message.reply_photo( + photo=Telegram.START_PIC, + caption=LANG.ABOUT_TEXT.format(FileStream.fname, __version__), + parse_mode=ParseMode.HTML, + reply_markup=BUTTON.ABOUT_BUTTONS + ) + else: + await message.reply_text( + text=LANG.ABOUT_TEXT.format(FileStream.fname, __version__), + disable_web_page_preview=True, + reply_markup=BUTTON.ABOUT_BUTTONS + ) @FileStream.on_message((filters.command('help')) & filters.private) async def help_handler(bot, message): if not await verify_user(bot, message): return - await message.reply_text( - text=LANG.HELP_TEXT.format(Telegram.OWNER_ID), - parse_mode=ParseMode.HTML, - disable_web_page_preview=True, - reply_markup=BUTTON.HELP_BUTTONS - ) + if Telegram.START_PIC: + await message.reply_photo( + photo=Telegram.START_PIC, + caption=LANG.HELP_TEXT.format(Telegram.OWNER_ID), + parse_mode=ParseMode.HTML, + reply_markup=BUTTON.HELP_BUTTONS + ) + else: + await message.reply_text( + text=LANG.HELP_TEXT.format(Telegram.OWNER_ID), + parse_mode=ParseMode.HTML, + disable_web_page_preview=True, + reply_markup=BUTTON.HELP_BUTTONS + ) # --------------------------------------------------------------------------------------------------- @@ -112,7 +135,7 @@ async def my_files(bot: Client, message: Message): [InlineKeyboardButton("ᴇᴍᴘᴛʏ", callback_data="N/A")], ) file_list.append([InlineKeyboardButton("ᴄʟᴏsᴇ", callback_data="close")]) - await message.reply_photo(photo=Telegram.IMAGE_FILEID, + await message.reply_photo(photo=Telegram.FILE_PIC, caption="Total files: {}".format(total_files), reply_markup=InlineKeyboardMarkup(file_list)) diff --git a/FileStream/bot/plugins/stream.py b/FileStream/bot/plugins/stream.py index 3a618e9..cca7e4d 100644 --- a/FileStream/bot/plugins/stream.py +++ b/FileStream/bot/plugins/stream.py @@ -48,8 +48,8 @@ async def private_receive_handler(bot: Client, message: Message): except FloodWait as e: print(f"Sleeping for {str(e.value)}s") await asyncio.sleep(e.value) - await bot.send_message(chat_id=Telegram.LOG_CHANNEL, - text=f"Gᴏᴛ FʟᴏᴏᴅWᴀɪᴛ ᴏғ {str(e.value)}s from [{message.from_user.first_name}](tg://user?id={message.from_user.id})\n\n**𝚄𝚜𝚎𝚛 𝙸𝙳 :** `{str(message.from_user.id)}`", + await bot.send_message(chat_id=Telegram.ULOG_CHANNEL, + text=f"Gᴏᴛ FʟᴏᴏᴅWᴀɪᴛ ᴏғ {str(e.value)}s ғʀᴏᴍ [{message.from_user.first_name}](tg://user?id={message.from_user.id})\n\n**ᴜsᴇʀ ɪᴅ :** `{str(message.from_user.id)}`", disable_web_page_preview=True, parse_mode=ParseMode.MARKDOWN) @@ -86,10 +86,11 @@ async def channel_receive_handler(bot: Client, message: Message): except FloodWait as w: print(f"Sleeping for {str(w.x)}s") await asyncio.sleep(w.x) - await bot.send_message(chat_id=Telegram.LOG_CHANNEL, - text=f"ɢᴏᴛ ғʟᴏᴏᴅᴡᴀɪᴛ ᴏғ {str(w.x)}s FROM {message.chat.title}\n\n**CHANNEL ID:** `{str(message.chat.id)}`", + await bot.send_message(chat_id=Telegram.ULOG_CHANNEL, + text=f"ɢᴏᴛ ғʟᴏᴏᴅᴡᴀɪᴛ ᴏғ {str(w.x)}s ғʀᴏᴍ {message.chat.title}\n\n**ᴄʜᴀɴɴᴇʟ ɪᴅ :** `{str(message.chat.id)}`", disable_web_page_preview=True) except Exception as e: - await bot.send_message(chat_id=Telegram.LOG_CHANNEL, text=f"**#EʀʀᴏʀTʀᴀᴄᴋᴇʙᴀᴄᴋ:** `{e}`", + await bot.send_message(chat_id=Telegram.ULOG_CHANNEL, text=f"**#EʀʀᴏʀTʀᴀᴄᴋᴇʙᴀᴄᴋ:** `{e}`", disable_web_page_preview=True) print(f"Cᴀɴ'ᴛ Eᴅɪᴛ Bʀᴏᴀᴅᴄᴀsᴛ Mᴇssᴀɢᴇ!\nEʀʀᴏʀ: **Gɪᴠᴇ ᴍᴇ ᴇᴅɪᴛ ᴘᴇʀᴍɪssɪᴏɴ ɪɴ ᴜᴘᴅᴀᴛᴇs ᴀɴᴅ ʙɪɴ Cʜᴀɴɴᴇʟ!{e}**") + diff --git a/FileStream/config.py b/FileStream/config.py index 981f3e0..b958365 100644 --- a/FileStream/config.py +++ b/FileStream/config.py @@ -15,11 +15,12 @@ class Telegram: FORCE_UPDATES_CHANNEL = env.get('FORCE_UPDATES_CHANNEL', False) FORCE_UPDATES_CHANNEL = True if str(FORCE_UPDATES_CHANNEL).lower() == "true" else False SLEEP_THRESHOLD = int(env.get("SLEEP_THRESHOLD", "60")) - IMAGE_FILEID = env.get('IMAGE_FILEID', "https://telegra.ph/file/5bb9935be0229adf98b73.jpg") + FILE_PIC = env.get('FILE_PIC', "https://graph.org/file/5bb9935be0229adf98b73.jpg") + START_PIC = env.get('START_PIC', "https://graph.org/file/290af25276fa34fa8f0aa.jpg") + VERIFY_PIC = env.get('VERIFY_PIC', "https://graph.org/file/736e21cc0efa4d8c2a0e4.jpg") MULTI_CLIENT = False - LOG_CHANNEL = int( - env.get("BIN_CHANNEL", None) - ) # you NEED to use a CHANNEL when you're using MULTI_CLIENT + FLOG_CHANNEL = int(env.get("FLOG_CHANNEL", None)) # Logs channel for file logs + ULOG_CHANNEL = int(env.get("ULOG_CHANNEL", None)) # Logs channel for user logs MODE = env.get("MODE", "primary") SECONDARY = True if MODE.lower() == "secondary" else False AUTH_USERS = list(set(int(x) for x in str(env.get("AUTH_USERS", "")).split())) @@ -27,13 +28,13 @@ class Telegram: class Server: PORT = int(env.get("PORT", 8080)) BIND_ADDRESS = str(env.get("BIND_ADDRESS", "0.0.0.0")) - PING_INTERVAL = int(env.get("PING_INTERVAL", "1200")) # 20 minutes + PING_INTERVAL = int(env.get("PING_INTERVAL", "1200")) HAS_SSL = str(env.get("HAS_SSL", "0").lower()) in ("1", "true", "t", "yes", "y") NO_PORT = str(env.get("NO_PORT", "0").lower()) in ("1", "true", "t", "yes", "y") FQDN = str(env.get("FQDN", BIND_ADDRESS)) URL = "http{}://{}{}/".format( "s" if HAS_SSL else "", FQDN, "" if NO_PORT else ":" + str(PORT) ) - KEEP_ALIVE = str(env.get("KEEP_ALIVE", "0").lower()) in ("1", "true", "t", "yes", "y") + diff --git a/FileStream/template/dl.html b/FileStream/template/dl.html index 095d465..2dce487 100644 --- a/FileStream/template/dl.html +++ b/FileStream/template/dl.html @@ -5,24 +5,22 @@ - %s + {{file_name}} - -
- %s + {{file_name}}
- +
- - - + + + + + +
+ +
+ +
+
+
+ +
+
+

File Name:

+

{{file_name}}


+

File Size:

+

{{file_size}}

+
+
+ + + + + +
+ +
+
+
+
+ +
+

WELCOME TO OUR FILE STREAM BOT

+

+ This is a Telegram Bot to Stream Movies and Series directly on + Telegram. You can also + download them if you want. This bot is developed by Avi +

If you like this bot, then don't + forget to share it with your friends and family. +

+
+ + + +
+

Report Bugs and Contact us on Telegram Below

+ +
+ +
+
+
+
+
+
+ +
+
+
+ +
+
+ +
+
+
+
+
+ +
+
+
+ +
+ +
+ +
+ +
+
+
+ + + + + + + + + + + + \ No newline at end of file diff --git a/FileStream/template/stream.html b/FileStream/template/stream.html deleted file mode 100644 index 246548c..0000000 --- a/FileStream/template/stream.html +++ /dev/null @@ -1,154 +0,0 @@ - - - - streamHeading - - - - - - - - - - - - - - - - -
- - - - - diff --git a/FileStream/utils/__init__.py b/FileStream/utils/__init__.py index 9e8b357..93653aa 100644 --- a/FileStream/utils/__init__.py +++ b/FileStream/utils/__init__.py @@ -1,4 +1,3 @@ -from .keepalive import ping_server from .time_format import get_readable_time from .file_properties import get_name, get_file_ids from .custom_dl import ByteStreamer \ No newline at end of file diff --git a/FileStream/utils/bot_utils.py b/FileStream/utils/bot_utils.py index ba7f877..b241a10 100644 --- a/FileStream/utils/bot_utils.py +++ b/FileStream/utils/bot_utils.py @@ -20,15 +20,27 @@ async def is_user_joined(bot, message: Message): ) return False except UserNotParticipant: - await message.reply_text( - text = "Jᴏɪɴ ᴍʏ ᴜᴘᴅᴀᴛᴇ ᴄʜᴀɴɴᴇʟ ᴛᴏ ᴜsᴇ ᴍᴇ 🔐", - reply_markup=InlineKeyboardMarkup( - [[ - InlineKeyboardButton("Jᴏɪɴ ɴᴏᴡ 🔓", url=f"https://t.me/{Telegram.UPDATES_CHANNEL}") - ]] - ), - parse_mode=ParseMode.HTML - ) + if Telegram.VERIFY_PIC: + await message.reply_photo( + photo=Telegram.VERIFY_PIC, + caption="Jᴏɪɴ ᴍʏ ᴜᴘᴅᴀᴛᴇ ᴄʜᴀɴɴᴇʟ ᴛᴏ ᴜsᴇ ᴍᴇ 🔐", + parse_mode=ParseMode.HTML, + reply_markup=InlineKeyboardMarkup( + [[ + InlineKeyboardButton("Jᴏɪɴ ɴᴏᴡ 🔓", url=f"https://t.me/{Telegram.UPDATES_CHANNEL}") + ]] + ) + ) + else: + await message.reply_text( + text="Jᴏɪɴ ᴍʏ ᴜᴘᴅᴀᴛᴇ ᴄʜᴀɴɴᴇʟ ᴛᴏ ᴜsᴇ ᴍᴇ 🔐", + reply_markup=InlineKeyboardMarkup( + [[ + InlineKeyboardButton("Jᴏɪɴ ɴᴏᴡ 🔓", url=f"https://t.me/{Telegram.UPDATES_CHANNEL}") + ]] + ), + parse_mode=ParseMode.HTML + ) return False except Exception: await message.reply_text( @@ -134,7 +146,7 @@ async def is_user_authorized(message): if not (user_id in Telegram.AUTH_USERS): await message.reply_text( - text="You are not authorized to use this bot.", + text="Yᴏᴜ ᴀʀᴇ ɴᴏᴛ ᴀᴜᴛʜᴏʀɪᴢᴇᴅ ᴛᴏ ᴜsᴇ ᴛʜɪs ʙᴏᴛ.", parse_mode=ParseMode.MARKDOWN, disable_web_page_preview=True ) @@ -148,7 +160,7 @@ async def is_user_exist(bot, message): if not bool(await db.get_user(message.from_user.id)): await db.add_user(message.from_user.id) await bot.send_message( - Telegram.LOG_CHANNEL, + Telegram.ULOG_CHANNEL, f"**#NᴇᴡUsᴇʀ**\n**⬩ ᴜsᴇʀ ɴᴀᴍᴇ :** [{message.from_user.first_name}](tg://user?id={message.from_user.id})\n**⬩ ᴜsᴇʀ ɪᴅ :** `{message.from_user.id}`" ) @@ -157,7 +169,7 @@ async def is_channel_exist(bot, message): await db.add_user(message.chat.id) members = await bot.get_chat_members_count(message.chat.id) await bot.send_message( - Telegram.LOG_CHANNEL, + Telegram.ULOG_CHANNEL, f"**#NᴇᴡCʜᴀɴɴᴇʟ** \n**⬩ ᴄʜᴀᴛ ɴᴀᴍᴇ :** `{message.chat.title}`\n**⬩ ᴄʜᴀᴛ ɪᴅ :** `{message.chat.id}`\n**⬩ ᴛᴏᴛᴀʟ ᴍᴇᴍʙᴇʀs :** `{members}`" ) diff --git a/FileStream/utils/database.py b/FileStream/utils/database.py index 4b814cd..bd90cd9 100644 --- a/FileStream/utils/database.py +++ b/FileStream/utils/database.py @@ -18,9 +18,7 @@ class Database: return dict( id=id, join_date=time.time(), - agreed_to_tos=False, - Links=0, - Plan="Free" + Links=0 ) # ---------------------[ ADD USER ]---------------------# @@ -119,15 +117,15 @@ class Database: await self.file.update_one({"_id": ObjectId(_id)}, {"$set": {"file_ids": file_ids}}) # ---------------------[ PAID SYS ]---------------------# - async def link_available(self, id): - user = await self.col.find_one({"id": id}) - if user.get("Plan") == "Plus": - return "Plus" - elif user.get("Plan") == "Free": - files = await self.file.count_documents({"user_id": id}) - if files < 11: - return True - return False +# async def link_available(self, id): +# user = await self.col.find_one({"id": id}) +# if user.get("Plan") == "Plus": +# return "Plus" +# elif user.get("Plan") == "Free": +# files = await self.file.count_documents({"user_id": id}) +# if files < 11: +# return True +# return False async def count_links(self, id, operation: str): if operation == "-": diff --git a/FileStream/utils/file_properties.py b/FileStream/utils/file_properties.py index 9115096..49dcc09 100644 --- a/FileStream/utils/file_properties.py +++ b/FileStream/utils/file_properties.py @@ -30,7 +30,7 @@ async def get_file_ids(client: Client | bool, db_id: str, multi_clients, message if not str(client.id) in file_id_info: logging.debug("Storing file_id in DB") log_msg = await send_file(FileStream, db_id, file_info['file_id'], message) - msg = await client.get_messages(Telegram.LOG_CHANNEL, log_msg.id) + msg = await client.get_messages(Telegram.FLOG_CHANNEL, log_msg.id) media = get_media_from_message(msg) file_id_info[str(client.id)] = getattr(media, "file_id", "") await db.update_file_ids(db_id, file_id_info) @@ -118,7 +118,7 @@ def get_file_info(message): async def update_file_id(msg_id, multi_clients): file_ids = {} for client_id, client in multi_clients.items(): - log_msg = await client.get_messages(Telegram.LOG_CHANNEL, msg_id) + log_msg = await client.get_messages(Telegram.FLOG_CHANNEL, msg_id) media = get_media_from_message(log_msg) file_ids[str(client.id)] = getattr(media, "file_id", "") @@ -126,10 +126,8 @@ async def update_file_id(msg_id, multi_clients): async def send_file(client: Client, db_id, file_id: str, message): - file_caption = message.caption - if file_caption is None: - file_caption = message.file_name - log_msg = await client.send_cached_media(chat_id=Telegram.LOG_CHANNEL, file_id=file_id, + file_caption = getattr(message, 'caption', None) or get_name(message) + log_msg = await client.send_cached_media(chat_id=Telegram.FLOG_CHANNEL, file_id=file_id, caption=f'**{file_caption}**') if message.chat.type == ChatType.PRIVATE: diff --git a/FileStream/utils/keepalive.py b/FileStream/utils/keepalive.py deleted file mode 100644 index 44b6eb4..0000000 --- a/FileStream/utils/keepalive.py +++ /dev/null @@ -1,20 +0,0 @@ -import asyncio -import logging -import aiohttp -import traceback -from FileStream.config import Server - -async def ping_server(): - sleep_time = Server.PING_INTERVAL - while True: - await asyncio.sleep(sleep_time) - try: - async with aiohttp.ClientSession( - timeout=aiohttp.ClientTimeout(total=10) - ) as session: - async with session.get(Server.URL) as resp: - logging.info("Pinged server with response: {}".format(resp.status)) - except TimeoutError: - logging.warning("Couldn't connect to the site URL..!") - except Exception: - traceback.print_exc() diff --git a/FileStream/utils/render_template.py b/FileStream/utils/render_template.py index e99dd84..c853da6 100644 --- a/FileStream/utils/render_template.py +++ b/FileStream/utils/render_template.py @@ -1,5 +1,5 @@ import aiohttp -import aiofiles +import jinja2 import urllib.parse from FileStream.config import Telegram, Server from FileStream.utils.database import Database @@ -9,17 +9,22 @@ db = Database(Telegram.DATABASE_URL, Telegram.SESSION_NAME) async def render_page(db_id): file_data=await db.get_file(db_id) src = urllib.parse.urljoin(Server.URL, f'dl/{file_data["_id"]}') + file_size = humanbytes(file_data['file_size']) + file_name = file_data['file_name'].replace("_", " ") if str((file_data['mime_type']).split('/')[0].strip()) == 'video': - async with aiofiles.open('FileStream/template/stream.html') as r: - heading = 'Watch {}'.format(file_data['file_name']) - html_template = await r.read() - html = html_template.replace('streamMediaLink', src).replace('streamHeading', heading) + template_file = "FileStream/template/play.html" else: - async with aiofiles.open('FileStream/template/dl.html') as r: - async with aiohttp.ClientSession() as s: - async with s.get(src) as u: - heading = 'Download {}'.format(file_data['file_name']) - file_size = humanbytes(int(u.headers.get('Content-Length'))) - html = (await r.read()) % (heading, file_data['file_name'], src, file_size) - return html + template_file = "FileStream/template/dl.html" + async with aiohttp.ClientSession() as s: + async with s.get(src) as u: + file_size = humanbytes(int(u.headers.get('Content-Length'))) + + with open(template_file) as f: + template = jinja2.Template(f.read()) + + return template.render( + file_name=file_name, + file_url=src, + file_size=file_size + ) diff --git a/FileStream/utils/translation.py b/FileStream/utils/translation.py index 75b649d..7cf48df 100644 --- a/FileStream/utils/translation.py +++ b/FileStream/utils/translation.py @@ -19,7 +19,7 @@ class LANG(object): ABOUT_TEXT = """ ⚜ ᴍʏ ɴᴀᴍᴇ : {}\n ✦ ᴠᴇʀsɪᴏɴ : {} -✦ ᴜᴘᴅᴀᴛᴇᴅ ᴏɴ : 19-November-2023 +✦ ᴜᴘᴅᴀᴛᴇᴅ ᴏɴ : 06-January-2024 ✦ ᴅᴇᴠᴇʟᴏᴘᴇʀ : Avishkar Patil\n """ diff --git a/README.md b/README.md index f4b8be7..8034e57 100644 --- a/README.md +++ b/README.md @@ -41,7 +41,7 @@ - Press the below button to Fast deploy on Heroku - [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy?template=https://github.com/avipatilpro/FileStreamBot) + [![Deploy](https://www.herokucdn.com/deploy/button.svg)](https://heroku.com/deploy) - Go to variables tab for more info on setting up environmental variables.
@@ -109,7 +109,8 @@ An example of `.env` file: API_ID = 789456 API_HASH = ysx275f9638x896g43sfzx65 BOT_TOKEN = 12345678:your_bot_token -BIN_CHANNEL = -100xxxxxxxx +ULOG_CHANNEL = -100123456789 +FLOG_CHANNEL = -100123456789 DATABASE_URL = mongodb://admin:pass@192.168.27.1 FQDN = 192.168.27.1 HAS_SSL = False @@ -130,7 +131,8 @@ PORT = 8080 * `API_HASH`: API hash of your Telegram account, can be obtained from [My Telegram](https://my.telegram.org). `str` * `OWNER_ID`: Your Telegram User ID, Send `/id` to [@missrose_bot](https://telegram.dog/MissRose_bot) to get Your Telegram User ID `int` * `BOT_TOKEN`: Telegram API token of your bot, can be obtained from [@BotFather](https://t.me/BotFather). `str` -* `LOG_CHANNEL`: ID of the channel where bot will forward all files received from users. `int`. +* `FLOG_CHANNEL`: ID of the channel where bot will store all Files from users `int`. +* `ULOG_CHANNEL`: ID of the channel where bot will send logs of New Users`int`. * `BOT_WORKERS`: Number of updates bot should process from Telegram at once, by default to 10 updates. `int` * `DATABASE_URL`: MongoDB URI for saving User Data and Files List created by user. `str` * `FQDN`: A Fully Qualified Domain Name if present without http/s. Defaults to `BIND_ADDRESS`. `str` @@ -146,13 +148,13 @@ PORT = 8080 * `AUTH_USERS`: Put authorized user IDs to use bot, separated by Space. `int` * `SLEEP_THRESHOLD`: Set global flood wait threshold, auto-retry requests under 60s. `int` * `SESSION_NAME`: Name for the Database created on your MongoDB. Defaults to `FileStream`. `str` -* `IMAGE_FILEID`: To set Image at `/files` command. Defaults to pre-set image. `str` +* `FILE_PIC`: To set Image at `/files` command. Defaults to pre-set image. `str` +* `START_PIC`: To set Image at `/start` command. Defaults to pre-set image. `str` +* `VERIFY_PIC`: To set Image at Force Sub Verification. Defaults to pre-set image. `str` * `WORKERS`: Number of maximum concurrent workers for handling incoming updates. Defaults to `6`. `int` * `PORT`: The port that you want your webapp to be listened to. Defaults to `8080`. `int` * `BIND_ADDRESS`: Your server bind adress. Defauls to `0.0.0.0`. `int` * `MODE`: Should be set to `secondary` if you only want to use the server for serving files. `str` -* `PING_INTERVAL`: Heroku ping interval (ms), defaults to 1200 (20 minutes). `int` -* `KEEP_ALIVE`: Self-ping server every PING_INTERVAL sec to avoid sleeping defaults to `False`. * `NO_PORT`: (True/False) Set PORT to 80 or 443 hide port display; ignore if on Heroku. Defaults to `False`. * `HAS_SSL`: (can be either `True` or `False`) If you want the generated links in https format. Defaults to `False`. @@ -166,15 +168,15 @@ PORT = 8080 #### ‍☠️ Bot Commands : ```sh -/start : To check if the bot is alive or not. +/start : To check the bot is alive or not. /help : To Get Help Message. /about : To check About the Bot. /files : To Get All Files List of User. -/del : To Delete Files from DB with FileID. -/ban : To Ban Any Channel or User to use bot. -/unban : To Unban Any Channel or User to use bot. -/status : To Get Bot Status and Total Users. -/broadcast : To Broadcast any message to all users of bot. +/del : To Delete Files from DB with FileID. [ADMIN] +/ban : To Ban Any Channel or User to use bot. [ADMIN] +/unban : To Unban Any Channel or User to use bot. [ADMIN] +/status : To Get Bot Status and Total Users. [ADMIN] +/broadcast : To Broadcast any message to all users of bot. [ADMIN] ``` #### 🍟 Channel Support : @@ -188,6 +190,7 @@ PORT = 8080 - [**Me**](https://github.com/AvishkarPatil) : Owner of This FileStreamBot - [**Deekshith SH**](https://github.com/DeekshithSH) : for some modules. - [**EverythingSuckz**](https://github.com/EverythingSuckz) : for his [FileStreamBot](https://github.com/EverythingSuckz/FileStreamBot) +- [**Biisal**](https://github.com/biisal) : for Stream Page UI ---

© 2024 Aνιѕнкαя Pαтιℓ

diff --git a/app.json b/app.json index db2a138..5056cac 100644 --- a/app.json +++ b/app.json @@ -33,7 +33,7 @@ "description": "MongoDB URI for saving User Data and Files List created by user." }, "AUTH_USERS": { - "description": "Put IDs of Banned Channels where bot will not work. You can add multiple IDs & separate with Space.", + "description": "Put IDs of Auth Usrs where bot will work. You can add multiple IDs & separate with Space.", "required": false }, "UPDATES_CHANNEL": { diff --git a/requirements.txt b/requirements.txt index 9096f8a..e351daf 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,8 +1,9 @@ aiohttp -pyrogram +pyrofork python-dotenv tgcrypto motor aiofiles dnspython -requests \ No newline at end of file +requests +jinja2