Skip to content

Commit

Permalink
Merge pull request #9 from cyber-francis/initial_commit
Browse files Browse the repository at this point in the history
fix: requirements.txt
  • Loading branch information
cyber-francis authored Jan 2, 2024
2 parents 09f1d8d + 578e30b commit cf3cbd2
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 2 deletions.
18 changes: 17 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1 +1,17 @@
# send_slack_notification
# Slack-Notification
A simple way to send slack notification

## Install
```
pip install -i https://test.pypi.org/simple/ slack-notification
```

## Usage
```python
from slack_notification.slack_notification import SlackNotification

CHANNEL = "YOUR_CHANNEL" #example T06C3XXXXXX/B06CURXXXX/NU9qdi16r5IdXXXXXXX"
slack = SlackNotification(CHANNEL)
message = "YOUR_MESSAGE"
response = slack.notify(message)
```
2 changes: 1 addition & 1 deletion src/slack_notification/slack_notification.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def __init__(self, channel, timeout=10) -> None:
self._timeout = timeout

def notify(self, message):
message = {"text": message}
message = {"text": str(message)}
response = requests.post(
self._webhook, json.dumps(message).encode("utf-8"), timeout=self._timeout
)
Expand Down

0 comments on commit cf3cbd2

Please sign in to comment.