Skip to content
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.

Commit d7b610a

Browse files
authoredMar 13, 2020
Also displays the filename
Displays the filename that is currently executed.
1 parent 50ef109 commit d7b610a

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed
 

‎Slack_Push_Notification.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,12 @@
22
''' This script is used to get a Push Notification on Mobile using Slack.'''
33
import slack
44
import os
5-
def slack_message(message):
5+
def slack_message(message, filename):
66
token = os.environ.get('SLACK_TOKEN')
77
sc = slack.WebClient(token)
88
sc.chat_postMessage(channel= 'python-notifications',
9-
text=message,
9+
text= '<< ' + os.path.basename(filename) + ' >>\n\n' + message,
1010
username= 'Python-Script',
1111
icon_emoji= ':sunglasses:')
1212

13+
print('\n***** SLACK Push Notification Successfully Sent. *****\n')

0 commit comments

Comments
 (0)
Please sign in to comment.