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

后端 未结 2 1459
野性不改
野性不改 2020-12-10 11:24

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 cou

2条回答
  •  庸人自扰
    2020-12-10 12:17

    What you can do (as an admittedly clumsy workaround until/unless Slack supports more than primitive formatting) is:

    • Create your message as a small graphic image on your server
    • upload the image's web address to the slack channel using the webhook
    • the message is now displayed in channel

    You can use ImageMagick for this.

    .png images allow for transparency, so you don't have to worry too much about background matching.

    This is, of course, a terribly inefficient way to go about it, but it has the agreeable characteristic of doing what you want.

提交回复
热议问题