Quantcast
Channel: Active questions tagged python - Stack Overflow
Viewing all articles
Browse latest Browse all 23131

How can I color part of Slack incoming-webhook messages?

$
0
0

I want to compose a python script which sends a color-formatted message to a configured slack channel. I managed to send sentences of plain texts to slack channels but I could not figure out how to confer part of the sentences colors that I want.

I used slackweb library in python as below

import slackwebslack = slackweb.Slack(url = url_of_the_configured_channel)string_to_send = "test TEST"payload = {'text' : string_to_send}slack.notify(text=string_to_send)

how can I, say, format string_to_send or payload so that the word 'test' appears blue and 'TEST' appears red in the slack channel?

Thanks in advance.


Viewing all articles
Browse latest Browse all 23131

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>