-
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
3 changed files
with
27 additions
and
3 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 |
---|---|---|
|
@@ -167,6 +167,3 @@ cython_debug/ | |
compile/ | ||
**/.DS_Store | ||
|
||
# Discord webhooks | ||
discord/ | ||
|
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
fusion-engine | ||
python-dotenv | ||
discord_webhook |
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 |
---|---|---|
@@ -0,0 +1,24 @@ | ||
from discord_webhook import DiscordWebhook | ||
import fusionengine as fusion | ||
import os | ||
from dotenv import load_dotenv | ||
|
||
load_dotenv() | ||
|
||
|
||
def send_discord_webhook(message): | ||
webhook = os.environ.get("DISCORD_WEBHOOK") | ||
|
||
if webhook: | ||
webhook = DiscordWebhook(url=webhook, content=message) | ||
webhook.execute() | ||
else: | ||
print("Discord webhook URL not found in environment variables.") | ||
|
||
|
||
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}" | ||
|
||
send_discord_webhook(message) |