Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Python Requests Post Slack Message
"text":"Read <|Send Slack Message> for more details @slackuser #general"
"link_names": 1
import requests,json
def slack_message(message_text=None,payload_obj=None,slack_url=None):
if(not slack_url):
slack_url = ""
if(not payload_obj and message_text):
payload_obj = {"text":message_text,"link_names":1}
r = requests.put(slack_url,data=json.dumps(payload_obj))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.