From 896ee7340cd48d7d8319f17f7ed0a0f5963e29eb Mon Sep 17 00:00:00 2001 From: "E. Almqvist" Date: Sat, 16 Jan 2021 01:04:29 +0100 Subject: [PATCH] Stuff --- .gitignore | 2 ++ README.md | 2 ++ main.py | 56 ++++++++++++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 60 insertions(+) create mode 100644 .gitignore create mode 100644 README.md create mode 100755 main.py diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..dfe235a --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*.py[cod] +auth.txt diff --git a/README.md b/README.md new file mode 100644 index 0000000..fbb3882 --- /dev/null +++ b/README.md @@ -0,0 +1,2 @@ +# rm ds +A tool to remove discord messages. diff --git a/main.py b/main.py new file mode 100755 index 0000000..15d48dc --- /dev/null +++ b/main.py @@ -0,0 +1,56 @@ +#!/usr/bin/python + +import re +import discord as ds + +# reading the auth token +authfile = open("auth.txt", "r") +authToken = authfile.readlines()[0] + +c = ds.Client() + +async def get_target_server(c): + inp = input("Input target server: ") + target = c.get_guild(int(inp)) + + if( target != None ): + await attack_server(target, c) + + print("\nDone.") + await exit(0) + else: + print(f"\nUnknown server {inp}") + print(f"Target Object: {target}") + + return await get_target_server(c) + +@c.event +async def on_ready(): + print(f"Logged in as: {c.user}") + await get_target_server(c) + +async def attack_server(server, c): + print(f"Wiping server: {server.id}") + + for channel in server.channels: + if( str(channel.type) == "text" ): + try: + await send_payload(channel, c) + except: + print(f"Unable to wipe channel: {channel}") + pass + + +async def send_payload(channel, c): + print(f"Removing messages from channel: {channel}") + messages = await channel.history(limit=9999).flatten() + + async for m in messages: + try: + if( m.author == c.user ): + print(f"Deleting message: {m}") + except: + pass + + +c.run(authToken, bot=False)