text stringlengths 1 93.6k |
|---|
if img_data != 0:
|
log.success("Profile image Saved in : "+Fore.YELLOW+"'"+Fore.CYAN + \
|
Fore.BOLD+img_path+Fore.YELLOW+"'"+Fore.WHITE)
|
ask = raw_input(Fore.GREEN+'['+Fore.WHITE+'+'+Fore.GREEN+']'+Fore.WHITE+' do you want to display profile image ? [Y/n] ')
|
if ((ask.lower() == 'y') or (ask.lower() == '')):
|
show_img(img_path)
|
else:
|
p.failure(Fore.RED+'done.'+Fore.WHITE)
|
log.failure(Fore.RED+"no user is associated with " +
|
Fore.BOLD+Fore.YELLOW+email_or_num+Fore.WHITE+".")
|
else:
|
log.failure("something is wrong , check your internet connection !")
|
def _print_help():
|
print(Fore.BOLD+Fore.YELLOW+"\nUsage: "+Fore.WHITE+f"python -id/--id {Fore.BOLD}<{Fore.WHITE}{Fore.CYAN}Email{Fore.WHITE}{Fore.BOLD}>{Fore.RED}/{Fore.WHITE}<{Fore.CYAN}Number{Fore.WHITE}{Fore.BOLD}>{Fore.WHITE}")
|
print(Fore.WHITE+'\n\t\033[1m\033[4mOptions\033[0m:')
|
print(Fore.WHITE+'\t\t-id\t--id\t\tEmail '+Fore.RED+Fore.BOLD+'OR'+Fore.WHITE+' Number.\n')
|
def main():
|
if not os.path.isdir('recent_search'):
|
os.mkdir('recent_search')
|
parser = argparse.ArgumentParser()
|
parser.print_help = _print_help
|
parser.add_argument(
|
'-id', '--id', help='', type=str, required=True)
|
args = parser.parse_args()
|
p = log.progress("Searching using "+Fore.YELLOW+args.id+Fore.WHITE+" ")
|
is_valid(args.id, p)
|
if __name__ == '__main__':
|
try:
|
main()
|
except IndexError:
|
main()
|
except KeyboardInterrupt:
|
exit()
|
except Exception as mainerr:
|
raise(mainerr)
|
# <FILESEP>
|
import os, math, logging, datetime, pytz, logging.config
|
from aiohttp import web
|
from pyrogram import Client, types
|
from database.users_chats_db import db
|
from database.ia_filterdb import Media
|
from typing import Union, Optional, AsyncGenerator
|
from utils import temp, __repo__, __license__, __copyright__, __version__
|
from info import API_ID, API_HASH, BOT_TOKEN, LOG_CHANNEL, UPTIME, WEB_SUPPORT, LOG_MSG
|
# Get logging configurations
|
logging.config.fileConfig("logging.conf")
|
logging.getLogger(__name__).setLevel(logging.INFO)
|
logging.getLogger("cinemagoer").setLevel(logging.ERROR)
|
class Bot(Client):
|
def __init__(self):
|
super().__init__(
|
name="Professor-Bot",
|
api_id=API_ID,
|
api_hash=API_HASH,
|
bot_token=BOT_TOKEN,
|
plugins=dict(root="plugins")
|
)
|
async def start(self):
|
b_users, b_chats = await db.get_banned()
|
temp.BANNED_USERS = b_users
|
temp.BANNED_CHATS = b_chats
|
await super().start()
|
await Media.ensure_indexes()
|
me = await self.get_me()
|
temp.U_NAME = me.username
|
temp.B_NAME = me.first_name
|
self.id = me.id
|
self.name = me.first_name
|
self.mention = me.mention
|
self.username = me.username
|
self.log_channel = LOG_CHANNEL
|
self.uptime = UPTIME
|
curr = datetime.datetime.now(pytz.timezone("Asia/Kolkata"))
|
date = curr.strftime('%d %B, %Y')
|
tame = curr.strftime('%I:%M:%S %p')
|
logging.info(LOG_MSG.format(me.first_name, date, tame, __repo__, __version__, __license__, __copyright__))
|
try: await self.send_message(LOG_CHANNEL, text=LOG_MSG.format(me.first_name, date, tame, __repo__, __version__, __license__, __copyright__), disable_web_page_preview=True)
|
except Exception as e: logging.warning(f"Bot Isn't Able To Send Message To LOG_CHANNEL \n{e}")
|
if bool(WEB_SUPPORT) is True:
|
app = web.AppRunner(web.Application(client_max_size=30000000))
|
await app.setup()
|
await web.TCPSite(app, "0.0.0.0", 8080).start()
|
logging.info("Web Response Is Running......🕸️")
|
async def stop(self, *args):
|
await super().stop()
|
logging.info(f"Bot Is Restarting ⟳...")
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.