Skip to content
This repository was archived by the owner on Sep 30, 2025. It is now read-only.

Commit 99a12dd

Browse files
committed
Notify discord webhook for new reports
1 parent 8a0b756 commit 99a12dd

2 files changed

Lines changed: 5 additions & 0 deletions

File tree

.env.example

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
JWT_SECRET_KEY=
22
ANALYTICS_API_KEY=
33
TURNSTILE_SECRET_KEY=
4+
DISCORD_WEBHOOK_URL=
45
DB_CONNECTION_STRING=
56
MASTER_USER=
67
MASTER_PASSWORD=

main.py

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,10 @@ async def post_report(site: ReportedIllegalSite):
124124

125125
site_dict["reason"] = hr_reason
126126
reports_collection.insert_one(site_dict)
127+
128+
requests.post(os.getenv("DISCORD_WEBHOOK_URL"), json={
129+
"content": f"**A new website has been reported!**\n\nDomain: *{site_dict.get('domain')}*\nReason: *{site_dict.get('reason')}*"
130+
})
127131
else:
128132
raise HTTPException(409, "Report already exists")
129133
else:

0 commit comments

Comments
 (0)