35 lines
1.1 KiB
Python
Executable File
35 lines
1.1 KiB
Python
Executable File
#!/usr/bin/env python3
|
|
import requests
|
|
from datetime import datetime
|
|
|
|
NIKAH_DAY = datetime(2026, 8, 2)
|
|
WALIMAH_DAY = datetime(2026, 8, 9)
|
|
|
|
docstring = """
|
|
This script sends daily countdown reminders via a Discord webhook about
|
|
the number of days remaining until two significant events: Nikah Day and
|
|
Walimah Day. It calculates the days left for each event and formats a
|
|
message to be sent to a specified Discord channel.
|
|
"""
|
|
|
|
DISCORD_WEBHOOK_URL = "https://discord.com/api/webhooks/1461100056580067684/BAxF4ndrugLJX8L6WyUtbzOtqoTR0GyxMWhg6jzkdCy1CC8yLfDb7e5erz_FoMUHmviw"
|
|
|
|
if __name__ == "__main__":
|
|
today = datetime.now()
|
|
days_to_nikah = (NIKAH_DAY - today).days
|
|
days_to_walimah = (WALIMAH_DAY - today).days
|
|
|
|
days_to_nikah += 1
|
|
days_to_walimah += 1
|
|
|
|
message = f"📅 Countdown Update:\n\n"
|
|
message += f"💍 Nikah Day: {days_to_nikah} days remaining!\n"
|
|
message += f"🎉 Walimah Day: {days_to_walimah} days remaining!\n"
|
|
|
|
payload = {
|
|
"content": message
|
|
}
|
|
|
|
r = requests.post(DISCORD_WEBHOOK_URL, json=payload, timeout=10)
|
|
r.raise_for_status()
|