Skip to content

Commit 12d87b7

Browse files
committed
nicer helper
1 parent 891e661 commit 12d87b7

File tree

3 files changed

+15
-3
lines changed

3 files changed

+15
-3
lines changed

stream_chat/__init__.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,3 +5,15 @@
55
__maintainer__ = "Tommaso Barbugli"
66
__email__ = "[email protected]"
77
__status__ = "Production"
8+
9+
from stream_chat import StreamChat
10+
11+
chat = StreamChat(api_key="STREAM_KEY", api_secret="STREAM_SECRET")
12+
13+
# add a user
14+
chat.update_user({"id": "chuck", "name": "Chuck"})
15+
16+
channel = chat.channel("team", "kung-fu")
17+
channel.create("chuck")
18+
19+
channel.send_message({"text": "AMA about kung-fu"})

stream_chat/client.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ def get_default_header():
2525
return base_headers
2626

2727

28-
class Client(object):
28+
class StreamChat(object):
2929
def __init__(self, api_key, api_secret, timeout=6.0, **options):
3030
self.api_key = api_key
3131
self.api_secret = api_secret

stream_chat/tests/conftest.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import uuid
22

33
import pytest
4-
from stream_chat.client import Client
4+
from stream_chat import StreamChat
55
import os
66

77

@@ -21,7 +21,7 @@ def pytest_runtest_setup(item):
2121

2222
@pytest.fixture(scope="module")
2323
def client():
24-
return Client(
24+
return StreamChat(
2525
api_key=os.environ["STREAM_KEY"],
2626
api_secret=os.environ["STREAM_SECRET"],
2727
timeout=10,

0 commit comments

Comments
 (0)