This commit is contained in:
2026-02-03 15:10:50 -05:00
parent 73cffe9f63
commit 5a4c69f32c
33 changed files with 39059 additions and 145963 deletions

0
discord/README.md Normal file
View File

32
discord/discord.py Normal file
View File

@@ -0,0 +1,32 @@
import requests
import sys
import os
def send_discord_alert():
# It's best practice to keep your webhook URL in an environment variable
# especially for an InfoSec Officer!
webhook_url = os.getenv("DISCORD_ALERTS_URL")
if not webhook_url:
print("Error: Please set the DISCORD_ALERTS_URL environment variable.")
sys.exit(1)
# Join all command line arguments into one string
# If no arguments, send a default message
message = " ".join(sys.argv[1:]) if len(sys.argv) > 1 else "Security check: Python Webhook is active. 🐍"
payload = {
"content": message,
"username": "Jared Mac Laptop", # You can customize the name here
"avatar_url": "https://zappy.jaredlog.com/apple-logo-icon-bw.jpg" # Optional: add a custom bot icon
}
try:
response = requests.post(webhook_url, json=payload)
response.raise_for_status()
except requests.exceptions.RequestException as e:
print(f"Failed to send message: {e}")
sys.exit(1)
if __name__ == "__main__":
send_discord_alert()

9
discord/pyproject.toml Normal file
View File

@@ -0,0 +1,9 @@
[project]
name = "discord"
version = "0.1.0"
description = "Add your description here"
readme = "README.md"
requires-python = ">=3.12"
dependencies = [
"requests>=2.32.5",
]