aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorben <ben@nagy.contact>2025-05-17 23:00:09 -0700
committerben <ben@nagy.contact>2025-05-17 23:00:09 -0700
commit75383b1d3c343549955eb76b6dec007b31b3a4a8 (patch)
tree3605055518dd4faa119ddda0ebab5d585f54408c
parent2137839ec1bc7d73cc17d3d9201fc5d6edd31a25 (diff)
Ensure user understands program purpose
-rw-r--r--matrix-redact.py32
1 files changed, 32 insertions, 0 deletions
diff --git a/matrix-redact.py b/matrix-redact.py
index 8be0605..39a83bc 100644
--- a/matrix-redact.py
+++ b/matrix-redact.py
@@ -4,6 +4,8 @@
matrix-redact: Delete all messages and media a user has sent in a matrix room.
"""
+import random
+import math
import asyncio
import argparse
import getpass
@@ -40,6 +42,36 @@ async def redact_room() -> None:
return None
async def main(args) -> None:
+ print("\n" + "="*80)
+ print("WARNING: THIS PROGRAM PERFORMS A PERMANENT DESTRUCTIVE ACTION IN A PROVIDED MATRIX ROOM.")
+ print("""
+ This program will (applies only to a provided room and user ID):
+ - Delete all user-uploaded media (images, files, etc.)
+ - Delete all messages you've sent
+ - Delete any other content you've posted
+ - Operate *irreversibly* on the room ID you provide
+ - Act as the logged-in user on the specified homeserver
+
+ THIS ACTION CANNOT BE UNDONE.
+
+ Make absolutely sure you understand what this program does before proceeding.
+ We take zero liability for any misuse of this program.
+ """)
+
+ confirmation = input("Type 'YES I UNDERSTAND' to continue: ")
+ if confirmation != "YES I UNDERSTAND":
+ print("Exiting.")
+ sys.exit(1)
+
+ x = random.randint(2, 12)
+ a = random.randint(2, 12)
+ b = a * x
+
+ print(f"Solve this: {a} * x = {b}")
+ if int(input("Answer: ").strip()) != x:
+ print("Incorrect math solution. Exiting.")
+ sys.exit(1)
+
client = None
try: