mirror of
https://github.com/TrezOne/docker-mods-uptime-kuma-timeout-fix.git
synced 2026-06-27 02:32:06 -04:00
19 lines
439 B
Python
19 lines
439 B
Python
#!/usr/bin/env python3
|
|
import requests
|
|
|
|
base = "https://discordapp.com/api/webhooks/"
|
|
token = os.getenv('DISC_HOOK', False)
|
|
you = os.getenv('DISC_ME', False)
|
|
|
|
content = f"<@{you}> "
|
|
message = "The fail2ban to discord mod is deprecated. Please remove it from your container"
|
|
|
|
webhook = {
|
|
"username":"Fail2Ban",
|
|
"content": content + message if you else message
|
|
}
|
|
|
|
if token:
|
|
requests.post(url=f"{base}{token}", json=webhook)
|
|
|