Skip to content

Commit

Permalink
Discord module is finally back
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkauzh committed Aug 22, 2023
1 parent 4f4ff43 commit c61e113
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
3 changes: 0 additions & 3 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,3 @@ cython_debug/
compile/
**/.DS_Store

# Discord webhooks
discord/

3 changes: 3 additions & 0 deletions discord/discord_req.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
fusion-engine
python-dotenv
discord_webhook
24 changes: 24 additions & 0 deletions discord/send_webhook.py
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)

0 comments on commit c61e113

Please sign in to comment.