Skip to content

Commit

Permalink
Release version 1.0.0
Browse files Browse the repository at this point in the history
  • Loading branch information
denisalevi committed Jan 24, 2020
1 parent 9a59b48 commit 8a1c0c1
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 17 deletions.
20 changes: 10 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -44,9 +44,9 @@ above).
```python
from clusterbot import ClusterBot

cb = ClusterBot()
cb.send("Hello world!")
cb.send("Hello again!")
bot = ClusterBot()
bot.send("Hello world!")
bot.send("Hello again!")
```

### Replying to a message (opening a Thread)
Expand All @@ -55,10 +55,10 @@ that the second and third message will be send as a reply to the first one.
```python
from clusterbot import ClusterBot

cb = ClusterBot()
message_id = cb.send("Hello world!")
cb.reply(message_id, "Hello again!")
cb.reply(message_id, "Hello once more!")
bot = ClusterBot()
message_id = bot.send("Hello world!")
bot.reply(message_id, "Hello again!")
bot.reply(message_id, "Hello once more!")
```

### Sending a message to someone else
Expand All @@ -68,9 +68,9 @@ calls:
```python
from clusterbot import ClusterBot

cb = ClusterBot()
message_id = cb.send("Hello world!", user_name='Denis Alevi')
cb.replay(message_id, "Hello world!", user_name='Denis Alevi')
bot = ClusterBot()
message_id = bot.send("Hello world!", user_name='Denis Alevi')
bot.replay(message_id, "Hello world!", user_name='Denis Alevi')
```
This will send a message and a threaded reply to Denis Alevi.

Expand Down
4 changes: 4 additions & 0 deletions clusterbot/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
"""
ClusterBot sends messages from your Python scripts to Slack.
"""
from .version import __version__
import logging
from .clusterbot import ClusterBot

Expand Down
1 change: 1 addition & 0 deletions clusterbot/version.py
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
__version__ = '1.0.0'
12 changes: 6 additions & 6 deletions example_script.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,18 +7,18 @@
#activate_logger('DEBUG')

# Send a message to the default user specified in you config files.
cb = ClusterBot()
message_id = cb.send("Starting example script.")
bot = ClusterBot()
message_id = bot.send("Starting example script.")
# Reply to the default user message from above (open a ne Thread).
cb.reply(message_id, "Waiting for 5s.")
bot.reply(message_id, "Waiting for 5s.")
# Wait 5 seconds.
time.sleep(5)
# Reply again.
cb.reply(message_id, "5s have passed.")
bot.reply(message_id, "5s have passed.")

# Send a message to someone else (not default user)
message_id = cb.send("Hi Denis. I started using ClusterBot :tada:",
message_id = bot.send("Hi Denis. I started using ClusterBot :tada:",
user_name="Denis Alevi")
# Reply to that message (message_id has to belong to a message exchanged with
# ``user_name``)
cb.reply(message_id, "And I ran the example script!", user_name="Denis Alevi")
bot.reply(message_id, "And I ran the example script!", user_name="Denis Alevi")
5 changes: 4 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,11 @@
import setuptools

# read __version__ from clusterbot/version.py
exec(open('clusterbot/version.py').read())

setuptools.setup(
name='slack-clusterbot',
version='dev',
version=__version__,
author='Denis Alevi',
author_email='[email protected]',
description="Send messages from your Python scripts to Slack.",
Expand Down

0 comments on commit 8a1c0c1

Please sign in to comment.