Skip to content

Commit

Permalink
add logic for checking slack token
Browse files Browse the repository at this point in the history
  • Loading branch information
GoGiants1 committed Jul 29, 2024
1 parent 28faf39 commit 1400bf2
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions slack.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@
def _send_slack_message(message: str):
slack_token = os.environ.get("SLACK_TOKEN")
slack_channel = os.environ["SLACK_CHANNEL"]
if not slack_token:
print("No Slack token provided. Skipping sending message.")
return
body = {"channel": slack_channel, "text": message}
headers = {"Authorization": f"Bearer {slack_token}"}
try:
Expand Down

0 comments on commit 1400bf2

Please sign in to comment.