Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to send color coded message to slack? #337

Open
yuvval opened this issue Dec 2, 2019 · 4 comments
Open

How to send color coded message to slack? #337

yuvval opened this issue Dec 2, 2019 · 4 comments
Assignees
Milestone

Comments

@yuvval
Copy link

yuvval commented Dec 2, 2019

I would like to color code my slack message using the 'good' (green) color code.
Any idea how can it be called?

I tried the following with no luck:

try1:

from notifiers import get_notifier

slack = get_notifier('slack')
slack._schema['properties']['attachments']['items']['properties']['color'] = 'good'
return slack.notify(message=msg,
            webhook_url=slack_bot_url)

try2:

from notifiers import get_notifier

slack = get_notifier('slack')
return slack.notify(message=msg,
            webhook_url=slack_bot_url, attachments=[{dict(color='good')}])
@welcome
Copy link

welcome bot commented Dec 2, 2019

Thanks for opening your first issue here! Be sure to follow the issue template! 👋🐞👋

@liiight
Copy link
Owner

liiight commented Dec 2, 2019

hmm, could you please link to the relevant place in slack docs? Can't seem to find it

@yuvval
Copy link
Author

yuvval commented Dec 3, 2019

slack message formatting api docs
Thanks!

@liiight liiight added this to the 2.0.0 milestone Apr 12, 2020
@liiight liiight self-assigned this Apr 12, 2020
@liiight
Copy link
Owner

liiight commented Apr 12, 2020

I have a branch with some pending changes for v2.0, I'll make sure it works for that version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants