Skip to content

Commit

Permalink
馃攳 Searcher
Browse files Browse the repository at this point in the history
馃攳 Searcher
  • Loading branch information
KanekiWeb committed Dec 18, 2021
1 parent 8b5f343 commit 4769f96
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions Searcher.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import os, discord, json
import os, discord, json, re
from colorama import Fore, init

client = discord.Client()
Expand Down Expand Up @@ -54,10 +54,15 @@ async def on_ready():
try:
async for message in client.get_channel(channel.id).history(limit=99999):
messages_count += 1
for searchmessage in config['messages']:
for searchmessage in config['words']:
if searchmessage 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}\n")

for regex in config['regex']:
if re.match(r"" + regex, message.content):
print(f"[{Fore.GREEN}MESSAGE{Fore.RESET}] Message Found: " + message.content)
open('found.txt', 'a+').write(f"{message.author.name}: {message.content}\n")
except:
pass

Expand All @@ -70,10 +75,15 @@ async def on_ready():
try:
async for message in channel.history(limit=99999):
messages_count += 1
for searchmessage in config['messages']:
for searchmessage in config['words']:
if searchmessage 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}\n")

for regex in config['regex']:
if re.match(r"" + regex, message.content):
print(f"[{Fore.GREEN}MESSAGE{Fore.RESET}] Message Found: " + message.content)
open('found.txt', 'a+').write(f"{message.author.name}: {message.content}\n")
except:
pass

Expand Down

0 comments on commit 4769f96

Please sign in to comment.