From 285f7cb155b2b9060e66088622232091d39d5a30 Mon Sep 17 00:00:00 2001 From: Kaneki <72992708+KanekiWeb@users.noreply.github.com> Date: Sat, 18 Sep 2021 21:59:48 +0200 Subject: [PATCH] =?UTF-8?q?=F0=9F=94=8D=20Searcher?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit πŸ” Searcher --- Searcher.py | 78 +++++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 78 insertions(+) create mode 100644 Searcher.py diff --git a/Searcher.py b/Searcher.py new file mode 100644 index 0000000..7434a27 --- /dev/null +++ b/Searcher.py @@ -0,0 +1,78 @@ +import os, discord, json +from colorama import Fore, init + +client = discord.Client() +init() + +# Credit to Pycenter by billythegoat356 +# Github: https://github.com/billythegoat356/pycenter/ +# License: https://github.com/billythegoat356/pycenter/blob/main/LICENSE + +def center(var:str, space:int=None): # From Pycenter + if not space: + space = (os.get_terminal_size().columns - len(var.splitlines()[int(len(var.splitlines())/2)])) / 2 + + return "\n".join((' ' * int(space)) + var for var in var.splitlines()) + + +class Console(): + def main(self, username, id): + os.system('cls && title Discord Message Searcher - Made By Kaneki Web') + print(center(f""" + + β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•— β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— + β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β•β•β•β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— + β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• + β•šβ•β•β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β• β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β• β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•— + β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ•‘ β–ˆβ–ˆβ•‘ + β•šβ•β•β•β•β•β•β•β•šβ•β•β•β•β•β•β•β•šβ•β• β•šβ•β•β•šβ•β• β•šβ•β• β•šβ•β•β•β•β•β•β•šβ•β• β•šβ•β•β•šβ•β•β•β•β•β•β•β•šβ•β• β•šβ•β• + + + Login as: {Fore.CYAN + username + Fore.RESET} ({Fore.CYAN + id + Fore.RESET}) + + """).replace('β–ˆ', Fore.RED+"β–ˆ"+Fore.RESET)) + + +with open('config.json', 'r') as f: + config = json.load(f) + +@client.event +async def on_ready(): + Console().main(str(client.user), str(client.user.id)) + serveur_count = 0 + channels_count = 0 + messages_count = 0 + dm_count = 0 + + for guild in client.guilds: + print(f"[{Fore.RED}SERVER{Fore.RESET}] Scan du serveur: " + guild.name+ " "*30) + serveur_count += 1 + for channel in guild.text_channels: + print(f"[{Fore.CYAN}CHANNEL{Fore.RESET}] Scan du salon: " + channel.name + " "*30, end="\r") + channels_count += 1 + try: + channel = client.get_channel(channel.id) + async for message in channel.history(limit=99999): + messages_count += 1 + if config['message'] in message.content: + print(f"[{Fore.GREEN}MESSAGE{Fore.RESET}] Message Found: " + message.content) + open('found.txt', 'a+').write(f"{message.author.name}: {message.content}") + except: + pass + + for prv_channel in client.private_channels: + channels_count += 1 + dm_count += 1 + username = str(prv_channel).replace('Direct Message with ', '') + print(f"[{Fore.CYAN}CHANNEL{Fore.RESET}] Scan du DM: {username}" + " "*30, end="\r") + channel = client.get_channel(prv_channel.id) + async for message in channel.history(limit=99999): + messages_count += 1 + if config['message'] in message.content: + print(f"[{Fore.GREEN}MESSAGE{Fore.RESET}] Message Found: " + message.content) + open('found.txt', 'a+').write(f"{message.author.name}: {message.content}") + + input(f"{Fore.RED+str(messages_count)+Fore.RESET} Messages on Γ©tΓ© scannΓ© depuis {Fore.RED+str(channels_count)+Fore.RESET} Salons ({Fore.RED+str(serveur_count)+Fore.RESET} Serveurs, {Fore.RED+str(dm_count)+Fore.RESET} DMs)") + + +client.run(config["token"], bot=False) \ No newline at end of file