{}
15 | Nᴀᴍᴇ - {}"""
16 |
17 | RESTART_TXT = """
18 | Bᴏᴛ Rᴇsᴛᴀʀᴛᴇᴅ !
19 |
20 | 📅 Dᴀᴛᴇ : {}
21 | ⏰ Tɪᴍᴇ : {}
22 | 🌐 Tɪᴍᴇᴢᴏɴᴇ : Asia/Kolkata
23 | 🛠️ Bᴜɪʟᴅ Sᴛᴀᴛᴜs: v2.7.1 [ Sᴛᴀʙʟᴇ ]
"""
24 |
--------------------------------------------------------------------------------
/TechVJ/TechVJ:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/TechVJ/__init__.py:
--------------------------------------------------------------------------------
1 | import time
2 |
3 | StartTime = time.time()
4 | __version__ = 1.1
5 |
--------------------------------------------------------------------------------
/TechVJ/bot/TechVJ:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/TechVJ/bot/__init__.py:
--------------------------------------------------------------------------------
1 | # Don't Remove Credit @VJ_Botz
2 | # Subscribe YouTube Channel For Amazing Bot @Tech_VJ
3 | # Ask Doubt on telegram @KingVJ01
4 |
5 | import logging
6 | import logging.config
7 | logging.config.fileConfig('logging.conf')
8 | logging.getLogger().setLevel(logging.INFO)
9 | logging.getLogger("pyrogram").setLevel(logging.ERROR)
10 | logging.getLogger("imdbpy").setLevel(logging.ERROR)
11 | logging.basicConfig(
12 | level=logging.INFO,
13 | format="%(asctime)s - %(name)s - %(levelname)s - %(message)s"
14 | )
15 | logging.getLogger("aiohttp").setLevel(logging.ERROR)
16 | logging.getLogger("aiohttp.web").setLevel(logging.ERROR)
17 |
18 | from pyrogram import Client
19 | from info import *
20 | from utils import temp
21 | from typing import Union, Optional, AsyncGenerator
22 | from pyrogram import types
23 | from aiohttp import web
24 | from pyrogram import Client
25 | from info import *
26 |
27 |
28 | class TechVJXBot(Client):
29 |
30 | def __init__(self):
31 | super().__init__(
32 | name=SESSION,
33 | api_id=API_ID,
34 | api_hash=API_HASH,
35 | bot_token=BOT_TOKEN,
36 | workers=50,
37 | plugins={"root": "plugins"},
38 | sleep_threshold=5,
39 | )
40 |
41 | async def set_self(self):
42 | temp.BOT = self
43 |
44 | async def iter_messages(
45 | self,
46 | chat_id: Union[int, str],
47 | limit: int,
48 | offset: int = 0,
49 | ) -> Optional[AsyncGenerator["types.Message", None]]:
50 | """Iterate through a chat sequentially.
51 | This convenience method does the same as repeatedly calling :meth:`~pyrogram.Client.get_messages` in a loop, thus saving
52 | you from the hassle of setting up boilerplate code. It is useful for getting the whole chat messages with a
53 | single call.
54 | Parameters:
55 | chat_id (``int`` | ``str``):
56 | Unique identifier (int) or username (str) of the target chat.
57 | For your personal cloud (Saved Messages) you can simply use "me" or "self".
58 | For a contact that exists in your Telegram address book you can use his phone number (str).
59 |
60 | limit (``int``):
61 | Identifier of the last message to be returned.
62 |
63 | offset (``int``, *optional*):
64 | Identifier of the first message to be returned.
65 | Defaults to 0.
66 | Returns:
67 | ``Generator``: A generator yielding :obj:`~pyrogram.types.Message` objects.
68 | Example:
69 | .. code-block:: python
70 | for message in app.iter_messages("pyrogram", 1, 15000):
71 | print(message.text)
72 | """
73 | current = offset
74 | while True:
75 | new_diff = min(200, limit - current)
76 | if new_diff <= 0:
77 | return
78 | messages = await self.get_messages(chat_id, list(range(current, current+new_diff+1)))
79 | for message in messages:
80 | yield message
81 | current += 1
82 |
83 | TechVJBot = TechVJXBot()
84 |
85 | multi_clients = {}
86 | work_loads = {}
87 |
--------------------------------------------------------------------------------
/TechVJ/bot/clients.py:
--------------------------------------------------------------------------------
1 | # Don't Remove Credit @VJ_Botz
2 | # Subscribe YouTube Channel For Amazing Bot @Tech_VJ
3 | # Ask Doubt on telegram @KingVJ01
4 |
5 | import asyncio
6 | import logging
7 | from info import *
8 | from pyrogram import Client
9 | from TechVJ.util.config_parser import TokenParser
10 | from TechVJ.bot import multi_clients, work_loads, TechVJBot
11 |
12 |
13 | async def initialize_clients():
14 | multi_clients[0] = TechVJBot
15 | work_loads[0] = 0
16 | all_tokens = TokenParser().parse_from_env()
17 | if not all_tokens:
18 | print("No additional clients found, using default client")
19 | return
20 |
21 | async def start_client(client_id, token):
22 | try:
23 | print(f"Starting - Client {client_id}")
24 | if client_id == len(all_tokens):
25 | await asyncio.sleep(2)
26 | print("This will take some time, please wait...")
27 | client = await Client(
28 | name=str(client_id),
29 | api_id=API_ID,
30 | api_hash=API_HASH,
31 | bot_token=token,
32 | sleep_threshold=SLEEP_THRESHOLD,
33 | no_updates=True,
34 | in_memory=True
35 | ).start()
36 | work_loads[client_id] = 0
37 | return client_id, client
38 | except Exception:
39 | logging.error(f"Failed starting Client - {client_id} Error:", exc_info=True)
40 |
41 | clients = await asyncio.gather(*[start_client(i, token) for i, token in all_tokens.items()])
42 | multi_clients.update(dict(clients))
43 | if len(multi_clients) != 1:
44 | MULTI_CLIENT = True
45 | print("Multi-Client Mode Enabled")
46 | else:
47 | print("No additional clients were initialized, using default client")
48 |
--------------------------------------------------------------------------------
/TechVJ/server/TechVJ:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/TechVJ/server/exceptions.py:
--------------------------------------------------------------------------------
1 | class InvalidHash(Exception):
2 | message = "Invalid hash"
3 |
4 | class FIleNotFound(Exception):
5 | message = "File not found"
6 |
--------------------------------------------------------------------------------
/TechVJ/template/TechVJ:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/TechVJ/template/dl.html:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 | 140 | 141 | %s 142 | 143 |
144 |141 | 142 | {{file_name}} 143 | 144 |
145 |Play with...
162 |