Skip to content
This repository has been archived by the owner on Dec 8, 2024. It is now read-only.

Commit

Permalink
Merge pull request #56 from dimkauzh/main
Browse files Browse the repository at this point in the history
Making dev branch up to date
  • Loading branch information
dimkauzh authored Dec 31, 2023
2 parents 71f9c57 + b9d1e74 commit 75c7a44
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 9 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
22 changes: 13 additions & 9 deletions discord/send_webhook.py
Original file line number Diff line number Diff line change
@@ -1,22 +1,26 @@
from discord_webhook import DiscordWebhook
import fusionengine as fusion
import os

os.environ["FUSION_HIDE_PROMPT"] = "no"

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.")
import fusionengine as fusion
from dotenv import load_dotenv

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}"
test_message = "test"

if webhook := os.getenv("FUSION_WEBHOOK"):
print("Sending 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 75c7a44

Please sign in to comment.