This repository has been archived by the owner on Dec 8, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
2 changed files
with
11 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,3 @@ | ||
fusion-engine | ||
discord_webhook | ||
python-dotenv |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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!") |