Skip to content

Commit

Permalink
Update webhook
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkauzh committed Dec 31, 2023
1 parent a2c7b4a commit 2eff52f
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 10 deletions.
1 change: 1 addition & 0 deletions discord/discord_req.txt
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
fusion-engine
discord_webhook
python-dotenv
20 changes: 10 additions & 10 deletions discord/send_webhook.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,22 @@
from discord_webhook import DiscordWebhook
import fusionengine as fusion
from dotenv import load_dotenv
import os


def send_discord_webhook(message):
if webhook := os.environ.get("FUSION_WEBHOOK"):
DiscordWebhook(url=webhook, content=message).execute()
else:
print("Discord webhook URL not found in environment variables.")

load_dotenv()

version = fusion.__version__
author = fusion.__author__

message = f"Fusion Engine {version} of package has been released to PyPI by {author}! Check it out at https://pypi.org/project/fusion-engine/{version}"

print("Sending webhook...")
if webhook := os.getenv("FUSION_WEBHOOK"):
print("Sending webhook...")

DiscordWebhook(url=webhook, content=message).execute()

send_discord_webhook(message)
print("Webhook sent!")

else:
print("Discord webhook URL not found in environment variables.")

print("Webhook sent!")

0 comments on commit 2eff52f

Please sign in to comment.