Skip to content

Option to mention someone#4

Merged
junhwi merged 1 commit intojunhwi:masterfrom
spoqa:mention
Dec 18, 2017
Merged

Option to mention someone#4
junhwi merged 1 commit intojunhwi:masterfrom
spoqa:mention

Conversation

@dahlia
Copy link
Copy Markdown
Contributor

@dahlia dahlia commented Dec 13, 2017

Thank you for making a useful library!

This patch adds a new option named mention which purposes to send messages with mentioning someone. If the option is omitted it behaves as like it has done.

An example code follows:

import logging
from slack_logger import SlackHandler, SlackFormatter

sh = SlackHandler(
    'YOUR_WEB_HOOK_URL',
    username='python-slack-logger',
    icon_emoji=':thinking_face:',
    mention='U012ABC34'
)
sh.setFormatter(SlackFormatter())
logging.basicConfig(handlers=[sh])
logging.warning("Trying SlackHandler's mention= option...")

A message the above code sent looks like:

screen shot 2017-12-14 at 1 51 55 am

Postscript: Although its setup.py indicates the project is licensed under MIT, it would be more clear if the repository contains an explicit LICENSE file as well. GitHub also can recognize the LICENSE file so that it shows project's license on the overview bar.

@junhwi
Copy link
Copy Markdown
Owner

junhwi commented Dec 18, 2017

@dahlia Thank you for adding great feature!

@junhwi junhwi merged commit f49e691 into junhwi:master Dec 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants