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.
Merge pull request #56 from dimkauzh/main
Making dev branch up to date
- Loading branch information
Showing
2 changed files
with
14 additions
and
9 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,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!") |